[cfe-dev] Unexpected warning in -std=gnu89 -pedantic mode.
Chris Lattner
clattner at apple.com
Wed Aug 26 12:55:08 PDT 2009
On Aug 26, 2009, at 11:42 AM, Eli Friedman wrote:
>> $ 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?
Right, my understanding is that -pedantic emits warnings vs the base
language (c89 in this case) not vs "gnu89".
-Chris
More information about the cfe-dev
mailing list