Summary of XL C/C++ pragmas

The pragmas listed below are available for general programming use.

#pragma Description
#pragma align Aligns data items within structures.
C only #pragma alloca Provides an inline version of the function alloca(size_t size).
#pragma block_loop Instructs the compiler to create a blocking loop for a specific loop in a loop nest.
#pragma chars Sets the sign type of character data.
#pragma comment Places a comment into the object file.
#pragma STDC cx_limited_range Instructs the compiler that within the scope it controls, complex division is only invoked with values such that intermediate calculation will not overflow or lose significance.
C++ only #pragma define Forces the definition of a template class without actually defining an object of the class.
#pragma disjoint Lists the identifiers that are not aliased to each other within the scope of their use.
C++ only #pragma do_not_instantiate Suppresses instantiation of a specified template declaration.
#pragma enum Specifies the size of enum variables that follow.
#pragma execution_frequency Lets you mark program source code that you expect will be either very frequently or very infrequently executed.
C++ only #pragma hashome Informs the compiler that the specified class has a home module that will be specified by the IsHome pragma.
#pragma ibm snapshot Allows the user to specify a location at which a breakpoint can be set and to define a list of variables that can be examined when program execution reaches that location.
C++ only #pragma implementation Tells the compiler the name of the file containing the function-template definitions that correspond to the template declarations in the include file which contains the pragma.
#pragma info Controls the diagnostic messages generated by the info(...) compiler options.
C++ only #pragma instantiate Causes immediate instantiation of a specified template declaration.
C++ only #pragma ishome Informs the compiler that the specified class's home module is the current compilation unit.
#pragma isolated_call Marks a function that does not have or rely on side effects, other than those implied by its parameters.
C only #pragma langlvl Selects the C or C++ language level for compilation.
#pragma leaves Takes a function name and specifies that the function never returns to the instruction after the function call.
#pragma loop_id Marks a block with a scope-unique identifier.
#pragma map Tells the compiler that all references to an identifier are to be converted to a new name.
#pragma mc_func Lets you define a function containing a short sequence of machine instructions.
C++ only #pragma namemangling Sets the name mangling scheme and maximum length of external names generated from source code.
C++ only #pragma nameManglingRule Instructs the compiler whether or not to mangle function names according to their function parameter types.
#pragma nosimd instructs the compiler to not generate VMX (Vector Multimedia Extension) instructions in the loop immediately following this directive.
#pragma novector Instructs the compiler to not auto-vectorize the next loop.
C++ only #pragma object_model Specifies the object model to use for the structures, unions, and classes that follow it.
#pragma options Specifies options to the compiler in your source program.
#pragma option_override Specifies alternate optimization options for specific functions.
#pragma pack Modifies the current alignment rule for members of structures that follow this pragma.
C++ only #pragma pass_by_value Specifies how classes containing const or reference members are passed in function arguments. All classes in the compilation unit are affected by this option.
C++ only #pragma priority Specifies the order in which static objects are to be initialized.
#pragma reachable Declares that the point after the call to a routine marked reachable can be the target of a branch from some unknown location.
#pragma reg_killed_by Specifies those registers which value will be corrupted by the specified function. It must be used together with #pragma mc_func.
C++ only #pragma report Controls the generation of specific messages.
#pragma stream_unroll Breaks a stream contained in a loop into multiple streams.
#pragma strings Sets storage type for strings.
#pragma unroll Unrolls innermost and outermost loops in the program. This can help improve program performance.
#pragma unrollandfuse Instructs the compiler to attempt an unroll and fuse operation on nested for loops. This can help improve program performance.
#pragma weak Prevents the link editor from issuing error messages if it does not find a definition for a symbol, or if it encounters a symbol multiply-defined during linking.

Related information