The gcc manual does not describe the behaviour of __attribute__((packed)) attached to a class definition, e.g.
class foo { unsigned char; unsigned long; } __attribute__((packed)); As far as I have observed, the behaviour is the same if foo would be declared as struct. The gcc manual describes packed only for variables, structs and enums. -- Summary: Missing Documentation: __attribute__((packed)) attached to a class definiton Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: fm3 at os dot inf dot tu-dresden dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25759