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. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) |
#pragma link | Instructs the linker to link the file into an executable file. See Auto Linking for more information. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) |
#pragma exit | Indicates a function to be run on program exit (before _exit). | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) |
#pragma message | Prints the specified message at compile time. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) |
#pragma package | Controls the initialization order of packages and other aspects related to packages. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) |
#pragma resource | Emits a comment record that instructs the linker to mark the file as a form unit. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) |
#pragma startup | Indicates a function to be run on program startup (before main). | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) |
#pragma alias | Indicates that two identifier names are equivalent. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma alignment | Prints the alignment setting and enum size. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma anon_struct | Allows compiling anonymous structures. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma argsused | Inhibits warning about unused arguments. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma checkoption | Verifies that the specified options are set. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma codeseg | Indicates the code segment for function allocation. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma codestring | Emits bytes into the code segment. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma defineonoption | Defines the specified symbol if the specified options are set. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma delphiheader | Indicates the bounds of a Delphi header. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma explicit_rtti | Specifies for what class or record members (public, protected, and so on) RTTI should be generated. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma extref | Forces an external reference for the specified symbol. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma hdrfile | Specifies the name of the precompiled header. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma hdrignore | Obsolete. | | |
#pragma hdrstop | Stops the precompiling after the current header. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma implements | Emits a comment record containing the name of the current unit to the object file. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma init_seg | Affects the order in which startup code is executed. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma inline | Causes the compiler to restart itself with the option -B . | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma intrinsic | Overrides the options that control the inlining of functions. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma nopushoptwarn | Suppresses the warnings about mismatched #pragma option push/pop. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma nopackwarning | Suppresses the warnings about mismatched #pragma pack push/pop. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma noretval | Indicates that a function doesn't return. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma obsolete | Indicates that the specified symbol is obsolete. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma once | Indicates that the current header file must be included once. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma option | Saves the current options and sets the specified options. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma pack | Sets the structure packing alignment. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma region/end_region | Indicates code regions. Used by the IDE editor for code folding. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma samecodeseg | Places the specified functions in the same code segment. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma sizeof | Prints the size of the specified aggregate. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma sysheader | Indicates the bounds of a system header. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma undefineonoption | Undefines the specified symbol if the specified options are set. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) | |
#pragma warn | Enables/disables warnings. | ![Allowed.png](https://img-blog.csdnimg.cn/img_convert/806eaab898e42127efe6af8f6866ffd8.png) |