HP C Programmer's Guide (92434-90009)

Chapter 2 35
Storage and Alignment Comparisons
Aligning Structures Between Architectures
shown above the variable names. Shaded cells indicate padding bytes.
Figure 2-9. Storage with HP C on the HP 9000 Series 700/800 and HP 3000 Series
900
The struct q is aligned on an 8-byte boundary because the most restrictive data type
within the structure is the double u.
Table on page 36 shows the padding for the example code fragment:
Table 2-4. Padding on HP 9000 Series 700/800 and HP 3000 Series 900
Padding Location Reason for Padding
a+1 The most restrictive type of the structure x is short; therefore, the
structure is 2-byte aligned.
a+5 Aligns the short z on a 2-byte boundary.
a+13 Fills out the struct x to a 2-byte boundary.