struct __attribute((packed));

E. Weddington ericw@evcohs.com
Fri Apr 15 16:42:00 GMT 2005


Paul Koning wrote:

> E> According to the docs here:
> E> <http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Type-Attributes.html#Type-Attributes>
>
> E> what about doing something like this?:
>
> E> typedef int packed_int
> E> __attribute__ ((aligned (1)));
>
> E> packed_int *ppi;
>
>That would make sense, but it has never worked for me.  It seems that
>attributes don't apply to type names, only to variables and members. 
>
>  
>
What?! That whole section in the docs talks about attributes on types. 
If it doesn't work as described, then the docs need some serious rework.

Eric



More information about the Gcc mailing list