[cfe-dev] Unexpected warning in -std=gnu89 -pedantic mode.

Eli Friedman eli.friedman at gmail.com
Wed Aug 26 11:42:47 PDT 2009


On Wed, Aug 26, 2009 at 5:12 AM, Enea Zaffanella<zaffanella at cs.unipr.it> wrote:
> Hello.
>
> There seems to be a problem in the handling of diagnostic for GNU
> extensions: some warnings are produced even though the -std=gnu89 option
> is specified.
>
> $ cat aaa.c
> int foo() {
>   return ({2+3;});
> }
>
> $ clang-cc -std=gnu89 -pedantic aaa.c
> aaa.c:2:11: warning: use of GNU statement expression extension
>   return ({2+3;});
>           ^
> 1 diagnostic generated.
> $

I think it's worth noting that our behavior matches gcc here... what
exactly were you expecting?

-Eli




More information about the cfe-dev mailing list