What is the __STDC_VERSION__ value for C11?

后端 未结 2 1174
不思量自难忘°
不思量自难忘° 2020-12-05 13:14

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

相关标签:
2条回答
  • 2020-12-05 13:44

    According to this post to the GCC mailing list, the final value is, as you suspected, 201112L.

    0 讨论(0)
  • 2020-12-05 13:49

    With -std=c11 in gcc, 201112L is used for __STDC_VERSION__

    See this gcc patch on December 20, 2011 on gcc ml:

    https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg23572.html

    And note that apparently the ISO version of C11 forgot to update the 201ymmL from the Draft.

    The intended final __STDC_VERSION__ value, 201112L, is also implemented (the editor forgot to update the 201ymmL placeholders before sending the document for publication by ISO).

    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")

    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.

    0 讨论(0)
提交回复
热议问题