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

Enea Zaffanella zaffanella at cs.unipr.it
Wed Aug 26 05:12:08 PDT 2009


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.
$


The same happens when using, e.g., __builtin_offsetof.


Cheers,
Enea Zaffanella.



More information about the cfe-dev mailing list