Implementation defined behavior control
来自cppreference.com
< cpp | preprocessor
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
实现定义的行为是由
#pragma
指令.原文:
Implementation defined behavior is controlled by
#pragma
directive.目录 |
[编辑] 语法
#pragma pragma_params
|
|||||||||
[编辑] 解释
pragma指令控制的编译器,,如禁用编译器警告或改变对齐的要求,实施特定的行为。未确认任何杂忽视
原文:
Pragma directive controls implementation-specific behavior of the compiler, such as disabling compiler warnings or changing alignment requirements. Any pragma that is not recognized is ignored.
[编辑] 标准指示
以下三个pragma的语言标准被定义为:1
原文:
The following three pragmas are defined by the language standard:
#pragma STDC FENV_ACCESS arg
|
(1) | ||||||||
#pragma STDC FP_CONTRACT arg
|
(2) | ||||||||
#pragma STDC CX_LIMITED_RANGE arg
|
(3) | ||||||||
arg是
1) ON
或OFF
DEFAULT
. 原文:
where arg is either
ON
or OFF
or DEFAULT
. 如果设置为
2) ON
,告诉编译器,该计划将浮点环境,这意味着优化,可以颠覆标志测试和模式的变化(例如,全局公共子表达式消除,代码运动和常量折叠)禁止访问或修改。默认值是实现定义的,通常OFF
.原文:
If set to
ON
, informs the compiler that the program will access or modify 浮点环境, which means that optimizations that could subvert flag tests and mode changes (e.g., global common subexpression elimination, code motion, and constant folding) are prohibited. The default value is implementation-defined, usually OFF
.允许“承包”的浮点表达式,即忽略舍入误差浮点异常,如果完全按照书面的表达进行了评估,将观察的优化。默认值是实现定义的,通常
3) ON
.原文:
Allows contracting of floating-point expressions, that is optimizations that omit rounding errors and floating-point exceptions that would be observed if the expression was evaluated exactly as written. The default value is implementation-defined, usually
ON
.通知编译器,乘法,除法,复数的绝对值可能会使用最简单的数学公式,尽管中间溢出的可能性。传递给这些函数的值的范围内被预期是有限的。默认值是
OFF
原文:
Informs the compiler that multiplication, division, and absolute value of complex numbers may use simplified mathematical formulas, despite the possibility of intermediate overflow. The range of the values passed to those function is expected to be limited. The default value is
OFF
[编辑] 外部链接
- C++ pragmas in Visual Studio 2010
- Pragmas接受GCC 4.6.2
- General Purpose Pragmas in IBM AIX XL C/C++ V7.0
- Appendix B. Pragmas了Sun Studio 11 C + +用户指南“原文:Appendix B. Pragmas in Sun Studio 11 C++ User's Guide
- Intel C++ compiler pragmas