9.10.11 packed
The packed
attribute specifies that a structure member
should have the smallest possible alignment unless you specify a larger value with the
aligned
attribute.
Here is a structure in which the member x
is packed, so
that it immediately follows a
, with no padding for alignment:
struct foo
{
char a;
int x[2] __attribute__ ((packed));
};
Note: The device architecture requires that words be aligned on
even byte boundaries, so care must be taken when using the
packed
attribute to avoid run-time addressing errors.