HP C Programmer's Guide (92434-90009)

Chapter 2 39
Storage and Alignment Comparisons
Aligning Structures Between Architectures
VAX/VMS C
The differences between HP C and VAX/VMS C are:
In HP C Series 700/800, the double type is 8-byte aligned; in VAX/VMS C, the double
type is 4-byte aligned.
In HP C, bit-fields are packed from left to right. In VAX/VMS C, the fields are packed
from right to left.
HP C uses big-endian data storage with the most significant byte on the left. VAX/VMS
C uses little-endian data storage with the most significant byte on the right. (See the
swab function in the HP-UX Reference manual for information about converting from
little-endian to big-endian.)
In VAX/VMS C, the data from the program in <Undefined Cross-Reference> is stored as
shown in <Undefined Cross-Reference>:
a+25 Fills out the structure to a 2-byte boundary and aligns the double u on a 2-byte
boundary.
a+37 Pads a to a 2-byte boundary.
Table 2-6. Padding with CCS/C
Padding
Location
Reason for Padding