diff options
author | Joseph Myers <joseph@codesourcery.com> | 2017-10-30 12:17:40 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2017-10-30 12:17:40 +0000 |
commit | c76dc9c32d616eff1e0ae162042f1c0f8ca65fbf (patch) | |
tree | b75365b3cb27dcf745496a2403394a4df80386d6 /gcc/doc/cpp.texi | |
parent | aa650b641022754c1ee6a58130fe2984d06d9657 (diff) | |
download | gcc-c76dc9c32d616eff1e0ae162042f1c0f8ca65fbf.zip gcc-c76dc9c32d616eff1e0ae162042f1c0f8ca65fbf.tar.gz gcc-c76dc9c32d616eff1e0ae162042f1c0f8ca65fbf.tar.bz2 |
Add -std=c17, -std=gnu17.
C17, a bug-fix version of the C11 standard with DR resolutions
integrated, will soon go to ballot. This patch adds corresponding
options -std=c17, -std=gnu17 (new default version, replacing
-std=gnu11 as the default), -std=iso9899:2017. As a bug-fix version
of the standard, there is no need for flag_isoc17 or any options for
compatibility warnings; however, there is a new __STDC_VERSION__
value, so new cpplib languages CLK_GNUC17 and CLK_STDC17 are added to
support using that new value with the new options. (If the standard
ends up being published in 2018 and being known as C18, option aliases
can be added. Note however that -std=iso9899:199409 corresponds to a
__STDC_VERSION__ value rather than a publication date.)
(There are a couple of DR resolutions needing implementing in GCC, but
that's independent of the new options.)
(I'd propose to add -std=c2x / -std=gnu2x / -Wc11-c2x-compat for the
next major C standard revision once there are actually C2x drafts
being issued with new features included.)
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
gcc:
* doc/invoke.texi (C Dialect Options): Document -std=c17,
-std=iso9899:2017 and -std=gnu17.
* doc/standards.texi (C Language): Document C17 support.
* doc/cpp.texi (Overview): Mention -std=c17.
(Standard Predefined Macros): Document C11 and C17 values of
__STDC_VERSION__. Do not refer to C99 support as incomplete.
* doc/extend.texi (Inline): Do not list individual options for
standards newer than C99.
* dwarf2out.c (highest_c_language, gen_compile_unit_die): Handle
"GNU C17".
* config/rl78/rl78.c (rl78_option_override): Handle "GNU C17"
language name.
gcc/c-family:
* c.opt (std=c17, std=gnu17, std=iso9899:2017): New options.
* c-opts.c (set_std_c17): New function.
(c_common_init_options): Use gnu17 as default C version.
(c_common_handle_option): Handle -std=c17 and -std=gnu17.
gcc/testsuite:
* gcc.dg/c17-version-1.c, gcc.dg/c17-version-2.c: New tests.
libcpp:
* include/cpplib.h (enum c_lang): Add CLK_GNUC17 and CLK_STDC17.
* init.c (lang_defaults): Add GNUC17 and STDC17 data.
(cpp_init_builtins): Handle C17 value of __STDC_VERSION__.
From-SVN: r254216
Diffstat (limited to 'gcc/doc/cpp.texi')
-rw-r--r-- | gcc/doc/cpp.texi | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 759532d..8cafb65 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -211,8 +211,8 @@ Standard C@. In its default mode, the GNU C preprocessor does not do a few things required by the standard. These are features which are rarely, if ever, used, and may cause surprising changes to the meaning of a program which does not expect them. To get strict ISO Standard C, -you should use the @option{-std=c90}, @option{-std=c99} or -@option{-std=c11} options, depending +you should use the @option{-std=c90}, @option{-std=c99}, +@option{-std=c11} or @option{-std=c17} options, depending on which version of the standard you want. To get all the mandatory diagnostics, you must also use @option{-pedantic}. @xref{Invocation}. @@ -1857,8 +1857,11 @@ implementation, unless GNU CPP is being used with GCC@. The value @code{199409L} signifies the 1989 C standard as amended in 1994, which is the current default; the value @code{199901L} signifies -the 1999 revision of the C standard. Support for the 1999 revision is -not yet complete. +the 1999 revision of the C standard; the value @code{201112L} +signifies the 2011 revision of the C standard; the value +@code{201710L} signifies the 2017 revision of the C standard (which is +otherwise identical to the 2011 version apart from correction of +defects). This macro is not defined if the @option{-traditional-cpp} option is used, nor when compiling C++ or Objective-C@. |