diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-04-30 08:58:39 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-04-30 08:58:39 +0200 |
commit | a2452a68917bcf2d45fd911de779f8e9911c4ca6 (patch) | |
tree | b9cd1073b7e1ff2849bf69b802fbb02f647dc40d /libcpp | |
parent | bd35a92f8d44e91c96e8b6f01805fe4a68acf9eb (diff) | |
download | gcc-a2452a68917bcf2d45fd911de779f8e9911c4ca6.zip gcc-a2452a68917bcf2d45fd911de779f8e9911c4ca6.tar.gz gcc-a2452a68917bcf2d45fd911de779f8e9911c4ca6.tar.bz2 |
libcpp: Adjust __STDC_VERSION__ for C23
While the C23 standard isn't officially release yet,
in 2011 we've changed __STDC_VERSION__ value for C11 already
in the month in which the new __STDC_VERSION__ value has been
finalized, so we want to change this now or wait
until we implement all the C23 features?
Note, seems Clang up to 17 also used 202000L for -std=c2x but
Clang 18+ uses 202311L as specified in the latest C23 drafts.
2024-04-30 Jakub Jelinek <jakub@redhat.com>
* init.cc (cpp_init_builtins): Change __STDC_VERSION__
for C23 from 202000L to 202311L.
* doc/cpp.texi (__STDC_VERSION__): Document 202311L value
for -std=c23/-std=gnu23.
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/init.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcpp/init.cc b/libcpp/init.cc index 54fc923..c457fa6 100644 --- a/libcpp/init.cc +++ b/libcpp/init.cc @@ -594,7 +594,7 @@ cpp_init_builtins (cpp_reader *pfile, int hosted) _cpp_define_builtin (pfile, "__STDC_VERSION__ 199409L"); else if (CPP_OPTION (pfile, lang) == CLK_STDC23 || CPP_OPTION (pfile, lang) == CLK_GNUC23) - _cpp_define_builtin (pfile, "__STDC_VERSION__ 202000L"); + _cpp_define_builtin (pfile, "__STDC_VERSION__ 202311L"); else if (CPP_OPTION (pfile, lang) == CLK_STDC17 || CPP_OPTION (pfile, lang) == CLK_GNUC17) _cpp_define_builtin (pfile, "__STDC_VERSION__ 201710L"); |