#pragma align


The #pragma align directive specifies how the compiler should align data items within structures.


Read syntax diagramSkip visual syntax diagram>>-#--pragma--align--(--+-full-------+--)----------------------><

See also #pragma options.


The #pragma align=suboption directive overrides the -qalign compiler option setting for a specified section of program source code.

The compiler stacks alignment directives, so you can go back to using a previous alignment directive without knowing what it is by specifying the #pragma align(reset) directive.

For example, you can use this option if you have a class declaration within an include file and you do not want the alignment rule specified for the class to apply to the file in which the class is included. You can code #pragma align(reset) in a source file to change the alignment option to what it was before the last alignment option was specified. If no previous alignment rule appears in the file, the alignment rule specified in the invocation command is used.

Specifying #pragma align has the same effect as specifying #pragma options align in your source file. For more information and examples of #pragma align and #pragma options align usage, see -qalign.

Related information