Re: jsonb is also breaking the rule against nameless unions

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: jsonb is also breaking the rule against nameless unions
Date: 2014-04-02 18:21:49
Message-ID: 20140402182149.GR3750@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-04-02 15:17:16 -0300, Alvaro Herrera wrote:
> Tom Lane wrote:
> > Same issue as in
> > http://www.postgresql.org/message-id/31718.1394059256@sss.pgh.pa.us
> >
> > In file included from jsonb.c:19:
> > ../../../../src/include/utils/jsonb.h:195: warning: unnamed struct/union that defines no instances
> > jsonb.c: In function `jsonb_in_object_field_start':
> > jsonb.c:250: structure has no member named `string'
> > jsonb.c:251: structure has no member named `string'
> > jsonb.c:251: structure has no member named `string'
> > jsonb.c:252: structure has no member named `string'
> > jsonb.c: In function `jsonb_put_escaped_value':
> > jsonb.c:266: structure has no member named `string'
> > jsonb.c:266: structure has no member named `string'
> > jsonb.c:271: structure has no member named `numeric'
> > jsonb.c:274: structure has no member named `boolean'
> > jsonb.c: In function `jsonb_in_scalar':
> > jsonb.c:301: structure has no member named `string'
> > jsonb.c:302: structure has no member named `string'
> > jsonb.c:302: structure has no member named `string'
> > jsonb.c:303: structure has no member named `string'
> > ... etc etc etc ...
> >
> > We really need to get a buildfarm member going that complains about this.
> > I had hoped to install a sufficiently old gcc version on prairiedog or
> > dromedary, but didn't have much luck rebuilding ancient gcc releases on
> > OS X.
>
> Complain how? I find that gcc -std=c90 -pedantic emits these warnings about
> it:
>
> def.c:3:24: warning: ISO C90 doesn’t support unnamed structs/unions [-pedantic]
> def.c:1:8: warning: struct has no named members [-pedantic]

Last time I checked gcc builds of postgres using -pedantic are so
verbose that warnings don't have an effect anymore. Is that not the case
anymore?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-04-02 18:36:28 Re: jsonb is also breaking the rule against nameless unions
Previous Message Andres Freund 2014-04-02 18:18:04 Re: jsonb is also breaking the rule against nameless unions