Fwd: Re: [GCC-XML] pragmas, preprocessor

Jason Stanek jstanek at iastate.edu
Thu Sep 30 12:07:20 EDT 2004


Sorry... I guess I had forgotten to send this to the list....

>Date: Fri, 24 Sep 2004 03:07:54 -0500
>To: Thomas Heller <theller at python.net>
>From: Jason Stanek <jstanek at iastate.edu>
>Subject: Re: [GCC-XML] pragmas, preprocessor
>
>All sizes are correct.
>
>The struct U declares a type inside your anonymous struct instance X.  You 
>never declare a member inside your anonymous struct of type U.  4 is the 
>correct size for X.
>
>The first "working" example works because you are declaring an instance of 
>type U called u.  The second example "works" because you are declaring an 
>anonymous struct.  I suggest reading about anonymous/unnamed structs.
>
>The code does exactly what it is supposed to do.  Easy mistake to make.
>
>Cheers.
>
>At 12:52 PM 09/23/2004, you wrote:
>>This program compiles and works (1300 structures, more than 8000
>>asserts), apart from one problem.  This structure gives the incorrect
>>size (4 instead of 8):
>>
>>struct {
>>     int a;
>>     struct U {
>>         int b;
>>     };
>>} X;




More information about the gccxml mailing list