https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107954

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Joseph Myers <js...@gcc.gnu.org>:

https://gcc.gnu.org/g:fad61bf73b3158157a136bf4d9373fc3d9afe319

commit r14-5160-gfad61bf73b3158157a136bf4d9373fc3d9afe319
Author: Joseph Myers <jos...@codesourcery.com>
Date:   Mon Nov 6 15:01:22 2023 +0000

    c: Add -std=c23, -std=gnu23, -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=c23 to GCC,
    and there was support for doing so.

    Add -std=c23, making -std=c2x a deprecated alias; also add the alias
    -std=iso9899:2024.  Likewise, add -std=gnu23, making -std=gnu2x 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=c23 and
            -std=gnu23 instead of -std=c2x and -std=gnu2x.
            * doc/extend.texi (Attribute Syntax): Refer to C23 and -std=c23
            instead of C2x and -std=c2x.
            * doc/invoke.texi (-Wc11-c23-compat, -std=c23, -std=gnu23)
            (-std=iso9899:2024): Document, with -Wc11-c2x-compat, -std=c2x and
            -std=gnu2x as deprecated aliases.  Update descriptions of C23.
            * doc/standards.texi (Standards): Describe C23 with C2X as an old
            name.

    gcc/c-family/
            * c.opt (Wc11-c2x-compat): Rename to Wc11-c23-compat and make into
            a deprecated alias of Wc11-c23-compat.
            (std=c2x): Rename to std=c23 and make into a deprecated alias of
            std=c23.
            (std=gnu2x): Rename to std=gnu23 and make into a deprecated alias
            of std=gnu23.
            (std=iso9899:2024): New option.  Alias of std=c23.
            * 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.

Reply via email to