This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: struct __attribute((packed));


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]