struct __attribute((packed));

Dale Johannesen dalej@apple.com
Fri Apr 15 17:05:00 GMT 2005


On Apr 15, 2005, at 8:27 AM, E. Weddington wrote:

> Ralf Corsepius wrote:
>
>> Hi,
>>
>> I just tripped over this snipped below in a piece of code, I didn't
>> write and which I don't understand:
>>
>> ...
>> struct somestruct {
>>  struct entrystruct *e1 __attribute__ ((packed));
>>  struct entrystruct *e2 __attribute__ ((packed));
>> };
>> ...
>>
>> Is this meaningful?
>>
>> I guess the author wanted e1 and e2 to point to a "packed struct 
>> entrystruct", but this doesn't seem to be what GCC
>> interprets this code.

There is no reason a definition of "struct entrystruct" should even be 
visible at
this point, so that doesn't seem like a very reasonable interpretation.



More information about the Gcc mailing list