[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gccxml
Subject:    Fwd: Re: [GCC-XML] pragmas, preprocessor
From:       Jason Stanek <jstanek () iastate ! edu>
Date:       2004-09-30 16:07:20
Message-ID: 6.1.1.1.2.20040930110549.09126eb0 () jstanek ! mail ! iastate ! edu
[Download RAW message or body]

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@python.net>
>From: Jason Stanek <jstanek@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;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic