__attribute((packed)) type attribute

The packed type attribute specifies that a type must have the smallest possible alignment.

Note

This type attribute is a GNU compiler extension that the ARM compiler supports.

Show/hideErrors

Taking the address of a field with the packed attribute or in a structure with the packed attribute yields a __packed-qualified pointer. The compiler will produce a type error if you attempt to implicitly cast this pointer to a non-__packed pointer. This contrasts with its behavior for address-taken fields of a #pragma packed structure.

The compiler generates a warning message if you use this attribute in a typedef.

Show/hideSee also

Copyright © 2010-2012 ARM. All rights reserved.ARM DUI 0491G
Non-ConfidentialID021412