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

Fariborz Jahanian fjahanian at apple.com
Wed Aug 26 08:54:40 PDT 2009


On Aug 26, 2009, at 8:04 AM, Douglas Gregor wrote:

>
> On Aug 26, 2009, at 5:12 AM, Enea Zaffanella wrote:
>> There seems to be a problem in the handling of diagnostic for GNU
>> extensions: some warnings are produced even though the -std=gnu89
>> option
>>
>
> The fix for this issue would be to change 1311 of ParseExpr.cpp from
>
>     Diag(Tok, diag::ext_gnu_statement_expr);
>
> to
>
>   if (!getLang().GNUMode)
>     Diag(Tok, diag::ext_gnu_statement_expr);
Instead of checking for gnu mode, can we have a diagnostic group for  
all such diagnostics
and ignore them in -std=gnu89 mode?

- Fariborz

>
>
>> The same happens when using, e.g., __builtin_offsetof.
>
> It'll happen in many places, all of which will need to be changed with
> a check for GNUMode (for GNU extensions). I'd be happy to review and
> apply such a patch, if someone feels like tackling this.
>
> 	- Doug
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list