4.34 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
4.29 Types of data alignment
4.30 Advantages of natural data alignment
4.33 Unaligned data access in C and C++ code
Related reference
4.31 Compiler storage of data objects by natural byte alignment
4.32 Relevance of natural data alignment at compile time
9.12 __packed
9.91 #pragma pack(n)
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.