Re: jsonb is also breaking the rule against nameless unions

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: jsonb is also breaking the rule against nameless unions
Дата
Msg-id 20140402184320.GS3750@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: jsonb is also breaking the rule against nameless unions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: jsonb is also breaking the rule against nameless unions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2014-04-02 14:36:28 -0400, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > On 2014-04-02 15:17:16 -0300, Alvaro Herrera wrote:
> >> Tom Lane wrote:
> >>> We really need to get a buildfarm member going that complains about this.
>
> >> 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?
>
> Well, in any case, people very seldom check to see if any buildfarm
> members are producing compiler warnings.  You need the build to actually
> go red to get anyone's attention reliably.

Yea, we'd need to be able to turn on -Werror if it's going to have any
effect. I don't think our configure currently copes with that
unfortunately...

I just tried it on clang. It builds clean with -Wc11-extensions except
warning about _Static_assert(). That's possibly fixable with some
autoconf trickery.

> The non-C89 feature that I've been really worried about is flexible
> array members (which we intend to start using more heavily, so we need
> a complaint if someone leaves out the FLEXIBLE_ARRAY_MEMBER macro).
> Based on the last month or so I guess that anonymous unions are a big
> issue as well.  I'd like to have a buildfarm member whose compiler
> doesn't recognize either of those ... and AFAICT, -pedantic is no
> help for the array case.

gcc's -pedantic warns about flexible array members here, but it doesn't
solve the problem with it being unusable :(

Greetings,

Andres Freund

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: jsonb is also breaking the rule against nameless unions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: jsonb is also breaking the rule against nameless unions