Aligning data in aggregates

XL C/C++ provides many mechanisms for specifying data alignment at the levels of individual variables, members of aggregates, entire aggregates, and entire compilation units. If you are porting applications between different platforms, or between 32-bit and 64-bit modes, you will need to take into account the differences between alignment settings available in the different environments, to prevent possible data corruption and deterioration in performance.

Using alignment modes and modifiers discusses the default alignment settings for all data types on the different platforms and addressing models; options you can use to control the alignment of aggregates and aggregate members; and general rules for aggregate alignment.

Using and aligning bit fields discusses additional rules and considerations for the use and alignment of bit fields, and provides an example of bit-packed alignment. IBM Copyright 2003