The __align keyword allows you to specify an explicit
alignment for a data structure. The keyword is an orthogonal language
extension intended to be used in the definition of an aggregate type or in the
declaration of a first-level variable. The specified byte boundary
affects the alignment of an aggregate as a whole, not that of its
members. The __align specifier can be applied to an
aggregate definition nested within another aggregate definition, but not to
individual elements of an aggregate or class. The alignment
specification is ignored for parameters and automatic variables.
A declaration takes one of the following forms:
>>-declarator--__align--(--int_constant--)--identifier--;------><
Structure or union syntax:
>>-__align--(--int_constant--)--struct_or_union_specifier--+-----+--{--struct_declaration_list--}--;->< '-tag-'
where:
Restrictions and limitations
The __align specifier cannot be used where the size of the variable alignment is smaller than the size of the type alignment.
Not all alignments may be representable in an object file.
The __align specifier cannot be applied to the following:
The alignment of an aggregate is not guaranteed to be aligned in memory on
the boundary specified by __align. The reason is that
certain iSeries types require a specific alignment. If an aggregate has
a member that is of one of these types, the alignment specified by
__align on the aggregate will be superseded by that required by
it member. For example, a 16-byte iSeries pointer must be
aligned on a 16-byte boundary.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.