Names specified here
Name |
Description |
Notes
|
Source |
Availability |
__STDC__ |
Indicator of conforming implementation |
L |
|
M |
|
Predefined |
C89
|
C90
|
C95
|
C99
|
C11
|
__STDC_VERSION__ |
Standard version identifier |
L |
|
M |
|
Predefined |
|
|
C95
|
C99
|
C11
|
Name |
Standard |
Number of headers |
Number of names |
Expansion of __STDC_VERSION__ |
C89
|
ANSI X3.159-1989 |
15 |
323 |
undefined |
C90
|
ISO/IEC 9899-1990 |
15 |
323 |
undefined |
C95
|
ISO/IEC 9899-1995 |
18 |
416 |
199409L |
C99
|
ISO/IEC 9899-1999 |
24 |
1058 |
199901L |
C11
|
ISO/IEC 9899-2011 |
29 |
1308 |
201112L |
__STDC__
expands to 1
on all conforming
implementations of C. From C95,
__STDC_VERSION__
expands to an integer constant of the form yyyymmL
, indicating the year
yyyy and month mm in which the standard
was published. 201112L
indicates
C11, 199901L
indicates C99, and 199409L
indicates C95. Its
absence indicates C89 or
C90. Whatever the value, if you need
to detect a minimum version, compare numerically. For
example:
#if __STDC_VERSION__ > 199409L
/* */
#elif __STDC__
/* */
#else
/* */
#endif