HP C/iX Reference Manual (31506-90011)
Chapter 9 155
HP C/iX Implementation Topics
Data Alignment Pragma
Table on page 157 shows the padding for the example code fragment when using
HP_ALIGN MPE_16:
The differences between the HP_ALIGN MPE_16 and the native MPE/iX alignments are:
• MPE/V aligned records are aligned on a 2-byte boundary. MPE/iX aligned records are
aligned according to the most restrictive data type within the structure.
• MPE/V aligned doubles are 2-byte aligned. MPE/iX aligned doubles are 8-byte aligned
within structures.
• MPE/V aligned long doubles, available in ANSI mode only, are 2-byte aligned. MPE/iX
aligned long doubles are 8-byte aligned within structures.
• MPE/V aligned enumerated data types are 2-byte aligned in a structure, array, or
union. MPE/iX aligned enumerated types are always 4-byte aligned.
Table 9-4. Padding Using the HP_ALIGN MPE_16 Pragma
Padding
Location
Reason For Padding
a+1 Within structures, align structure x on a 2-byte boundary.
a+5 Aligns the short z on a 2-byte boundary.
a+13 Structures within structures are aligned on a 2-byte boundary.
a+17 Aligns the short z on a 2-byte boundary.
a+25 Doubles are 2-byte aligned within structures.
a+36 Aligns char m on a byte boundary.