GCC 编译标准-std=的设置方法
来源:互联网 发布:网络主播经纪人 编辑:程序博客网 时间:2024/05/21 07:47
1) 最初的 ANSI C 标准 (X3.159-1989) 在 1989 年被批准,并于 1990 年发布。稍后这个标准被接受为 ISO 标准 (ISO/IEC 9899:1990) 。虽然 ISO 标准将 ANSI 标准的某些章节重新编号并变为条款,但是两者实际上并无区别。不论是 ANSI 标准还是 ISO 标准,通常都称之为 C89 ,偶尔也因为发布日期而被叫做 C90 。 ANSI 标准 ( 非 ISO 标准 ) 同时附带了 rationale 文档。可以使用 -ansi , -std=c89 或 -std=iso9899:1990 选项指定 GCC 使用 C89 标准;可以使用 -pedantic 选项来得到所有的诊断信息( 或者使用 -pedantic-errors 选项以使 wangning 变为 error) 。PS:pedantic adj. 1. 卖弄学问的 2. 学究式的,迂腐的
2) 新的 ISO C 标准是 1999 年发布的 ISO/IEC 9899:1999 ,通常称之为 C99 。 GCC 目前不完整的支持这个版本。详情请参考http://gcc.gnu.org/gcc-4.4/c99status.html 。为了指定 GCC 使用这个版本的 C 标准,需要 -std=c99 或 -std=iso9899:1999 选项。
3) 默认情况下, GCC 提供了一些 C 语言的扩展,极少的几处会与 C 标准冲突。关于这些冲突请参考 “ C 语言家族的扩展 ” 一节。使用上述的 -std 选项将会关闭这些有冲突的扩展。你也可以显式的使用选项 -std=gnu89 ( 对应 C89 的 GNU 扩展 ) 或 -std=gnu99 ( 对应 C99 的 GNU 扩展 ) 来选择对应版本的扩展功能。如果没有给出 C 语言 “ 方言 ” 选项,将默认的使用 -std=gnu89 ;若要使用C99的特性要设置-std=gnu9x。
4)-std= 选择C语言编译标准
A value for this option must be provided; possible values are
- `c90'
- `c89'
- `iso9899:1990'
- Support all ISO C90 programs (certain GNU extensions that conflict with ISO C90 are disabled). Same as-ansi for C code.
- `iso9899:199409'
- ISO C90 as modified in amendment 1.
- `c99'
- `c9x'
- `iso9899:1999'
- `iso9899:199x'
- ISO C99. Note that this standard is not yet fully supported; see http://gcc.gnu.org/c99status.html for more information. The names `c9x' and `iso9899:199x' are deprecated.
- `c1x'
- ISO C1X, the draft of the next revision of the ISO C standard. Support is limited and experimental and features enabled by this option may be changed or removed if changed in or removed from the standard draft.
- `gnu90'
- `gnu89'
- GNU dialect of ISO C90 (including some C99 features). This is the default for C code.
- `gnu99'
- `gnu9x'
- GNU dialect of ISO C99. When ISO C99 is fully implemented in GCC, this will become the default. The name `gnu9x' is deprecated.
- `gnu1x'
- GNU dialect of ISO C1X. Support is limited and experimental and features enabled by this option may be changed or removed if changed in or removed from the standard draft.
- `c++98'
- The 1998 ISO C++ standard plus amendments. Same as -ansi for C++ code.
- `gnu++98'
- GNU dialect of -std=c++98. This is the default for C++ code.
- `c++0x'
- The working draft of the upcoming ISO C++0x standard. This option enables experimental features that are likely to be included in C++0x. The working draft is constantly changing, and any feature that is enabled by this flag may be removed from future versions of GCC if it is not part of the C++0x standard.
- `gnu++0x'
- GNU dialect of -std=c++0x. This option enables experimental features that may be removed in future versions of GCC.
- GCC 编译标准-std=的设置方法
- GCC 编译 -std简述
- gcc std=c99
- GCC与Dev-Cpp支持C99标准设置方法
- GCC与Dev-Cpp支持C99标准设置方法
- GCC MakeFile Asrc 的设置-GCC ASM混合编译
- GCC编译四步标准
- sys/time.h 是GCC的编译标准写法
- gcc编译设置
- gcc编译cpp文件的方法
- GCC不同版本的编译方法
- gcc编译cpp文件的方法
- gcc编译cpp文件的方法
- gcc 多源文件的编译方法
- gcc c 在for语句中声明变量需要编译时加“-std=c99”
- 检测 gcc 是否支持 C99 标准的方法
- GCC编译方法
- Windows XP虚拟内存的标准设置方法
- 智能指针(三):unique_ptr使用简介
- Leetcode_integer-to-roman
- 抽象接口(syntax erro和syntax erro) 题目Tao Bao
- 思科大中华区副总裁殷康:云计算已进入Intercloud时代
- 菜鸟记录学习java的点点滴滴之几个小错误
- GCC 编译标准-std=的设置方法
- sql文章阅读笔记二
- HDU3622 二分几何+2-SAT
- qt 处理ORACLE的AMERICAN_AMERICA.US7ASCII编码
- Json-lib简单使用
- 22、文字截图把背景变透明
- 记录
- 求数组中的最大值和次最大值、、、
- Chrome插件的学习入门