4.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
4.30 Types of data alignment
4.31 Advantages of natural data alignment
4.34 Unaligned data access in C and C++ code
4.36 Unaligned fields in structures
4.37 Performance penalty associated with marking whole structures as packed
Related reference
4.32 Compiler storage of data objects by natural byte alignment
4.33 Relevance of natural data alignment at compile time
9.12 __packed
9.93 #pragma pack(n)
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.