MSDN原话
Each implementation of C and C++ supports some features unique to its host machine or operating system. Some programs, for instance, need to exercise precise control over the memory areas where data is placed or to control the way certain functions receive parameters. The #pragma directives offer a way for each compiler to offer machine- and operating-system-specific features while retaining overall compatibility with the C and C++ languages. Pragmas are machine- or operating-system-specific by definition, and are usually different for every compiler.
大概的意思是:
在保留C/C++兼容性的同时,#paragma为每个编译器给提供了一种方法来给出机器或操作系统特有的特征。#paragma指示符是机器或操作系统转悠的,且对于每个编译器来说是不同的。比如,有些程序需要精确控制数据存储区,有些需要控制程序接收参数的方式,这些都可以在预处理指令中通过#paragma来设定编译器状态或指示编译器完成特定动作来实现。
Syntax
#pragma token-string
alloc_text | comment | init_seg1 | optimize |
auto_inline | component | inline_depth | pack |
bss_seg | data_seg | inline_recursion | pointers_to_members1 |
check_stack | function | intrinsic | setlocale |
code_seg | hdrstop | message | vtordisp1 |
const_seg | include_alias | once | warning |
如果编译器发现不认识的token-string,编译器会产生告警,但编译过程继续。