#pragma Directives Overview Index
Go Up to The Preprocessor Index
C++Builder supports the following #pragma directives:
Directive | Description | Classic Compiler | Clang Compiler |
---|---|---|---|
#pragma comment | Writes a comment record in the object file. This can include linking to a library module. See Auto Linking for more information. | ||
#pragma link | Instructs the linker to link the file into an executable file. See Auto Linking for more information. | ||
#pragma exit | Indicates a function to be run on program exit (before _exit). | ||
#pragma message | Prints the specified message at compile time. | ||
#pragma package | Controls the initialization order of packages and other aspects related to packages. | ||
#pragma resource | Emits a comment record that instructs the linker to mark the file as a form unit. | ||
#pragma startup | Indicates a function to be run on program startup (before main). | ||
#pragma alias | Indicates that two identifier names are equivalent. | ||
#pragma alignment | Prints the alignment setting and enum size. | ||
#pragma anon_struct | Allows compiling anonymous structures. | ||
#pragma argsused | Inhibits warning about unused arguments. | ||
#pragma checkoption | Verifies that the specified options are set. | ||
#pragma codeseg | Indicates the code segment for function allocation. | ||
#pragma codestring | Emits bytes into the code segment. | ||
#pragma defineonoption | Defines the specified symbol if the specified options are set. | ||
#pragma delphiheader | Indicates the bounds of a Delphi header. | ||
#pragma explicit_rtti | Specifies for what class or record members (public, protected, and so on) RTTI should be generated. | ||
#pragma extref | Forces an external reference for the specified symbol. | ||
#pragma hdrfile | Specifies the name of the precompiled header. | ||
#pragma hdrignore | Obsolete. | ||
#pragma hdrstop | Stops the precompiling after the current header. | ||
#pragma implements | Emits a comment record containing the name of the current unit to the object file. | ||
#pragma init_seg | Affects the order in which startup code is executed. | ||
#pragma inline | Causes the compiler to restart itself with the option -B .
|
||
#pragma intrinsic | Overrides the options that control the inlining of functions. | ||
#pragma nopushoptwarn | Suppresses the warnings about mismatched #pragma option push/pop. | ||
#pragma nopackwarning | Suppresses the warnings about mismatched #pragma pack push/pop. | ||
#pragma noretval | Indicates that a function doesn't return. | ||
#pragma obsolete | Indicates that the specified symbol is obsolete. | ||
#pragma once | Indicates that the current header file must be included once. | ||
#pragma option | Saves the current options and sets the specified options. | ||
#pragma pack | Sets the structure packing alignment. | ||
#pragma region/end_region | Indicates code regions. Used by the IDE editor for code folding. | ||
#pragma samecodeseg | Places the specified functions in the same code segment. | ||
#pragma sizeof | Prints the size of the specified aggregate. | ||
#pragma sysheader | Indicates the bounds of a system header. | ||
#pragma undefineonoption | Undefines the specified symbol if the specified options are set. | ||
#pragma warn | Enables/disables warnings. |
Note: For many of the #pragma directives supported only by the Classic compiler, the Clang compiler silently accepts them but does not actually do anything.
Note: To view all Clang pragmas see Clang's Compiler User Manual.