aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-11-16 22:23:30 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2017-11-16 22:23:30 +0000
commit1e39313ac00c633263dfd11e06b782c9d988cad8 (patch)
treefb24110c6c1d839a3552ced475422f5d12218223 /gcc/c-family
parent727bd12ea30debe9c17958508858960d5fa3d2b9 (diff)
downloadgcc-1e39313ac00c633263dfd11e06b782c9d988cad8.zip
gcc-1e39313ac00c633263dfd11e06b782c9d988cad8.tar.gz
gcc-1e39313ac00c633263dfd11e06b782c9d988cad8.tar.bz2
Add -std=c18 etc. option aliases.
ISO C17 won't go to ballot until December, meaning publication of the standard won't be until 2018, leaving ambiguity as to whether people will end up referring to the standard as C17, as it's currently known and which corresponds to the __STDC_VERSION__ value, or C18 based on the publication date. In case people end up referring to this standard as C18, this patch adds corresponding option aliases -std=c18, -std=iso9899:2018, -std=gnu18 so people can use those names based on publication date if they wish. The "expected to be" explanations in help texts and the manual can be removed as and when the standard is published, hopefully before GCC 8 is out. Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc: * doc/invoke.texi (-std=c17): Refer to 2018 expected publication date of C17. (-std=c18, -std=iso9899:2018, -std=gnu18): Document option aliases. gcc/c-family: * c.opt (-std=c17, std=gnu17, -std=iso9899:2017): Refer to 2018 expected publication date of C17. (-std=c18, -std=gnu18, -std=iso9899:2018): New option aliases. gcc/testsuite: * gcc.dg/c18-version-1.c, gcc.dg/c18-version-2.c: New tests. From-SVN: r254847
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c.opt18
2 files changed, 21 insertions, 3 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 3127635..990cd61 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2017-11-16 Joseph Myers <joseph@codesourcery.com>
+
+ * c.opt (-std=c17, std=gnu17, -std=iso9899:2017): Refer to 2018
+ expected publication date of C17.
+ (-std=c18, -std=gnu18, -std=iso9899:2018): New option aliases.
+
2017-11-15 Joseph Myers <joseph@codesourcery.com>
PR c/81156
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 479ae63..d857dfc 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -1950,7 +1950,11 @@ Deprecated in favor of -std=c11.
std=c17
C ObjC
-Conform to the ISO 2017 C standard.
+Conform to the ISO 2017 C standard (expected to be published in 2018).
+
+std=c18
+C ObjC Alias(std=c17)
+Conform to the ISO 2017 C standard (expected to be published in 2018).
std=c89
C ObjC Alias(std=c90)
@@ -2016,7 +2020,11 @@ Deprecated in favor of -std=gnu11.
std=gnu17
C ObjC
-Conform to the ISO 2017 C standard with GNU extensions.
+Conform to the ISO 2017 C standard (expected to be published in 2018) with GNU extensions.
+
+std=gnu18
+C ObjC Alias(std=gnu17)
+Conform to the ISO 2017 C standard (expected to be published in 2018) with GNU extensions.
std=gnu89
C ObjC Alias(std=gnu90)
@@ -2056,7 +2064,11 @@ Conform to the ISO 2011 C standard.
std=iso9899:2017
C ObjC Alias(std=c17)
-Conform to the ISO 2017 C standard.
+Conform to the ISO 2017 C standard (expected to be published in 2018).
+
+std=iso9899:2018
+C ObjC Alias(std=c17)
+Conform to the ISO 2017 C standard (expected to be published in 2018).
traditional
Driver