Avoid using __stdc_version__ macro because it is implementation dependent
danowar2k opened this issue · 1 comments
danowar2k commented
From the GNU compiler pages:
__STDC_VERSION__
This macro expands to the C Standard’s version number, a long integer constant of the form yyyymmL where yyyy and mm are the year and month of the Standard version. This signifies which version of the C Standard the compiler conforms to. Like __STDC__, this is not necessarily accurate for the entire implementation, unless GNU CPP is being used with GCC.
The value 199409L signifies the 1989 C standard as amended in 1994, which is the current default; the value 199901L signifies the 1999 revision of the C standard; the value 201112L signifies the 2011 revision of the C standard; the value 201710L signifies the 2017 revision of the C standard (which is otherwise identical to the 2011 version apart from correction of defects). An unspecified value larger than 201710L is used for the experimental -std=c2x and -std=gnu2x modes.
This macro is not defined if the -traditional-cpp option is used, nor when compiling C++ or Objective-C.
I think you can instead use the __cplusplus macro...
danowar2k commented
Sorry for that, I just realized you don't even use that macro, but some system dependent headers do that.