This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: struct __attribute((packed));
- From: "E. Weddington" <ericw at evcohs dot com>
- To: Dave Korn <dave dot korn at artimi dot com>
- Cc: 'Ralf Corsepius' <ralf dot corsepius at rtems dot org>, 'GCC List' <gcc at gcc dot gnu dot org>,'Joel Sherrill' <joel dot sherrill at OARcorp dot com>
- Date: Fri, 15 Apr 2005 10:35:09 -0600
- Subject: Re: struct __attribute((packed));
- References: <SERRANO13pL32ctFfj80000018d@SERRANO.CAM.ARTIMI.COM>
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