#pragma

MSDN原话

Pragma Directives

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,编译器会产生告警,但编译过程继续。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值