From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129271 invoked by alias); 28 Oct 2017 17:15:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 129221 invoked by uid 89); 28 Oct 2017 17:15:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-14.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f47.google.com Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 28 Oct 2017 17:15:22 +0000 Received: by mail-wm0-f47.google.com with SMTP id z3so8873422wme.5 for ; Sat, 28 Oct 2017 10:15:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=QFcX5eB5aLc/3BbXGRWF4CRf+stySBfdqp8rVBtZdOE=; b=iRA0PHwLrDkYTGgHiihaHkv1M2o2gRIxO4XpKzRB3doxgguM5814M/+Po9/tFbuPF9 bTYLi/3TBUAISK6/WIYVNTM3l+dYae9I9iuA66+cu7tdnuOSkx//lKwvdiFqyGt1iZtA pnc+xVMlcGx7F5+hpqBTZt7AbjcS+p9ssTUZn1gNSBrEeQTUdOMnEeoXplcfCDTeAath acw+BnYE01xhgOE5hNYrl4DUxsM13l+en713Bw8bXu2iXRBoWXAZwnoF4rI6P3j83m6E 6BYnwyerYDnY18Ndw0JWU14fM3FgEc4VxoHTwYLu22ShWFpFFEowz0brfOCRI3tx1X+v 301Q== X-Gm-Message-State: AMCzsaUlmTB6FTaZ8u1UWdMlO/IZ+RYybVCiVymGqNOc64OFnT89v7Ie o3clYUABvaxY9L8QNxHpjgtHDRzJ X-Google-Smtp-Source: ABhQp+SdICk0NW21Sr/JT6s+A8pR/cSsPxN06zpCwngcdDclBNZMIVoEd/TDbno7hHkDsQw2ijnPnA== X-Received: by 10.28.62.145 with SMTP id l139mr3235771wma.150.1509210919832; Sat, 28 Oct 2017 10:15:19 -0700 (PDT) Received: from android-97b5c0ce9bfced28.fritz.box (p5494E455.dip0.t-ipconnect.de. [84.148.228.85]) by smtp.gmail.com with ESMTPSA id t14sm4386541wmc.46.2017.10.28.10.15.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Oct 2017 10:15:19 -0700 (PDT) Date: Sat, 28 Oct 2017 21:57:00 -0000 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Add -std=c17, -std=gnu17 To: gcc-patches@gcc.gnu.org,Joseph Myers From: Richard Biener Message-ID: X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg02134.txt.bz2 On October 27, 2017 11:56:47 PM GMT+02:00, Joseph Myers wrote: >C17, a bug-fix version of the C11 standard with DR resolutions >integrated, will soon go to ballot. This patch adds corresponding >options -std=3Dc17, -std=3Dgnu17 (new default version, replacing >-std=3Dgnu11 as the default), -std=3Diso9899: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=3Diso9899: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=3Dc2x / -std=3Dgnu2x / -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. Are the >non-front-end changes for the "GNU C17" language name OK? Yes.=20 Richard.=20 >gcc: >2017-10-27 Joseph Myers > > * doc/invoke.texi (C Dialect Options): Document -std=3Dc17, > -std=3Diso9899:2017 and -std=3Dgnu17. > * doc/standards.texi (C Language): Document C17 support. > * doc/cpp.texi (Overview): Mention -std=3Dc17. > (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: >2017-10-27 Joseph Myers > > * c.opt (std=3Dc17, std=3Dgnu17, std=3Diso9899: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=3Dc17 and -std=3Dgnu17. > >gcc/testsuite: >2017-10-27 Joseph Myers > > * gcc.dg/c17-version-1.c, gcc.dg/c17-version-2.c: New tests. > >libcpp: >2017-10-27 Joseph Myers > > * 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__. > >Index: gcc/c-family/c-opts.c >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/c-family/c-opts.c (revision 254145) >+++ gcc/c-family/c-opts.c (working copy) >@@ -115,6 +115,7 @@ static void set_std_cxx2a (int); > static void set_std_c89 (int, int); > static void set_std_c99 (int); > static void set_std_c11 (int); >+static void set_std_c17 (int); > static void check_deps_environment_vars (void); > static void handle_deferred_opts (void); > static void sanitize_cpp_opts (void); >@@ -236,8 +237,8 @@ c_common_init_options (unsigned int decoded_option >=20 > if (c_language =3D=3D clk_c) > { >- /* The default for C is gnu11. */ >- set_std_c11 (false /* ISO */); >+ /* The default for C is gnu17. */ >+ set_std_c17 (false /* ISO */); >=20 > /* If preprocessing assembly language, accept any of the C-family > front end options since the driver may pass them through. */ >@@ -675,6 +676,16 @@ c_common_handle_option (size_t scode, const char * > set_std_c11 (false /* ISO */); > break; >=20 >+ case OPT_std_c17: >+ if (!preprocessing_asm_p) >+ set_std_c17 (true /* ISO */); >+ break; >+ >+ case OPT_std_gnu17: >+ if (!preprocessing_asm_p) >+ set_std_c17 (false /* ISO */); >+ break; >+ > case OPT_trigraphs: > cpp_opts->trigraphs =3D 1; > break; >@@ -1559,6 +1570,21 @@ set_std_c11 (int iso) > lang_hooks.name =3D "GNU C11"; > } >=20 >+/* Set the C 17 standard (without GNU extensions if ISO). */ >+static void >+set_std_c17 (int iso) >+{ >+ cpp_set_lang (parse_in, iso ? CLK_STDC17: CLK_GNUC17); >+ flag_no_asm =3D iso; >+ flag_no_nonansi_builtin =3D iso; >+ flag_iso =3D iso; >+ flag_isoc11 =3D 1; >+ flag_isoc99 =3D 1; >+ flag_isoc94 =3D 1; >+ lang_hooks.name =3D "GNU C17"; >+} >+ >+ > /* Set the C++ 98 standard (without GNU extensions if ISO). */ > static void > set_std_cxx98 (int iso) >Index: gcc/c-family/c.opt >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/c-family/c.opt (revision 254145) >+++ gcc/c-family/c.opt (working copy) >@@ -1944,6 +1944,10 @@ std=3Dc1x > C ObjC Alias(std=3Dc11) > Deprecated in favor of -std=3Dc11. >=20 >+std=3Dc17 >+C ObjC >+Conform to the ISO 2017 C standard. >+ > std=3Dc89 > C ObjC Alias(std=3Dc90) > Conform to the ISO 1990 C standard. >@@ -2006,6 +2010,10 @@ std=3Dgnu1x > C ObjC Alias(std=3Dgnu11) > Deprecated in favor of -std=3Dgnu11. >=20 >+std=3Dgnu17 >+C ObjC >+Conform to the ISO 2017 C standard with GNU extensions. >+ > std=3Dgnu89 > C ObjC Alias(std=3Dgnu90) > Conform to the ISO 1990 C standard with GNU extensions. >@@ -2042,6 +2050,10 @@ std=3Diso9899:2011 > C ObjC Alias(std=3Dc11) > Conform to the ISO 2011 C standard. >=20 >+std=3Diso9899:2017 >+C ObjC Alias(std=3Dc17) >+Conform to the ISO 2017 C standard. >+ > traditional > Driver >=20 >Index: gcc/config/rl78/rl78.c >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/config/rl78/rl78.c (revision 254145) >+++ gcc/config/rl78/rl78.c (working copy) >@@ -360,6 +360,7 @@ rl78_option_override (void) > if (TARGET_ES0 > && strcmp (lang_hooks.name, "GNU C") > && strcmp (lang_hooks.name, "GNU C11") >+ && strcmp (lang_hooks.name, "GNU C17") > && strcmp (lang_hooks.name, "GNU C89") > && strcmp (lang_hooks.name, "GNU C99") >/* Compiling with -flto results in a language of GNU GIMPLE being >used... */ >Index: gcc/doc/cpp.texi >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/doc/cpp.texi (revision 254145) >+++ gcc/doc/cpp.texi (working copy) >@@ -211,8 +211,8 @@ Standard C@. In its default mode, the GNU C prepr > 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=3Dc90}, @option{-std=3Dc99} or >-@option{-std=3Dc11} options, depending >+you should use the @option{-std=3Dc90}, @option{-std=3Dc99}, >+@option{-std=3Dc11} or @option{-std=3Dc17} options, depending > on which version of the standard you want. To get all the mandatory > diagnostics, you must also use @option{-pedantic}. @xref{Invocation}. >=20 >@@ -1857,8 +1857,11 @@ implementation, unless GNU CPP is being used >with >=20 > 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). >=20 > This macro is not defined if the @option{-traditional-cpp} option is > used, nor when compiling C++ or Objective-C@. >Index: gcc/doc/extend.texi >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/doc/extend.texi (revision 254145) >+++ gcc/doc/extend.texi (working copy) >@@ -7775,8 +7775,8 @@ GCC implements three different semantics of >declar > inline. One is available with @option{-std=3Dgnu89} or > @option{-fgnu89-inline} or when @code{gnu_inline} attribute is present > on all inline declarations, another when >-@option{-std=3Dc99}, @option{-std=3Dc11}, >-@option{-std=3Dgnu99} or @option{-std=3Dgnu11} >+@option{-std=3Dc99}, >+@option{-std=3Dgnu99} or an option for a later C version is used > (without @option{-fgnu89-inline}), and the third > is used when compiling C++. >=20 >Index: gcc/doc/invoke.texi >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/doc/invoke.texi (revision 254145) >+++ gcc/doc/invoke.texi (working copy) >@@ -1831,6 +1831,13 @@ substantially completely supported, modulo bugs, >f > Annexes F and G) and the optional Annexes K (Bounds-checking > interfaces) and L (Analyzability). The name @samp{c1x} is deprecated. >=20 >+@item c17 >+@itemx iso9899:2017 >+ISO C17, the 2017 revision of the ISO C standard. This standard is >+same as C11 except for corrections of defects (all of which are also >+applied with @option{-std=3Dc11}) and a new value of >+@code{__STDC_VERSION__}, and so is supported to the same extent as >C11. >+ > @item gnu90 > @itemx gnu89 > GNU dialect of ISO C90 (including some C99 features). >@@ -1841,9 +1848,12 @@ GNU dialect of ISO C99. The name @samp{gnu9x} >is >=20 > @item gnu11 > @itemx gnu1x >-GNU dialect of ISO C11. This is the default for C code. >+GNU dialect of ISO C11. > The name @samp{gnu1x} is deprecated. >=20 >+@item gnu17 >+GNU dialect of ISO C17. This is the default for C code. >+ > @item c++98 > @itemx c++03 > The 1998 ISO C++ standard plus the 2003 technical corrigendum and some >Index: gcc/doc/standards.texi >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/doc/standards.texi (revision 254145) >+++ gcc/doc/standards.texi (working copy) >@@ -36,6 +36,8 @@ with some exceptions, and possibly with some exten > @cindex C11 > @cindex ISO C1X > @cindex C1X >+@cindex ISO C17 >+@cindex C17 > @cindex Technical Corrigenda > @cindex TC1 > @cindex Technical Corrigendum 1 >@@ -100,7 +102,11 @@ in 2011 as ISO/IEC 9899:2011. (While in developme > standard version were referred to as @dfn{C1X}.) > GCC has substantially complete support > for this standard, enabled with @option{-std=3Dc11} or >-@option{-std=3Diso9899:2011}.=20=20 >+@option{-std=3Diso9899:2011}. A version with corrections integrated is >+known as @dfn{C17} and is supported with @option{-std=3Dc17} or >+@option{-std=3Diso9899:2017}; the corrections are also applied with >+@option{-std=3Dc11}, and the only difference between the options is the >+value of @code{__STDC_VERSION__}. >=20 > By default, GCC provides some extensions to the C language that, on > rare occasions conflict with the C standard. @xref{C >Index: gcc/dwarf2out.c >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/dwarf2out.c (revision 254145) >+++ gcc/dwarf2out.c (working copy) >@@ -23434,6 +23434,8 @@ highest_c_language (const char *lang1, const >char >if (strcmp ("GNU C++98", lang1) =3D=3D 0 || strcmp ("GNU C++98", lang2) = =3D=3D >0) > return "GNU C++98"; >=20 >+ if (strcmp ("GNU C17", lang1) =3D=3D 0 || strcmp ("GNU C17", lang2) =3D= =3D >0) >+ return "GNU C17"; > if (strcmp ("GNU C11", lang1) =3D=3D 0 || strcmp ("GNU C11", lang2) =3D= =3D 0) > return "GNU C11"; > if (strcmp ("GNU C99", lang1) =3D=3D 0 || strcmp ("GNU C99", lang2) =3D= =3D 0) >@@ -23510,7 +23512,8 @@ gen_compile_unit_die (const char *filename) > language =3D DW_LANG_C99; >=20 > if (dwarf_version >=3D 5 /* || !dwarf_strict */) >- if (strcmp (language_string, "GNU C11") =3D=3D 0) >+ if (strcmp (language_string, "GNU C11") =3D=3D 0 >+ || strcmp (language_string, "GNU C17") =3D=3D 0) > language =3D DW_LANG_C11; > } > } >Index: gcc/testsuite/gcc.dg/c17-version-1.c >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/testsuite/gcc.dg/c17-version-1.c (nonexistent) >+++ gcc/testsuite/gcc.dg/c17-version-1.c (working copy) >@@ -0,0 +1,9 @@ >+/* Test __STDC_VERSION__ for C17. Test -std=3Dc17. */ >+/* { dg-do compile } */ >+/* { dg-options "-std=3Dc17 -pedantic-errors" } */ >+ >+#if __STDC_VERSION__ =3D=3D 201710L >+int i; >+#else >+#error "Bad __STDC_VERSION__." >+#endif >Index: gcc/testsuite/gcc.dg/c17-version-2.c >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- gcc/testsuite/gcc.dg/c17-version-2.c (nonexistent) >+++ gcc/testsuite/gcc.dg/c17-version-2.c (working copy) >@@ -0,0 +1,9 @@ >+/* Test __STDC_VERSION__ for C17. Test -std=3Diso9899:2017. */ >+/* { dg-do compile } */ >+/* { dg-options "-std=3Diso9899:2017 -pedantic-errors" } */ >+ >+#if __STDC_VERSION__ =3D=3D 201710L >+int i; >+#else >+#error "Bad __STDC_VERSION__." >+#endif >Index: libcpp/include/cpplib.h >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- libcpp/include/cpplib.h (revision 254145) >+++ libcpp/include/cpplib.h (working copy) >@@ -168,8 +168,8 @@ enum cpp_ttype > #undef TK >=20 > /* C language kind, used when calling cpp_create_reader. */ >-enum c_lang {CLK_GNUC89 =3D 0, CLK_GNUC99, CLK_GNUC11, >- CLK_STDC89, CLK_STDC94, CLK_STDC99, CLK_STDC11, >+enum c_lang {CLK_GNUC89 =3D 0, CLK_GNUC99, CLK_GNUC11, CLK_GNUC17, >+ CLK_STDC89, CLK_STDC94, CLK_STDC99, CLK_STDC11, CLK_STDC17, > CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX11, CLK_CXX11, > CLK_GNUCXX14, CLK_CXX14, CLK_GNUCXX17, CLK_CXX17, > CLK_GNUCXX2A, CLK_CXX2A, CLK_ASM}; >Index: libcpp/init.c >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >--- libcpp/init.c (revision 254145) >+++ libcpp/init.c (working copy) >@@ -98,10 +98,12 @@ static const struct lang_flags lang_defaults[] =3D >/* GNUC89 */ { 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0,=20=20=20= =20 >0, 0, 0 }, >/* GNUC99 */ { 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0,=20=20=20= =20 >0, 0, 0 }, >/* GNUC11 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0,=20=20=20= =20 >0, 0, 0 }, >+ /* GNUC17 */ { 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0,=20=20= =20 > 0, 0, 0 }, >/* STDC89 */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,=20=20=20= =20 >0, 1, 0 }, >/* STDC94 */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0,=20=20=20= =20 >0, 1, 0 }, >/* STDC99 */ { 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0,=20=20=20= =20 >0, 1, 0 }, >/* STDC11 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,=20=20=20= =20 >0, 1, 0 }, >+ /* STDC17 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0,=20=20= =20 > 0, 1, 0 }, >/* GNUCXX */ { 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0,=20=20=20= =20 >0, 0, 0 }, >/* CXX98 */ { 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0,=20=20=20= =20 >0, 1, 0 }, >/* GNUCXX11 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0,=20=20=20= =20 >0, 0, 0 }, >@@ -518,6 +520,9 @@ cpp_init_builtins (cpp_reader *pfile, int hosted) > _cpp_define_builtin (pfile, "__ASSEMBLER__ 1"); > else if (CPP_OPTION (pfile, lang) =3D=3D CLK_STDC94) > _cpp_define_builtin (pfile, "__STDC_VERSION__ 199409L"); >+ else if (CPP_OPTION (pfile, lang) =3D=3D CLK_STDC17 >+ || CPP_OPTION (pfile, lang) =3D=3D CLK_GNUC17) >+ _cpp_define_builtin (pfile, "__STDC_VERSION__ 201710L"); > else if (CPP_OPTION (pfile, lang) =3D=3D CLK_STDC11 > || CPP_OPTION (pfile, lang) =3D=3D CLK_GNUC11) > _cpp_define_builtin (pfile, "__STDC_VERSION__ 201112L");