General Purpose Pragmas

The pragmas listed below are available for general programming use. Unless noted otherwise, pragmas can be used in both C and C++ programs.


Language Application #pragma Description
Artwork for ngclang Artwork for ngcpp
#pragma align Aligns data items within structures.
Artwork for ngclang
#pragma alloca Provides an inline version of the function alloca(size_t size).
Artwork for ngclang Artwork for ngcpp
#pragma altivec_vrsave Adds code to function prologs and epilogs to maintain the VRSAVE register.
Artwork for ngclang Artwork for ngcpp
#pragma block_loop Instructs the compiler to create a blocking loop for a specific loop in a loop nest.
Artwork for ngclang Artwork for ngcpp
#pragma chars Sets the sign type of character data.
Artwork for ngclang Artwork for ngcpp
#pragma comment Places a comment into the object file.
Artwork for ngclang Artwork for ngcpp
#pragma complexgcc Instructs the compiler how to pass parameters when calling complex math functions.
Artwork for ngcpp
#pragma define Forces the definition of a template class without actually defining an object of the class.
Artwork for ngclang Artwork for ngcpp
#pragma disjoint Lists the identifiers that are not aliased to each other within the scope of their use.
Artwork for ngcpp
#pragma do_not_instantiate Suppresses instantiation of a specified template declaration.
Artwork for ngclang Artwork for ngcpp
#pragma enum Specifies the size of enum variables that follow.
Artwork for ngclang Artwork for ngcpp
#pragma execution_frequency Lets you mark program source code that you expect will be either very frequently or very infrequently executed.
Artwork for ngcpp
#pragma hashome Informs the compiler that the specified class has a home module that will be specified by the IsHome pragma.
Artwork for ngclang Artwork for ngcpp
#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.
Artwork for ngcpp
#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.
Artwork for ngclang Artwork for ngcpp
#pragma info Controls the diagnostic messages generated by the info(...) compiler options.
Artwork for ngcpp
#pragma instantiate Causes immediate instantiation of a specified template declaration.
Artwork for ngcpp
#pragma ishome Informs the compiler that the specified class's home module is the current compilation unit.
Artwork for ngclang Artwork for ngcpp
#pragma isolated_call Marks a function that does not have or rely on side effects, other than those implied by its parameters.
Artwork for ngclang
#pragma langlvl Selects the C or C++ language level for compilation.
Artwork for ngclang Artwork for ngcpp
#pragma leaves Takes a function name and specifies that the function never returns to the instruction after the function call.
Artwork for ngclang Artwork for ngcpp
#pragma loop_id Marks a block with a scope-unique identifier.
Artwork for ngclang Artwork for ngcpp
#pragma map Tells the compiler that all references to an identifier are to be converted to a new name.
Artwork for ngclang Artwork for ngcpp
#pragma mc_func Lets you define a function containing a short sequence of machine instructions.
Artwork for ngclang Artwork for ngcpp
#pragma nosimd Instructs the compiler to not generate VMX (Vector Multimedia Extension) instructions in the for loop immediately following this directive.
Artwork for ngclang Artwork for ngcpp
#pragma novector Instructs the compiler to not auto-vectorize the next loop.
Artwork for ngclang Artwork for ngcpp
#pragma options Specifies options to the compiler in your source program.
Artwork for ngclang Artwork for ngcpp
#pragma option_override Specifies alternate optimization options for specific functions.
Artwork for ngclang Artwork for ngcpp
#pragma pack Modifies the current alignment rule for members of structures that follow this pragma.
Artwork for ngcpp
#pragma priority Specifies the order in which static objects are to be initialized.
Artwork for ngclang Artwork for ngcpp
#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.
Artwork for ngclang Artwork for ngcpp
#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.
Artwork for ngcpp
#pragma report Controls the generation of specific messages.
Artwork for ngclang Artwork for ngcpp
#pragma stream_unroll Breaks a stream contained in a loop into multiple streams.
Artwork for ngclang Artwork for ngcpp
#pragma strings Sets storage type for strings.
Artwork for ngclang Artwork for ngcpp
#pragma unroll Unrolls innermost and outermost loops in the program. This can help improve program performance.
Artwork for ngclang Artwork for ngcpp
#pragma unrollandfuse Instructs the compiler to attempt an unroll and fuse operation on nested for loops. This can help improve program performance.
Artwork for ngclang Artwork for ngcpp
#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 Tasks

Specify Compiler Options in Your Program Source Files IBM Copyright 2003