Aligning aggregate data

Structures are aligned according to the most strictly aligned member in both 32-bit and 64-bit modes. However, since long types and pointers change size and alignment in 64-bit, the alignment of a structure's strictest member can change, resulting in changes to the alignment of the structure itself.

Structures that contain pointers or long types cannot be shared between 32-bit and 64-bit applications. Unions that attempt to share long and int types, or overlay pointers onto int types can change the alignment. In general, you should check all but the simplest structures for alignment and size dependencies.

In 64-bit mode, member values in a structure passed by value to a va_arg argument might not be accessed properly if the size of the structure is not a multiple of 8-bytes.

For detailed information on aligning data structures, including structures that contain bit fields, see Aligning data.