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: structure members of packed structures


On Monday, July 14, 2003, at 02:39 PM, Mark Mitchell wrote:
On Mon, 2003-07-14 at 08:58, Nathan Sidwell wrote:
Given,

struct Unpacked { int i; };

struct  __attribute__ ((packed)) Packed
{
   char c;
   Unpacked u;
};

where should 'u' be placed? Our current behavour is to pack it so that
Unpacked's members are unaligned.

options
1) continue this behaviour, but prevent taking references/address of u or
any of its members.

Contingent on STRICT_ALIGNMENT, please. Unaligned accesses are not a problem on all architectures.


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