5.35 The __packed qualifier and unaligned data access in C and C++ code

The __packed qualifier sets the alignment of any valid type to 1.

This enables objects of packed type to be read or written using unaligned access.

Examples of objects that can be packed include:

  • Structures.

  • Unions.

  • Pointers.

Related concepts
5.30 Types of data alignment
5.31 Advantages of natural data alignment
5.34 Unaligned data access in C and C++ code
Related reference
5.32 Compiler storage of data objects by natural byte alignment
5.33 Relevance of natural data alignment at compile time
10.12 __packed
10.95 #pragma pack(n)
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.