ILE C/C++ Compiler Reference
Specifies the alignment rules to use for members of structures, unions and
classes in the source code. PACKSTRUCT sets the packing value to be
used for the members of structures, but not for the structures
themselves.
If the data types are by default packed along boundaries smaller than those
specified by #pragma pack, they are still aligned along the smaller
boundaries. For example:
- Type char is always aligned along a 1-byte boundary.
- 16-byte pointers will be aligned on a 16-byte boundary. PACKSTRUCT,
_Packed, and #pragma pack cannot alter this.
- 8-byte pointers can have any alignment, but 8-byte alignment is
preferred.
For more information on packing and alignment, see pragma pack.
|--+------------------------------+-----------------------------|
| .-*NATURAL-. |
'-PACKSTRUCT(--+-1--------+--)-'
+-2--------+
+-4--------+
+-8--------+
'-16-------'
- *NATURAL
- Default setting. The natural alignment for the members of
structures is used.
- 1
- Structures and unions are packed along 1-byte boundaries.
- 2
- Structures and unions are packed along 2-byte boundaries.
- 4
- Structures and unions are packed along 4-byte boundaries.
- 8
- Structures and unions are packed along 8-byte boundaries.
- 16
- Structures and unions are packed along 16-byte boundaries.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.