You can specify compiler options within your program source by using pragma directives.
A pragma is an implementation-defined instruction to the compiler. It has one of the general forms given below:
.--------------------. V | >>-#--pragma----character_sequence-+---------------------------><
Where character_sequence is a series of characters that give specific compiler instruction and arguments, if any. More than one pragma construct can be specified on a single pragma directive.
The unary operator _Pragma allows a preprocessor macro to be contained in a pragma directive:
>>-_Pragma--(string_literal)-----------------------------------><
The string_literal may be prefixed with L, making it a wide-string literal. The string literal is destringized and tokenized. The resulting sequence of tokens is processed as if it appeared in a pragma directive. For example:
_Pragma ( "pack(full)" )
would be equivalent to
#pragma pack(full)
The character_sequence on a pragma is subject to macro substitutions, unless otherwise stated. The compiler ignores unrecognized pragmas, issuing an informational message indicating this.
Options specified with pragma directives in program source files override all other option settings, except other pragma directives. The effect of specifying the same pragma directive more than once varies. See the description for each pragma for specific information.
Pragma settings can carry over into included files. To avoid potential unwanted side-effects from pragma settings, you should consider resetting pragma settings at the point in your program source where the pragma-defined behavior is no longer required. Some pragma options offer reset or pop suboptions to help you do this. These pragma directives are listed in the detailed descriptions of the options to which they apply.
For complete details on the various pragma preprocessor directives supported by XL C/C++, see Compiler pragmas reference.