aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.cc
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/c-decl.cc
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/c-decl.cc')
-rw-r--r--gcc/c/c-decl.cc92
1 files changed, 46 insertions, 46 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);