struct __attribute((packed));

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


Dave Korn wrote:

>
>
>
>  I've often wished that __attribute__s would behave like CV-quals:
>
>char * const ptr;
>
>  == const pointer to char
>
>struct entrystruct * __attribute__ ((packed)) entry;
>
>  == packed pointer to struct
>
>char const *  ptr;
>
>  == pointer to const char
>
>struct entrystruct __attribute__ ((packed))  * entry;
>
>  ==  pointer to packed struct
>
>  I haven't done an exhaustive survey of attributes, but I know it doesn't
>work that way for section attributes, and there have been times when I would
>have liked it to.
>  
>
That's got my vote! (As if anyone's counting). That would make things so 
much easier, for example, in the AVR port for dealing with multiple 
memory spaces.

Eric



More information about the Gcc mailing list