[cfe-dev] Bug in __extension__ handling for record fields

Abramo Bagnara abramobagnara at tin.it
Sat Aug 15 02:46:47 PDT 2009


Chris Lattner ha scritto:
> 
> On Aug 13, 2009, at 2:53 AM, Abramo Bagnara wrote:
> 
>> This log shows the problem:
>>
>> $ cat q.c
>>
>> struct {
>>  __extension__ unsigned long long b;
>> } a;
>> $ ~/llvm/Debug/bin/clang-cc -pedantic -std=c89 q.c
>> q.c:3:31: warning: 'long long' is an extension when C99 mode is not
>> enabled
>>  __extension__ unsigned long long b;
>>                              ^
>> 1 diagnostic generated.
> 
> This sounds like a reasonable approach to me!

I've attached the patch.

I've preferred to put the flag in Declarator to have it available for a
wider range of Declaration.

Once this patch is commited (and if you agree) I'd like to submit a
further patch to map the saved extension flag in an appropriate
attribute to save this info in the AST (there is a FIXME somewhere in
clang stating this needs).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extension.patch
Type: text/x-patch
Size: 3492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090815/2c95a0ab/attachment.bin>


More information about the cfe-dev mailing list