------- Additional Comments From sabre at nondot dot org  2005-07-26 16:25 
-------
Okay, in that case, how does one change the alignment of the structure?  The 
only way I'm aware of to 
do this is with attribute packed, but that will also modify the inter-field 
padding of the structure.  For 
example, in this case:

struct Test {
  double D __attribute__((packed,aligned(4)));
  short X;
  int Y;
  short Z;
} __attribute__((packed,aligned(4)));

Not only is the alignment of the structure reduced to 4 bytes, the structure is 
also packed, resulting in 
the 'int' being unaligned and the size of the structure being 16 bytes (instead 
of 20).

"it sure would be nice if you could use 'attribute aligned' to reduce alignment 
without attribute packed"

-Chris

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23071

Reply via email to