ILE C/C++ Compiler Reference


__align Specifier

The __align specifier lets you specify the alignment of a Data Item or a ILE C/C++ aggregate (such as a struct or union for ILE C, as well as classes for ILE C++). However, __align does not affect the alignment of members within an aggregate, only the alignment of the aggregate as a whole. Also, because of restrictions for certain members of an aggregate, such as 16-byte pointers, the alignment of an aggregate is not guaranteed to be aligned in memory on the boundary specified by __align. For example, an aggregate that has a 16-byte pointer as its only member cannot have any other alignment other than 16-byte alignment because all 16-byte pointers must be aligned on the 16-byte boundary.

Read syntax diagramSkip visual syntax diagram__align syntax
 
>>-declarator--__align--(--+----+--)--identifer--;-------------><
                           +-1--+
                           +-2--+
                           +-4--+
                           +-8--+
                           '-16-'
 
Read syntax diagramSkip visual syntax diagramstruct_specifier syntax
 
>>-struct_specifier--__align--(--+----+--)--+-----------+--{--struct_declaration_list--}--;-><
                                 +-1--+     '-identifer-'
                                 +-2--+
                                 +-4--+
                                 +-8--+
                                 '-16-'
 

You can also use the __align specifier to explicitly specify alignment when declaring or defining data items, as shown in some of the examples that follow.

The __align specifier:


[ Top of Page | Previous Page | Next Page | Contents | Index ]