Darwin ignores the alignment/packed attributes on this structure, forcing the structure to have 8-byte alignment and 16-byte size:
--- struct Test { double D __attribute__((packed,aligned(4))); short X; }; --- Ian Lance Taylor did a great analysis of the history of this, tracking it back to a patch by David Edelsohn in 1996. The analysis is here: http://gcc.gnu.org/ml/gcc-help/2005-07/msg00280.html -Chris -- Summary: Darwin alignment ignores "attribute packed" for first 'double' element of a struct Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P2 Component: target AssignedTo: dje at watson dot ibm dot com ReportedBy: sabre at nondot dot org CC: gcc-bugs at gcc dot gnu dot org,ian at airs dot com GCC host triplet: powerpc-darwin-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23071