[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] ✘STRUCTARRAY() warnings
From: |
Eric S. Raymond |
Subject: |
Re: [gpsd-dev] ✘STRUCTARRAY() warnings |
Date: |
Fri, 14 Jun 2019 18:40:21 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
Gary E. Miller <address@hidden>:
> Yo All!
>
> Some of Fred's OS have many warnings like this:
>
> MacSLS: rtcm2_json.c: In function 'json_rtcm2_read':
> MacSLS: rtcm2_json.c:64: warning: initialized field overwritten
> MacSLS: rtcm2_json.c:64: warning: (near initialization for
> 'json_rtcm1[8].addr.a
> rray')
>
> They have been around a long time, but not on any OS I run.
>
> Here is the code:
>
> const struct json_attr_t json_rtcm1[] = {
> RTCM2_HEADER
> {"satellites", t_array, STRUCTARRAY(rtcm2->gps_ranges.sat,
> rtcm1_satellite, &satcount)},
> {NULL},
> };
>
> The problem is from json.h, this macro:
>
> #define STRUCTARRAY(a, e, n) \
> .addr.array.element_type = t_structobject, \
> .addr.array.arr.objects.subtype = e, \
> .addr.array.arr.objects.base = (char*)a, \
> .addr.array.arr.objects.stride = sizeof(a[0]), \
> .addr.array.count = n, \
> .addr.array.maxlen = NITEMS(a)
>
> Anyone got a clue?
I wish I could say I did. But I've never seen this.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
signature.asc
Description: PGP signature