From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 05DF03858419; Mon, 6 Nov 2023 15:03:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05DF03858419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699282985; bh=QZ17bqrqhQ87r7FzUZLV3a7ySyvl9WHAIiAyFFyQmH0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cZQ/HRfjm/jQ7QfilltbJnhbhrOmhxsus6ZKZBcYFDrcq5LST7xenFbOHiWXGl9pi Obb/BHVDqz2fZ4UdE8jh996IwnNfwSRevXsBRSzfxWVQh8PJBIMoNiT00mSXO4Jk3X Y0Nb8OlsL6Wg2/mGmkbxwPAqGt1ZpE5bnfbn31TQ= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107954] Support -std=c23/gnu23 as aliases of -std=c2x/gnu2x Date: Mon, 06 Nov 2023 15:03:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: diagnostic, documentation, internal-improvement X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107954 --- Comment #7 from CVS Commits --- The master branch has been updated by Joseph Myers : https://gcc.gnu.org/g:fad61bf73b3158157a136bf4d9373fc3d9afe319 commit r14-5160-gfad61bf73b3158157a136bf4d9373fc3d9afe319 Author: Joseph Myers Date: Mon Nov 6 15:01:22 2023 +0000 c: Add -std=3Dc23, -std=3Dgnu23, -Wc11-c23-compat options [PR107954] At the June WG14 meeting, WG14 decided it preferred to keep C23 as the informal name for the next revision of the C standard, despite publication not being before 2024 (publication is due in 2024 whether or not technical changes at the January meeting result in an FDIS ballot being needed). At the Cauldron I raised the question of whether we should thus now add option names such as -std=3Dc23 to GCC, and there was support for doing so. Add -std=3Dc23, making -std=3Dc2x a deprecated alias; also add the alias -std=3Diso9899:2024. Likewise, add -std=3Dgnu23, making -std=3Dgnu2x a deprecated alias, and add -Wc11-c23-compat, making -Wc11-c2x-compat a deprecated alias. Here, I'm generally just adding the new options and making the minimum changes required to do so, with documentation changed to refer to C23 instead of C2X only where directly associated with documentation of these options. It's intended that future changes will update documentation, diagnostics, comments, variable names, testcase names, etc. to refer consistently to C23. When such changes are made, the new tests c23-opts-3.c, c23-opts-5.c and gnu23-opts-2.c are intended to keep using the old option names they are specifically testing, while other tests would start using the c23/gnu23 versions of the names (as well as the tests themselves being renamed). Updating option names is independent of updating to the final __STDC_VERSION__ value. There, the question is whether we should update the value now or wait for the remaining significant features to be implemented first. (I intend to review Martin's tag compatibility patches for GCC 14. I'm not aware of anyone working on #embed - or on the [[unsequenced]] and [[reproducible]] attributes, though support for standard attributes is optional.) Bootstrapped with no regressions for x86_64-pc-linux-gnu. PR c/107954 gcc/ * doc/cpp.texi (__STDC_VERSION__): Refer to -std=3Dc23 and -std=3Dgnu23 instead of -std=3Dc2x and -std=3Dgnu2x. * doc/extend.texi (Attribute Syntax): Refer to C23 and -std=3Dc= 23 instead of C2x and -std=3Dc2x. * doc/invoke.texi (-Wc11-c23-compat, -std=3Dc23, -std=3Dgnu23) (-std=3Diso9899:2024): Document, with -Wc11-c2x-compat, -std=3D= c2x and -std=3Dgnu2x as deprecated aliases. Update descriptions of C23. * doc/standards.texi (Standards): Describe C23 with C2X as an o= ld name. gcc/c-family/ * c.opt (Wc11-c2x-compat): Rename to Wc11-c23-compat and make i= nto a deprecated alias of Wc11-c23-compat. (std=3Dc2x): Rename to std=3Dc23 and make into a deprecated ali= as of std=3Dc23. (std=3Dgnu2x): Rename to std=3Dgnu23 and make into a deprecated= alias of std=3Dgnu23. (std=3Diso9899:2024): New option. Alias of std=3Dc23. * c-lex.cc (interpret_float): Use OPT_Wc11_c23_compat instead of OPT_Wc11_c2x_compat. * c-opts.cc (c_common_handle_option): Use OPT_std_c23 instead of OPT_std_c2x and OPT_std_gnu23 instead of OPT_std_gnu2x. gcc/c/ * c-errors.cc (pedwarn_c11): Use OPT_Wc11_c23_compat instead of OPT_Wc11_c2x_compat. * c-typeck.cc (build_conditional_expr, convert_for_assignment): Use OPT_Wc11_c23_compat instead of OPT_Wc11_c2x_compat. gcc/testsuite/ * gcc.dg/c23-opts-1.c, gcc.dg/c23-opts-2.c, gcc.dg/c23-opts-3.c, gcc.dg/c23-opts-4.c, gcc.dg/c23-opts-5.c, gcc.dg/gnu23-opts-1.c, gcc.dg/gnu23-opts-2.c: New tests.=