cc23

What is the __STDC_VERSION__ value for C23?


What is the STDC_VERSION value for C11? asks about C11, and How can I use "nullptr" for null pointers prior to C23? says that the current versions of GCC and Clang define it to a placeholder value 202000L.

GCC 14 Release Series Changes, New Features, and Fixes has now added the std=c23 flag, but doesn't mention what __STDC_VERSION__ expands to.


Solution

  • From N3220:

    __STDC_VERSION__ The integer constant 202311L

    popular name edition constant
    C23 fifth 202311L
    C17/18 fourth 201710L
    C11 third 201112L
    C99 second 199901L
    C?? first, amendment 1 199409L

    It was in the first edition, amendment 1, to C89/90 where the addition of the predefined __STDC_VERSION__ macro was made. I'm unsure if it goes by any popular name but C94/95 has been suggested.