问题描述
我知道,编译器使用 __ STDC __
来表示一个编译器是标准的C,并从,在那里,你可以使用 __ STDC_VERSION __
来找出哪些级别的您正在使用的标准。
I know that compilers use __STDC__
to indicate that a compiler is standard C and, from, there, you can use __STDC_VERSION__
to figure out which level of the standard you're using.
我也知道,C90没有价值,C90修正1例 199401L
和C99有 199901L
。
I also know that C90 had no value, C90 amendment 1 had 199401L
and C99 had 199901L
.
最新的C1X草案我只是指出它作为 201ymmL
和我假设它作出的最终标准不那么含糊不清的价值。
The latest C1x draft I have simply states it as 201ymmL
and I'm assuming it was made a less "vague" value in the final standard.
我的猜测是,这将是 201112L
,因为那个时候,C11获得批准,但我想肯定。
My guess is that it will be 201112L
since that's when C11 was ratified but I'd like to be certain.
我想我可以尝试使用的gcc -std = C1X
,但我跑没有按了的gcc版本T支持呢。
I thought I could try using
gcc -std=c1x
but the version of gcc
I'm running doesn't support that yet.
有谁知道的实际值是什么?
Does anyone know what the actual value is?
推荐答案
通过
-std = C11
在 GCC
, 201112L
用于 __ __ STDC_VERSION
请参阅本
GCC
补丁2011年12月20日 GCC
毫升:
See this
gcc
patch on December 20, 2011 on gcc
ml:
http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg23572.html
和注意,显然ISO版本C11的忘记更新
201ymmL
从草案。
And note that apparently the ISO version of C11 forgot to update the
201ymmL
from the Draft.
预期的最终的 __ __ STDC_VERSION 价值,201112L,也可以实现(编辑忘了由ISO发送文档出版之前更新201ymmL占位符)。
另请参阅,这使得它的官方预期值为
201112升
。编辑曾表示,。 (TC =技术勘误)
See also DR #411, which makes it official that the intended value is
201112l
. The editor has said that "The committee is trying to get it approved as a TC as soon as possible.". (TC = "Technical Corrigendum")
修改(2012年7月16日):技术勘误1(的)于2012年7月15日修正了
__ __ STDC_VERSION
发布 201112L
。
EDIT (July 16, 2012): Technical Corrigendum 1 (ISO/IEC 9899:2011/Cor 1:2012) released on July 15, 2012 fixes the
__STDC_VERSION__
to 201112L
.
这篇关于什么是C11的__STDC_VERSION__价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!