aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2023-11-07 14:19:36 +0000
committerJoseph Myers <joseph@codesourcery.com>2023-11-07 14:20:30 +0000
commit094a609c69e5608311a39ff66eb646ca3be70652 (patch)
tree075a2dbb50cfd7aa7d20d36a5d91ffd92a2e5995 /gcc/c
parentbeb1e2bf1bd4b7c8fc8d3dd450667344ae8e0aca (diff)
downloadgcc-094a609c69e5608311a39ff66eb646ca3be70652.zip
gcc-094a609c69e5608311a39ff66eb646ca3be70652.tar.gz
gcc-094a609c69e5608311a39ff66eb646ca3be70652.tar.bz2
c: Refer more consistently to C23 not C2X
Continuing the move to refer to C23 in place of C2X throughout the source tree, update documentation, diagnostics, comments, variable and function names, etc., to use the C23 name. Testsuite updates are left for a future patch, except for testcases that test diagnostics that previously mentioned C2X (but in those testcases, sometimes other comments are updated, not just the diagnostic expectations). Bootstrapped with no regressions for x86_64-pc-linux-gnu. gcc/ * builtins.def (DEF_C2X_BUILTIN): Rename to DEF_C23_BUILTIN and use flag_isoc23 and function_c23_misc. * config/rl78/rl78.cc (rl78_option_override): Compare lang_hooks.name with "GNU C23" not "GNU C2X". * coretypes.h (function_c2x_misc): Rename to function_c23_misc. * doc/cpp.texi (@code{__has_attribute}): Refer to C23 instead of C2x. * doc/extend.texi: Likewise. * doc/invoke.texi: Likewise. * dwarf2out.cc (highest_c_language, gen_compile_unit_die): Compare against and return "GNU C23" language string instead of "GNU C2X". * ginclude/float.h: Refer to C23 instead of C2X in comments. * ginclude/stdint-gcc.h: Likewise. * glimits.h: Likewise. * tree.h: Likewise. gcc/ada/ * gcc-interface/utils.cc (flag_isoc2x): Rename to flag_isoc23. gcc/c-family/ * c-common.cc (flag_isoc2x): Rename to flag_isoc23. (c_common_reswords): Use D_C23 instead of D_C2X. * c-common.h: Refer throughout to C23 instead of C2X in comments. (D_C2X): Rename to D_C23. (flag_isoc2x): Rename to flag_isoc23. * c-cppbuiltin.cc (builtin_define_float_constants): Use flag_isoc23 instead of flag_isoc2x. Refer to C23 instead of C2x in comments. * c-format.cc: Use STD_C23 instead of STD_C2X and flag_isoc23 instead of flag_isoc2x. Refer to C23 instead of C2X in comments. * c-format.h: Use STD_C23 instead of STD_C2X. * c-lex.cc: Use warn_c11_c23_compat instead of warn_c11_c2x_compat and flag_isoc23 instead of flag_isoc2x. Refer to C23 instead of C2X in diagnostics. * c-opts.cc: Use flag_isoc23 instead of flag_isoc2x. Refer to C23 instead of C2X in comments. (set_std_c2x): Rename to set_std_c23. * c.opt (Wc11-c23-compat): Use CPP(cpp_warn_c11_c23_compat) CppReason(CPP_W_C11_C23_COMPAT) Var(warn_c11_c23_compat) instead of CPP(cpp_warn_c11_c2x_compat) CppReason(CPP_W_C11_C2X_COMPAT) Var(warn_c11_c2x_compat). gcc/c/ * c-decl.cc: Use flag_isoc23 instead of flag_isoc2x and c23_auto_p instead of c2x_auto_p. Refer to C23 instead of C2X in diagnostics and comments. * c-errors.cc: Use flag_isoc23 instead of flag_isoc2x and warn_c11_c23_compat instead of warn_c11_c2x_compat. Refer to C23 instead of C2X in comments. * c-parser.cc: Use flag_isoc23 instead of flag_isoc2x, warn_c11_c23_compat instead of warn_c11_c2x_compat, c23_auto_p instead of c2x_auto_p and D_C23 instead of D_C2X. Refer to C23 instead of C2X in diagnostics and comments. * c-tree.h: Refer to C23 instead of C2X in comments. (struct c_declspecs): Rename c2x_auto_p to c23_auto_p. * c-typeck.cc: Use flag_isoc23 instead of flag_isoc2x and warn_c11_c23_compat instead of warn_c11_c2x_compat. Refer to C23 instead of C2X in diagnostics and comments. gcc/fortran/ * gfortran.h (gfc_real_info): Refer to C23 instead of C2X in comment. gcc/lto/ * lto-lang.cc (flag_isoc2x): Rename to flag_isoc23. gcc/testsuite/ * gcc.dg/binary-constants-2.c: Refer to C23 instead of C2X. * gcc.dg/binary-constants-3.c: Likewise. * gcc.dg/bitint-23.c: Likewise. * gcc.dg/bitint-26.c: Likewise. * gcc.dg/bitint-27.c: Likewise. * gcc.dg/c11-attr-syntax-1.c: Likewise. * gcc.dg/c11-attr-syntax-2.c: Likewise. * gcc.dg/c11-floatn-1.c: Likewise. * gcc.dg/c11-floatn-2.c: Likewise. * gcc.dg/c11-floatn-3.c: Likewise. * gcc.dg/c11-floatn-4.c: Likewise. * gcc.dg/c11-floatn-5.c: Likewise. * gcc.dg/c11-floatn-6.c: Likewise. * gcc.dg/c11-floatn-7.c: Likewise. * gcc.dg/c11-floatn-8.c: Likewise. * gcc.dg/c2x-attr-syntax-4.c: Likewise. * gcc.dg/c2x-attr-syntax-6.c: Likewise. * gcc.dg/c2x-attr-syntax-7.c: Likewise. * gcc.dg/c2x-binary-constants-2.c: Likewise. * gcc.dg/c2x-floatn-5.c: Likewise. * gcc.dg/c2x-floatn-6.c: Likewise. * gcc.dg/c2x-floatn-7.c: Likewise. * gcc.dg/c2x-floatn-8.c: Likewise. * gcc.dg/c2x-nullptr-4.c: Likewise. * gcc.dg/c2x-qual-2.c: Likewise. * gcc.dg/c2x-qual-3.c: Likewise. * gcc.dg/c2x-qual-6.c: Likewise. * gcc.dg/cpp/c11-warning-1.c: Likewise. * gcc.dg/cpp/c11-warning-2.c: Likewise. * gcc.dg/cpp/c11-warning-3.c: Likewise. * gcc.dg/cpp/c2x-warning-2.c: Likewise. * gcc.dg/cpp/gnu11-elifdef-3.c: Likewise. * gcc.dg/cpp/gnu11-elifdef-4.c: Likewise. * gcc.dg/cpp/gnu11-warning-1.c: Likewise. * gcc.dg/cpp/gnu11-warning-2.c: Likewise. * gcc.dg/cpp/gnu11-warning-3.c: Likewise. * gcc.dg/cpp/gnu2x-warning-2.c: Likewise. * gcc.dg/dfp/c11-constants-1.c: Likewise. * gcc.dg/dfp/c11-constants-2.c: Likewise. * gcc.dg/dfp/c2x-constants-2.c: Likewise. * gcc.dg/dfp/constants-pedantic.c: Likewise. * gcc.dg/pr30260.c: Likewise. * gcc.dg/system-binary-constants-1.c: Likewise. libcpp/ * directives.cc: Refer to C23 instead of C2X in diagnostics and comments. (STDC2X): Rename to STDC23. * expr.cc: Use cpp_warn_c11_c23_compat instead of cpp_warn_c11_c2x_compat and CPP_W_C11_C23_COMPAT instead of CPP_W_C11_C2X_COMPAT. Refer to C23 instead of C2X in diagnostics and comments. * include/cpplib.h: Refer to C23 instead of C2X in diagnostics and comments. (CLK_GNUC2X): Rename to CLK_GNUC23. (CLK_STDC2X): Rename to CLK_STDC23. (CPP_W_C11_C2X_COMPAT): Rename to CPP_W_C11_C23_COMPAT. * init.cc: Use GNUC23 instead of GNUC2X, STDC23 instead of STDC2X and cpp_warn_c11_c23_compat instead of cpp_warn_c11_c2x_compat. * lex.cc (maybe_va_opt_error): Refer to C23 instead of C2X in diagnostic. * macro.cc (_cpp_arguments_ok): Refer to C23 instead of C2X in comment.
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/c-decl.cc92
-rw-r--r--gcc/c/c-errors.cc22
-rw-r--r--gcc/c/c-parser.cc50
-rw-r--r--gcc/c/c-tree.h8
-rw-r--r--gcc/c/c-typeck.cc20
5 files changed, 96 insertions, 96 deletions
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
index 0076725..4d38750 100644
--- a/gcc/c/c-decl.cc
+++ b/gcc/c/c-decl.cc
@@ -1505,7 +1505,7 @@ pop_file_scope (void)
}
/* Whether we are curently inside the initializer for an
- underspecified object definition (C2x auto or constexpr). */
+ underspecified object definition (C23 auto or constexpr). */
static bool in_underspecified_init;
/* Start an underspecified object definition for NAME at LOC. This
@@ -2248,7 +2248,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
}
}
/* Warn about enum/integer type mismatches. They are compatible types
- (C2X 6.7.2.2/5), but may pose portability problems. */
+ (C23 6.7.2.2/5), but may pose portability problems. */
else if (enum_and_int_p
&& TREE_CODE (newdecl) != TYPE_DECL
/* Don't warn about about acc_on_device built-in redeclaration,
@@ -2470,16 +2470,16 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
}
/* Multiple initialized definitions are not allowed (6.9p3,5).
- For this purpose, C2x makes it clear that thread-local
+ For this purpose, C23 makes it clear that thread-local
declarations without extern are definitions, not tentative
definitions, whether or not they have initializers. The
- wording before C2x was unclear; literally it would have made
+ wording before C23 was unclear; literally it would have made
uninitialized thread-local declarations into tentative
definitions only if they also used static, but without saying
explicitly whether or not other cases count as
definitions at all. */
if ((DECL_INITIAL (newdecl) && DECL_INITIAL (olddecl))
- || (flag_isoc2x
+ || (flag_isoc23
&& DECL_THREAD_LOCAL_P (newdecl)
&& !DECL_EXTERNAL (newdecl)
&& !DECL_EXTERNAL (olddecl)))
@@ -4634,7 +4634,7 @@ handle_std_noreturn_attribute (tree *node, tree name, tree args,
}
}
-/* Table of supported standard (C2x) attributes. */
+/* Table of supported standard (C23) attributes. */
const struct attribute_spec std_attribute_table[] =
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req,
@@ -5810,12 +5810,12 @@ finish_decl (tree decl, location_t init_loc, tree init,
/* A static variable with an incomplete type
is an error if it is initialized.
Also if it is not file scope.
- Also if it is thread-local (in C2x).
+ Also if it is thread-local (in C23).
Otherwise, let it through, but if it is not `extern'
then it may cause an error message later. */
? (DECL_INITIAL (decl) != NULL_TREE
|| !DECL_FILE_SCOPE_P (decl)
- || (flag_isoc2x && DECL_THREAD_LOCAL_P (decl)))
+ || (flag_isoc23 && DECL_THREAD_LOCAL_P (decl)))
/* An automatic variable with an incomplete type
is an error. */
: !DECL_EXTERNAL (decl)))
@@ -6305,7 +6305,7 @@ mark_forward_parm_decls (void)
literal. NON_CONST is true if the initializers contain something
that cannot occur in a constant expression. If ALIGNAS_ALIGN is nonzero,
it is the (valid) alignment for this compound literal, as specified
- with _Alignas. SCSPECS are the storage class specifiers (C2x) from the
+ with _Alignas. SCSPECS are the storage class specifiers (C23) from the
compound literal. */
tree
@@ -6732,10 +6732,10 @@ grokdeclarator (const struct c_declarator *declarator,
if (type == NULL_TREE)
{
- /* This can occur for auto on a parameter in C2X mode. Set a
+ /* This can occur for auto on a parameter in C23 mode. Set a
dummy type here so subsequent code can give diagnostics for
this case. */
- gcc_assert (declspecs->c2x_auto_p);
+ gcc_assert (declspecs->c23_auto_p);
gcc_assert (decl_context == PARM);
type = declspecs->type = integer_type_node;
}
@@ -6971,12 +6971,12 @@ grokdeclarator (const struct c_declarator *declarator,
else if (decl_context != NORMAL && (storage_class != csc_none
|| threadp
|| constexprp
- || declspecs->c2x_auto_p))
+ || declspecs->c23_auto_p))
{
if (decl_context == PARM
&& storage_class == csc_register
&& !constexprp
- && !declspecs->c2x_auto_p)
+ && !declspecs->c23_auto_p)
;
else
{
@@ -7563,10 +7563,10 @@ grokdeclarator (const struct c_declarator *declarator,
them for noreturn functions. The resolution of C11
DR#423 means qualifiers (other than _Atomic) are
actually removed from the return type when
- determining the function type. For C2X, _Atomic is
+ determining the function type. For C23, _Atomic is
removed as well. */
int quals_used = type_quals;
- if (flag_isoc2x)
+ if (flag_isoc23)
quals_used = 0;
else if (flag_isoc11)
quals_used &= TYPE_QUAL_ATOMIC;
@@ -8335,7 +8335,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
error ("%<[*]%> not allowed in other than function prototype scope");
}
- if (arg_types == NULL_TREE && !funcdef_flag && !flag_isoc2x
+ if (arg_types == NULL_TREE && !funcdef_flag && !flag_isoc23
&& !in_system_header_at (input_location))
warning (OPT_Wstrict_prototypes,
"function declaration isn%'t a prototype");
@@ -8363,8 +8363,8 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag)
tree parm, type, typelt;
unsigned int parmno;
- /* In C2X, convert () to (void). */
- if (flag_isoc2x
+ /* In C23, convert () to (void). */
+ if (flag_isoc23
&& !arg_types
&& !arg_info->parms
&& !arg_info->no_named_args_stdarg_p)
@@ -9669,7 +9669,7 @@ layout_array_type (tree t)
/* Begin compiling the definition of an enumeration type.
NAME is its name (or null if anonymous).
LOC is the enum's location.
- FIXED_UNDERLYING_TYPE is the (C2x) underlying type specified in the
+ FIXED_UNDERLYING_TYPE is the (C23) underlying type specified in the
definition.
Returns the type object, as yet incomplete.
Also records info about it so that build_enumerator
@@ -9886,9 +9886,9 @@ finish_enum (tree enumtype, tree values, tree attributes)
TREE_TYPE (enu) = enumtype;
- /* Before C2X, the ISO C Standard mandates enumerators to
+ /* Before C23, the ISO C Standard mandates enumerators to
have type int, even though the underlying type of an enum
- type is unspecified. However, C2X allows enumerators of
+ type is unspecified. However, C23 allows enumerators of
any integer type, and if an enumeration has any
enumerators wider than int, all enumerators have the
enumerated type after it is parsed. Any enumerators that
@@ -10031,7 +10031,7 @@ build_enumerator (location_t decl_loc, location_t loc,
{
/* Even though the underlying type of an enum is unspecified, the
type of enumeration constants is explicitly defined as int
- (6.4.4.3/2 in the C99 Standard). C2X allows any integer type, and
+ (6.4.4.3/2 in the C99 Standard). C23 allows any integer type, and
GCC allows such types for older standards as an extension. */
bool warned_range = false;
if (!int_fits_type_p (value,
@@ -10039,7 +10039,7 @@ build_enumerator (location_t decl_loc, location_t loc,
? uintmax_type_node
: intmax_type_node)))
/* GCC does not consider its types larger than intmax_t to be
- extended integer types (although C2X would permit such types to
+ extended integer types (although C23 would permit such types to
be considered extended integer types if all the features
required by <stdint.h> and <inttypes.h> macros, such as support
for integer constants and I/O, were present), so diagnose if
@@ -10056,12 +10056,12 @@ build_enumerator (location_t decl_loc, location_t loc,
if (!warned_range && !int_fits_type_p (value, integer_type_node))
pedwarn_c11 (loc, OPT_Wpedantic,
"ISO C restricts enumerator values to range of %<int%> "
- "before C2X");
+ "before C23");
/* The ISO C Standard mandates enumerators to have type int before
- C2X, even though the underlying type of an enum type is
- unspecified. C2X allows enumerators of any integer type. During
- the parsing of the enumeration, C2X specifies that constants
+ C23, even though the underlying type of an enum type is
+ unspecified. C23 allows enumerators of any integer type. During
+ the parsing of the enumeration, C23 specifies that constants
representable in int have type int, constants not representable
in int have the type of the given expression if any, and
constants not representable in int and derived by adding 1 to the
@@ -10510,7 +10510,7 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info)
else
pedwarn_c11 (DECL_SOURCE_LOCATION (decl), OPT_Wpedantic,
"ISO C does not support omitting parameter names in "
- "function definitions before C2X");
+ "function definitions before C23");
}
/* Record the parameter list in the function declaration. */
@@ -10547,7 +10547,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
if (!in_system_header_at (input_location))
{
- if (flag_isoc2x)
+ if (flag_isoc23)
pedwarn (DECL_SOURCE_LOCATION (fndecl),
OPT_Wold_style_definition, "old-style function definition");
else
@@ -10876,7 +10876,7 @@ store_parm_decls (void)
struct c_arg_info *arg_info = current_function_arg_info;
current_function_arg_info = 0;
- /* True if this definition is written with a prototype. In C2X, an
+ /* True if this definition is written with a prototype. In C23, an
empty argument list was converted to (void) in grokparms; in
older C standard versions, it does not give the function a type
with a prototype for future calls. */
@@ -11189,7 +11189,7 @@ check_for_loop_decls (location_t loc, bool turn_off_iso_c99_error)
interpretation, to avoid creating an extension which later causes
problems.
- This constraint was removed in C2X. */
+ This constraint was removed in C23. */
for (b = current_scope->bindings; b; b = b->prev)
{
@@ -11608,9 +11608,9 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs,
/* As a type specifier is present, "auto" must be used as a storage
class specifier, not for type deduction. */
- if (specs->c2x_auto_p)
+ if (specs->c23_auto_p)
{
- specs->c2x_auto_p = false;
+ specs->c23_auto_p = false;
if (specs->storage_class != csc_none)
error ("multiple storage classes in declaration specifiers");
else if (specs->thread_p)
@@ -12264,7 +12264,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs,
if (!in_system_header_at (input_location))
pedwarn_c11 (loc, OPT_Wpedantic,
"ISO C does not support the %<_Float%d%s%> type"
- " before C2X",
+ " before C23",
floatn_nx_types[specs->u.floatn_nx_idx].n,
(floatn_nx_types[specs->u.floatn_nx_idx].extended
? "x"
@@ -12386,7 +12386,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs,
"for this target"));
pedwarn_c11 (loc, OPT_Wpedantic,
"ISO C does not support decimal floating-point "
- "before C2X");
+ "before C23");
return specs;
case RID_FRACT:
case RID_ACCUM:
@@ -12619,14 +12619,14 @@ declspecs_add_scspec (location_t loc,
}
break;
case RID_AUTO:
- if (flag_isoc2x
+ if (flag_isoc23
&& specs->typespec_kind == ctsk_none
&& specs->storage_class != csc_typedef)
{
/* "auto" potentially used for type deduction. */
- if (specs->c2x_auto_p)
+ if (specs->c23_auto_p)
error ("duplicate %qE", scspec);
- specs->c2x_auto_p = true;
+ specs->c23_auto_p = true;
return specs;
}
n = csc_auto;
@@ -12652,10 +12652,10 @@ declspecs_add_scspec (location_t loc,
break;
case RID_TYPEDEF:
n = csc_typedef;
- if (specs->c2x_auto_p)
+ if (specs->c23_auto_p)
{
error ("%<typedef%> used with %<auto%>");
- specs->c2x_auto_p = false;
+ specs->c23_auto_p = false;
}
break;
case RID_CONSTEXPR:
@@ -12765,7 +12765,7 @@ finish_declspecs (struct c_declspecs *specs)
{
gcc_assert (!specs->long_p && !specs->long_long_p && !specs->short_p
&& !specs->signed_p && !specs->unsigned_p
- && !specs->complex_p && !specs->c2x_auto_p);
+ && !specs->complex_p && !specs->c23_auto_p);
/* Set a dummy type. */
if (TREE_CODE (specs->type) == ERROR_MARK)
@@ -12801,16 +12801,16 @@ finish_declspecs (struct c_declspecs *specs)
"ISO C does not support plain %<complex%> meaning "
"%<double complex%>");
}
- else if (specs->c2x_auto_p)
+ else if (specs->c23_auto_p)
{
/* Type to be filled in later, including applying postfix
attributes. This warning only actually appears for
- -Wc11-c2x-compat in C2X mode; in older modes, there may
+ -Wc11-c23-compat in C23 mode; in older modes, there may
be a warning or pedwarn for implicit "int" instead, or
other errors for use of auto at file scope. */
pedwarn_c11 (input_location, OPT_Wpedantic,
"ISO C does not support %<auto%> type deduction "
- "before C2X");
+ "before C23");
return specs;
}
else
@@ -12829,7 +12829,7 @@ finish_declspecs (struct c_declspecs *specs)
specs->explicit_signed_p = specs->signed_p;
/* Now compute the actual type. */
- gcc_assert (!specs->c2x_auto_p);
+ gcc_assert (!specs->c23_auto_p);
switch (specs->typespec_word)
{
case cts_auto_type:
@@ -13058,7 +13058,7 @@ finish_declspecs (struct c_declspecs *specs)
else
{
pedwarn_c11 (specs->locations[cdw_typespec], OPT_Wpedantic,
- "ISO C does not support %<%s_BitInt(%d)%> before C2X",
+ "ISO C does not support %<%s_BitInt(%d)%> before C23",
specs->unsigned_p ? "unsigned "
: specs->signed_p ? "signed " : "",
specs->u.bitint_prec);
diff --git a/gcc/c/c-errors.cc b/gcc/c/c-errors.cc
index 87bb13c..8c2920e 100644
--- a/gcc/c/c-errors.cc
+++ b/gcc/c/c-errors.cc
@@ -25,11 +25,11 @@ along with GCC; see the file COPYING3. If not see
#include "c-tree.h"
#include "opts.h"
-/* Issue an ISO C11 pedantic warning MSGID if -pedantic outside C2X mode,
- otherwise issue warning MSGID if -Wc11-c2X-compat is specified.
+/* Issue an ISO C11 pedantic warning MSGID if -pedantic outside C23 mode,
+ otherwise issue warning MSGID if -Wc11-c23-compat is specified.
This function is supposed to be used for matters that are allowed in
- ISO C2X but not supported in ISO C11, thus we explicitly don't pedwarn
- when C2X is specified. */
+ ISO C23 but not supported in ISO C11, thus we explicitly don't pedwarn
+ when C23 is specified. */
bool
pedwarn_c11 (location_t location, int opt, const char *gmsgid, ...)
@@ -40,21 +40,21 @@ pedwarn_c11 (location_t location, int opt, const char *gmsgid, ...)
rich_location richloc (line_table, location);
va_start (ap, gmsgid);
- /* If desired, issue the C11/C2X compat warning, which is more specific
+ /* If desired, issue the C11/C23 compat warning, which is more specific
than -pedantic. */
- if (warn_c11_c2x_compat > 0)
+ if (warn_c11_c23_compat > 0)
{
diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc,
- (pedantic && !flag_isoc2x)
+ (pedantic && !flag_isoc23)
? DK_PEDWARN : DK_WARNING);
diagnostic.option_index = OPT_Wc11_c23_compat;
warned = diagnostic_report_diagnostic (global_dc, &diagnostic);
}
- /* -Wno-c11-c2x-compat suppresses even the pedwarns. */
- else if (warn_c11_c2x_compat == 0)
+ /* -Wno-c11-c23-compat suppresses even the pedwarns. */
+ else if (warn_c11_c23_compat == 0)
;
- /* For -pedantic outside C2X, issue a pedwarn. */
- else if (pedantic && !flag_isoc2x)
+ /* For -pedantic outside C23, issue a pedwarn. */
+ else if (pedantic && !flag_isoc23)
{
diagnostic_set_info (&diagnostic, gmsgid, &ap, &richloc, DK_PEDWARN);
diagnostic.option_index = opt;
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index ba1e7e9..134d3ed 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -122,14 +122,14 @@ c_parse_init (void)
mask |= D_CXXONLY;
if (!flag_isoc99)
mask |= D_C99;
- if (!flag_isoc2x)
- mask |= D_C2X;
+ if (!flag_isoc23)
+ mask |= D_C23;
if (flag_no_asm)
{
mask |= D_ASM | D_EXT;
if (!flag_isoc99)
mask |= D_EXT89;
- if (!flag_isoc2x)
+ if (!flag_isoc23)
mask |= D_EXT11;
}
if (!c_dialect_objc ())
@@ -1531,9 +1531,9 @@ disable_extension_diagnostics (void)
/* Similarly for warn_c99_c11_compat. */
| ((warn_c99_c11_compat == 1) << 9)
| ((warn_c99_c11_compat == -1) << 10)
- /* Similarly for warn_c11_c2x_compat. */
- | ((warn_c11_c2x_compat == 1) << 11)
- | ((warn_c11_c2x_compat == -1) << 12)
+ /* Similarly for warn_c11_c23_compat. */
+ | ((warn_c11_c23_compat == 1) << 11)
+ | ((warn_c11_c23_compat == -1) << 12)
);
cpp_opts->cpp_pedantic = pedantic = 0;
warn_pointer_arith = 0;
@@ -1544,7 +1544,7 @@ disable_extension_diagnostics (void)
warn_overlength_strings = 0;
warn_c90_c99_compat = 0;
warn_c99_c11_compat = 0;
- warn_c11_c2x_compat = 0;
+ warn_c11_c23_compat = 0;
return ret;
}
@@ -1564,7 +1564,7 @@ restore_extension_diagnostics (int flags)
/* See above for why is this needed. */
warn_c90_c99_compat = (flags >> 7) & 1 ? 1 : ((flags >> 8) & 1 ? -1 : 0);
warn_c99_c11_compat = (flags >> 9) & 1 ? 1 : ((flags >> 10) & 1 ? -1 : 0);
- warn_c11_c2x_compat = (flags >> 11) & 1 ? 1 : ((flags >> 12) & 1 ? -1 : 0);
+ warn_c11_c23_compat = (flags >> 11) & 1 ? 1 : ((flags >> 12) & 1 ? -1 : 0);
}
/* Helper data structure for parsing #pragma acc routine. */
@@ -2319,7 +2319,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
finish_declspecs (specs);
bool gnu_auto_type_p = specs->typespec_word == cts_auto_type;
- bool std_auto_type_p = specs->c2x_auto_p;
+ bool std_auto_type_p = specs->c23_auto_p;
bool any_auto_type_p = gnu_auto_type_p || std_auto_type_p;
gcc_assert (!(gnu_auto_type_p && std_auto_type_p));
const char *auto_type_keyword = gnu_auto_type_p ? "__auto_type" : "auto";
@@ -2660,7 +2660,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
specs->type = init_type;
if (specs->postfix_attrs)
{
- /* Postfix [[]] attributes are valid with C2X
+ /* Postfix [[]] attributes are valid with C23
auto, although not with __auto_type, and
modify the type given by the initializer. */
specs->postfix_attrs =
@@ -3080,7 +3080,7 @@ c_parser_static_assert_declaration (c_parser *parser)
static_assert-declaration-no-semi:
_Static_assert ( constant-expression , string-literal )
- C2X:
+ C23:
static_assert-declaration-no-semi:
_Static_assert ( constant-expression )
*/
@@ -3130,7 +3130,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
else if (flag_isoc11)
/* If pedantic for pre-C11, the use of _Static_assert itself will
have been diagnosed, so do not also diagnose the use of this
- new C2X feature of _Static_assert. */
+ new C23 feature of _Static_assert. */
pedwarn_c11 (assert_loc, OPT_Wpedantic,
"ISO C11 does not support omitting the string in "
"%qE", spelling);
@@ -3230,7 +3230,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
(_Bool and _Complex are new in C99.)
(atomic-type-specifier is new in C11.)
- (_BitInt is new in C2X.)
+ (_BitInt is new in C23.)
C90 6.5.3, C99 6.7.3, C11 6.7.3:
@@ -3636,7 +3636,7 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs,
enum gnu-attributes[opt] identifier
The form with trailing comma is new in C99; enum-type-specifiers
- are new in C2x. The forms with gnu-attributes are GNU extensions.
+ are new in C23. The forms with gnu-attributes are GNU extensions.
In GNU C, we accept any expression without commas in the syntax
(assignment expressions, not just conditional expressions);
assignment expressions will be diagnosed as non-constant.
@@ -3696,7 +3696,7 @@ c_parser_enum_specifier (c_parser *parser)
{
pedwarn_c11 (enum_loc, OPT_Wpedantic,
"ISO C does not support specifying %<enum%> underlying "
- "types before C2X");
+ "types before C23");
if (ident)
{
/* The tag is in scope during the enum-type-specifier (which
@@ -4306,7 +4306,7 @@ c_parser_struct_declaration (c_parser *parser, tree *expr)
return decls;
}
-/* Parse a typeof specifier (a GNU extension adopted in C2X).
+/* Parse a typeof specifier (a GNU extension adopted in C23).
typeof-specifier:
typeof ( expression )
@@ -4330,7 +4330,7 @@ c_parser_typeof_specifier (c_parser *parser)
{
is_unqual = false;
tree spelling = c_parser_peek_token (parser)->value;
- is_std = (flag_isoc2x
+ is_std = (flag_isoc23
&& strcmp (IDENTIFIER_POINTER (spelling), "typeof") == 0);
}
else
@@ -4915,7 +4915,7 @@ c_parser_parms_list_declarator (c_parser *parser, tree attrs, tree expr,
ret->types = NULL_TREE;
pedwarn_c11 (c_parser_peek_token (parser)->location, OPT_Wpedantic,
"ISO C requires a named argument before %<...%> "
- "before C2X");
+ "before C23");
c_parser_consume_token (parser);
if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN))
{
@@ -5659,7 +5659,7 @@ c_parser_omp_sequence_args (c_parser *parser, tree attribute)
while (1);
}
-/* Parse standard (C2X) attributes (including GNU attributes in the
+/* Parse standard (C23) attributes (including GNU attributes in the
gnu:: namespace).
attribute-specifier-sequence:
@@ -5887,7 +5887,7 @@ c_parser_std_attribute_specifier (c_parser *parser, bool for_tm)
{
if (!for_tm)
pedwarn_c11 (loc, OPT_Wpedantic,
- "ISO C does not support %<[[]]%> attributes before C2X");
+ "ISO C does not support %<[[]]%> attributes before C23");
attributes = c_parser_std_attribute_list (parser, for_tm);
}
c_parser_skip_until_found (parser, CPP_CLOSE_SQUARE, "expected %<]%>");
@@ -6155,7 +6155,7 @@ c_parser_braced_init (c_parser *parser, tree type, bool nested_p,
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
{
pedwarn_c11 (brace_loc, OPT_Wpedantic,
- "ISO C forbids empty initializer braces before C2X");
+ "ISO C forbids empty initializer braces before C23");
}
else
{
@@ -6444,7 +6444,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
}
/* Parse a compound statement (possibly a function body) (C90 6.6.2,
- C99 6.8.2, C11 6.8.2, C2X 6.8.2).
+ C99 6.8.2, C11 6.8.2, C23 6.8.2).
compound-statement:
{ block-item-list[opt] }
@@ -9944,7 +9944,7 @@ c_parser_alignof_expression (c_parser *parser)
|| strcmp (IDENTIFIER_POINTER (alignof_spelling),
"alignof") == 0);
/* A diagnostic is not required for the use of this identifier in
- the implementation namespace; only diagnose it for the C11 or C2X
+ the implementation namespace; only diagnose it for the C11 or C23
spelling because of existing code using the other spellings. */
if (is_c11_alignof)
{
@@ -11826,7 +11826,7 @@ c_parser_postfix_expression (c_parser *parser)
expr.value = nullptr_node;
set_c_expr_source_range (&expr, tok_range);
pedwarn_c11 (loc, OPT_Wpedantic,
- "ISO C does not support %qs before C2X", "nullptr");
+ "ISO C does not support %qs before C23", "nullptr");
break;
case RID_TRUE:
c_parser_consume_token (parser);
@@ -11978,7 +11978,7 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser,
"ISO C90 forbids compound literals") && scspecs)
pedwarn_c11 (start_loc, OPT_Wpedantic,
"ISO C forbids storage class specifiers in compound literals "
- "before C2X");
+ "before C23");
non_const = ((init.value && TREE_CODE (init.value) == CONSTRUCTOR)
? CONSTRUCTOR_NON_CONST (init.value)
: init.original_code == C_MAYBE_CONST_EXPR);
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index df6f1ce..c6f38ec 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -109,7 +109,7 @@ along with GCC; see the file COPYING3. If not see
#define C_DECL_COMPOUND_LITERAL_P(DECL) \
DECL_LANG_FLAG_5 (VAR_DECL_CHECK (DECL))
-/* Set on decls used as placeholders for a C2x underspecified object
+/* Set on decls used as placeholders for a C23 underspecified object
definition. */
#define C_DECL_UNDERSPECIFIED(DECL) DECL_LANG_FLAG_7 (DECL)
@@ -451,13 +451,13 @@ struct c_declspecs {
specified other than in a definition of that enum (if so, this is
invalid unless it is an empty declaration "enum identifier
enum-type-specifier;", but such an empty declaration is valid in
- C2x when "enum identifier;" would not be). */
+ C23 when "enum identifier;" would not be). */
BOOL_BITFIELD enum_type_specifier_ref_p : 1;
- /* Whether "auto" was specified in C2X (or later) mode and means the
+ /* Whether "auto" was specified in C23 (or later) mode and means the
type is to be deduced from an initializer, or would mean that if
no type specifier appears later in these declaration
specifiers. */
- BOOL_BITFIELD c2x_auto_p : 1;
+ BOOL_BITFIELD c23_auto_p : 1;
/* Whether "constexpr" was specified. */
BOOL_BITFIELD constexpr_p : 1;
/* The address space that the declaration belongs to. */
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index dd39cec..9c87945 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -1343,7 +1343,7 @@ comp_target_types (location_t location, tree ttl, tree ttr)
if (val == 1 && val_ped != 1)
pedwarn_c11 (location, OPT_Wpedantic, "invalid use of pointers to arrays with different qualifiers "
- "in ISO C before C2X");
+ "in ISO C before C23");
if (val == 2)
pedwarn (location, OPT_Wpedantic, "types are not quite compatible");
@@ -2082,7 +2082,7 @@ really_atomic_lvalue (tree expr)
return true;
}
-/* If EXPR is a named constant (C2x) derived from a constexpr variable
+/* If EXPR is a named constant (C23) derived from a constexpr variable
- that is, a reference to such a variable, or a member extracted by
a sequence of structure and union (but not array) member accesses
(where union member accesses must access the same member as
@@ -5540,21 +5540,21 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp,
if ((TREE_CODE (t2) == ARRAY_TYPE)
&& (TYPE_QUALS (t2_stripped) & ~TYPE_QUALS (t1)))
{
- if (!flag_isoc2x)
+ if (!flag_isoc23)
warning_at (colon_loc, OPT_Wdiscarded_array_qualifiers,
"pointer to array loses qualifier "
"in conditional expression");
- else if (warn_c11_c2x_compat > 0)
+ else if (warn_c11_c23_compat > 0)
warning_at (colon_loc, OPT_Wc11_c23_compat,
"pointer to array loses qualifier "
- "in conditional expression in ISO C before C2X");
+ "in conditional expression in ISO C before C23");
}
if (TREE_CODE (t2) == FUNCTION_TYPE)
pedwarn (colon_loc, OPT_Wpedantic,
"ISO C forbids conditional expr between "
"%<void *%> and function pointer");
/* for array, use qualifiers of element type */
- if (flag_isoc2x)
+ if (flag_isoc23)
t2 = t2_stripped;
result_type = build_pointer_type (qualify_type (t1, t2));
}
@@ -7547,7 +7547,7 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
if (TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttr)
& ~TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttl))
- WARNING_FOR_QUALIFIERS (flag_isoc2x,
+ WARNING_FOR_QUALIFIERS (flag_isoc23,
location, expr_loc,
OPT_Wdiscarded_array_qualifiers,
G_("passing argument %d of %qE discards "
@@ -7590,7 +7590,7 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
/* Don't warn about loss of qualifier for conversions from
qualified void* to pointers to arrays with corresponding
qualifier on the element type (except for pedantic before C23). */
- if (warn_quals || (warn_quals_ped && pedantic && !flag_isoc2x))
+ if (warn_quals || (warn_quals_ped && pedantic && !flag_isoc23))
PEDWARN_FOR_QUALIFIERS (location, expr_loc,
OPT_Wdiscarded_qualifiers,
G_("passing argument %d of %qE discards "
@@ -7604,7 +7604,7 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl));
else if (warn_quals_ped)
pedwarn_c11 (location, OPT_Wc11_c23_compat,
- "array with qualifier on the element is not qualified before C2X");
+ "array with qualifier on the element is not qualified before C23");
/* If this is not a case of ignoring a mismatch in signedness,
no warning. */
@@ -9382,7 +9382,7 @@ pop_init_level (location_t loc, int implicit,
{
/* A nonincremental scalar initializer--just return
the element, after verifying there is just one.
- Empty scalar initializers are supported in C2X. */
+ Empty scalar initializers are supported in C23. */
if (vec_safe_is_empty (constructor_elements))
{
if (constructor_erroneous || constructor_type == error_mark_node)