HP C/iX Reference Manual (31506-90011)

Chapter 9 153
HP C/iX Implementation Topics
Data Alignment Pragma
Native Data Alignment on HP C/iX
Figure 9-3 shows how the data in Figure 9-2. on page 154 is stored in memory when using
HP C/iX. The values are shown above the variable names. Memory locations containing
shading are padding bytes.
Figure 9-3. Storage with HP C/iX
The structure a is aligned on an 8-byte boundary because the most restrictive data type
within the structure is the double u.
Table on page 153 shows the padding for the example code fragment:
Table 9-3. Padding on HP 9000 Series 700/800 and HP 3000 Series 900
Padding Location Reason for Padding
a+1 Aligns the structure x on a 2-byte boundary because the most
restrictive member is short.