Pragma directive syntax

XL C/C++ supports the following forms of pragma directives:
#pragma name
This form uses the following syntax:
Read syntax diagramSkip visual syntax diagram
              .------------------------.   
              V                        |   
>>-#--pragma----name--(--suboptions--)-+-----------------------><

The name is the pragma directive name, and the suboptions are any required or optional suboptions that can be specified for the pragma, where applicable.

_Pragma ("name")
This form uses the following syntax:
Read syntax diagramSkip visual syntax diagram
                  .------------------------.         
                  V                        |         
>>-_Pragma--(--"----name--(--suboptions--)-+--"--)-------------><

For example, the statement:
_Pragma ( "pack(1)" ) 
is equivalent to:
#pragma pack(1)
For all forms of pragma statements, you can specify more than one name and suboptions in a single #pragma statement.

The name on a pragma is subject to macro substitutions, unless otherwise stated. The compiler ignores unrecognized pragmas, issuing an informational message indicating this.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us