diff options
79 files changed, 300 insertions, 278 deletions
@@ -14,6 +14,13 @@ Major new features: in order to support unsigned __int128 and/or unsigned _BitInt(N) operands with arbitrary precisions when supported by the target. +* The GNU C Library now supports a feature test macro _ISOC23_SOURCE to + enable features from the ISO C23 standard. Only some features from + this standard are supported by the GNU C Library. The older name + _ISOC2X_SOURCE is still supported. Features from C23 are also enabled + by _GNU_SOURCE, or by compiling with the GCC options -std=c23, + -std=gnu23, -std=c2x or -std=gnu2x. + Deprecated and removed features, and other changes affecting compatibility: [Add deprecations, removals and changes affecting compatibility here] diff --git a/bits/fenv.h b/bits/fenv.h index 9f19295d65..aa0c549d4a 100644 --- a/bits/fenv.h +++ b/bits/fenv.h @@ -54,7 +54,7 @@ fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((const fenv_t *) -1l) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h index d841f5d8cf..4ab1304b0d 100644 --- a/bits/libc-header-start.h +++ b/bits/libc-header-start.h @@ -44,23 +44,23 @@ /* ISO/IEC TS 18661-1:2014 defines the __STDC_WANT_IEC_60559_BFP_EXT__ macro. Most but not all symbols enabled by that macro in TS - 18661-1 are enabled unconditionally in C2X. In C2X, the symbols in + 18661-1 are enabled unconditionally in C23. In C23, the symbols in Annex F still require a new feature test macro - __STDC_WANT_IEC_60559_EXT__ instead (C2X does not define + __STDC_WANT_IEC_60559_EXT__ instead (C23 does not define __STDC_WANT_IEC_60559_BFP_EXT__), while a few features from TS - 18661-1 are not included in C2X (and thus should depend on - __STDC_WANT_IEC_60559_BFP_EXT__ even when C2X features are + 18661-1 are not included in C23 (and thus should depend on + __STDC_WANT_IEC_60559_BFP_EXT__ even when C23 features are enabled). __GLIBC_USE (IEC_60559_BFP_EXT) controls those features from TS - 18661-1 not included in C2X. + 18661-1 not included in C23. - __GLIBC_USE (IEC_60559_BFP_EXT_C2X) controls those features from TS - 18661-1 that are also included in C2X (with no feature test macro - required in C2X). + __GLIBC_USE (IEC_60559_BFP_EXT_C23) controls those features from TS + 18661-1 that are also included in C23 (with no feature test macro + required in C23). __GLIBC_USE (IEC_60559_EXT) controls those features from TS 18661-1 - that are included in C2X but conditional on + that are included in C23 but conditional on __STDC_WANT_IEC_60559_EXT__. (There are currently no features conditional on __STDC_WANT_IEC_60559_EXT__ that are not in TS 18661-1.) */ @@ -70,11 +70,11 @@ #else # define __GLIBC_USE_IEC_60559_BFP_EXT 0 #endif -#undef __GLIBC_USE_IEC_60559_BFP_EXT_C2X -#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC2X) -# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 1 +#undef __GLIBC_USE_IEC_60559_BFP_EXT_C23 +#if __GLIBC_USE (IEC_60559_BFP_EXT) || __GLIBC_USE (ISOC23) +# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 1 #else -# define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 +# define __GLIBC_USE_IEC_60559_BFP_EXT_C23 0 #endif #undef __GLIBC_USE_IEC_60559_EXT #if __GLIBC_USE (IEC_60559_BFP_EXT) || defined __STDC_WANT_IEC_60559_EXT__ @@ -86,18 +86,18 @@ /* ISO/IEC TS 18661-4:2015 defines the __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction functions, the symbols from this TS are enabled unconditionally in - C2X. */ + C23. */ #undef __GLIBC_USE_IEC_60559_FUNCS_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ # define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 #else # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 #endif -#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X -#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC2X) -# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 1 +#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 +#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC23) +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 1 #else -# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C23 0 #endif /* ISO/IEC TS 18661-3:2015 defines the diff --git a/include/features.h b/include/features.h index fc164d332a..d92503dfed 100644 --- a/include/features.h +++ b/include/features.h @@ -24,7 +24,8 @@ __STRICT_ANSI__ ISO Standard C. _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. _ISOC11_SOURCE Extensions to ISO C99 from ISO C11. - _ISOC2X_SOURCE Extensions to ISO C99 from ISO C2X. + _ISOC23_SOURCE Extensions to ISO C99 from ISO C23. + _ISOC2X_SOURCE Old name for _ISOC23_SOURCE. __STDC_WANT_LIB_EXT2__ Extensions to ISO C99 from TR 27431-2:2010. __STDC_WANT_IEC_60559_BFP_EXT__ @@ -34,7 +35,7 @@ __STDC_WANT_IEC_60559_TYPES_EXT__ Extensions to ISO C11 from TS 18661-3:2015. __STDC_WANT_IEC_60559_EXT__ - ISO C2X interfaces defined only in Annex F. + ISO C23 interfaces defined only in Annex F. _POSIX_SOURCE IEEE Std 1003.1. _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; @@ -148,10 +149,10 @@ #undef __USE_GNU #undef __USE_FORTIFY_LEVEL #undef __KERNEL_STRICT_NAMES -#undef __GLIBC_USE_ISOC2X +#undef __GLIBC_USE_ISOC23 #undef __GLIBC_USE_DEPRECATED_GETS #undef __GLIBC_USE_DEPRECATED_SCANF -#undef __GLIBC_USE_C2X_STRTOL +#undef __GLIBC_USE_C23_STRTOL /* Suppress kernel-name space pollution unless user expressedly asks for it. */ @@ -198,6 +199,13 @@ # define _DEFAULT_SOURCE 1 #endif +/* Remap the old name _ISOC2X_SOURCE to _ISOC23_SOURCE. */ +#ifdef _ISOC2X_SOURCE +# undef _ISOC2X_SOURCE +# undef _ISOC23_SOURCE +# define _ISOC23_SOURCE 1 +#endif + /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ #ifdef _GNU_SOURCE # undef _ISOC95_SOURCE @@ -206,8 +214,8 @@ # define _ISOC99_SOURCE 1 # undef _ISOC11_SOURCE # define _ISOC11_SOURCE 1 -# undef _ISOC2X_SOURCE -# define _ISOC2X_SOURCE 1 +# undef _ISOC23_SOURCE +# define _ISOC23_SOURCE 1 # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE @@ -231,37 +239,37 @@ #if (defined _DEFAULT_SOURCE \ || (!defined __STRICT_ANSI__ \ && !defined _ISOC99_SOURCE && !defined _ISOC11_SOURCE \ - && !defined _ISOC2X_SOURCE \ + && !defined _ISOC23_SOURCE \ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \ && !defined _XOPEN_SOURCE)) # undef _DEFAULT_SOURCE # define _DEFAULT_SOURCE 1 #endif -/* This is to enable the ISO C2X extension. */ -#if (defined _ISOC2X_SOURCE \ +/* This is to enable the ISO C23 extension. */ +#if (defined _ISOC23_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L)) -# define __GLIBC_USE_ISOC2X 1 +# define __GLIBC_USE_ISOC23 1 #else -# define __GLIBC_USE_ISOC2X 0 +# define __GLIBC_USE_ISOC23 0 #endif /* This is to enable the ISO C11 extension. */ -#if (defined _ISOC11_SOURCE || defined _ISOC2X_SOURCE \ +#if (defined _ISOC11_SOURCE || defined _ISOC23_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) # define __USE_ISOC11 1 #endif /* This is to enable the ISO C99 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ - || defined _ISOC2X_SOURCE \ + || defined _ISOC23_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) # define __USE_ISOC99 1 #endif /* This is to enable the ISO C90 Amendment 1:1995 extension. */ #if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \ - || defined _ISOC2X_SOURCE \ + || defined _ISOC23_SOURCE \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L)) # define __USE_ISOC95 1 #endif @@ -465,15 +473,15 @@ # define __GLIBC_USE_DEPRECATED_SCANF 0 #endif -/* ISO C2X added support for a 0b or 0B prefix on binary constants as +/* ISO C23 added support for a 0b or 0B prefix on binary constants as inputs to strtol-family functions (base 0 or 2). This macro is used to condition redirection in headers to allow that redirection to be disabled when building those functions, despite _GNU_SOURCE being defined. */ -#if __GLIBC_USE (ISOC2X) -# define __GLIBC_USE_C2X_STRTOL 1 +#if __GLIBC_USE (ISOC23) +# define __GLIBC_USE_C23_STRTOL 1 #else -# define __GLIBC_USE_C2X_STRTOL 0 +# define __GLIBC_USE_C23_STRTOL 0 #endif /* Get definitions of __STDC_* predefined macros, if the compiler has diff --git a/include/limits.h b/include/limits.h index 87796f213e..e5576fcfcb 100644 --- a/include/limits.h +++ b/include/limits.h @@ -142,7 +142,7 @@ /* The integer width macros are not defined by GCC's <limits.h> before GCC 7, or if _GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # ifndef CHAR_WIDTH # define CHAR_WIDTH 8 # endif @@ -179,9 +179,9 @@ #endif /* Use IEC_60559_BFP_EXT. */ /* The macros for _Bool are not defined by GCC's <limits.h> before GCC - 11, or if _GNU_SOURCE is defined rather than enabling C2x support + 11, or if _GNU_SOURCE is defined rather than enabling C23 support with -std. */ -#if __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (ISOC23) # ifndef BOOL_MAX # define BOOL_MAX 1 # endif diff --git a/include/stdio.h b/include/stdio.h index 7e70f95c6d..24f1652f19 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -115,7 +115,7 @@ libc_hidden_proto (__isoc23_sscanf) libc_hidden_proto (__isoc23_vsscanf) libc_hidden_proto (__isoc23_vfscanf) -/* Internal uses of sscanf should call the C2X-compliant version. +/* Internal uses of sscanf should call the C23-compliant version. Unfortunately, symbol redirection is not transitive, so the __REDIRECT in the public header does not link up with the above libc_hidden_proto. Bridge the gap with a macro. */ diff --git a/include/stdlib.h b/include/stdlib.h index 580da9be15..0cab3f5b56 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -53,8 +53,8 @@ libc_hidden_proto (__isoc23_strtoul_l) libc_hidden_proto (__isoc23_strtoll_l) libc_hidden_proto (__isoc23_strtoull_l) -#if __GLIBC_USE (C2X_STRTOL) -/* Redirect internal uses of these functions to the C2X versions; the +#if __GLIBC_USE (C23_STRTOL) +/* Redirect internal uses of these functions to the C23 versions; the redirection in the installed header does not work with libc_hidden_proto. */ # undef strtol diff --git a/include/wchar.h b/include/wchar.h index 484e6b3fef..bf32625736 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -53,8 +53,8 @@ libc_hidden_proto (__isoc23_wcstoul_l) libc_hidden_proto (__isoc23_wcstoll_l) libc_hidden_proto (__isoc23_wcstoull_l) -#if __GLIBC_USE (C2X_STRTOL) -/* Redirect internal uses of these functions to the C2X versions; the +#if __GLIBC_USE (C23_STRTOL) +/* Redirect internal uses of these functions to the C23 versions; the redirection in the installed header does not work with libc_hidden_proto. */ # undef wcstol diff --git a/libio/bits/stdio-ldbl.h b/libio/bits/stdio-ldbl.h index e81ad173c1..a0d1de0693 100644 --- a/libio/bits/stdio-ldbl.h +++ b/libio/bits/stdio-ldbl.h @@ -28,7 +28,7 @@ __LDBL_REDIR_DECL (vprintf) __LDBL_REDIR_DECL (vsprintf) #if !__GLIBC_USE (DEPRECATED_SCANF) # if defined __LDBL_COMPAT -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc23_fscanf) __LDBL_REDIR1_DECL (scanf, __nldbl___isoc23_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc23_sscanf) @@ -38,7 +38,7 @@ __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf) __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf) # endif # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (fscanf, __isoc23_fscanfieee128) __LDBL_REDIR1_DECL (scanf, __isoc23_scanfieee128) __LDBL_REDIR1_DECL (sscanf, __isoc23_sscanfieee128) @@ -64,7 +64,7 @@ __LDBL_REDIR_DECL (vsnprintf) #ifdef __USE_ISOC99 # if !__GLIBC_USE (DEPRECATED_SCANF) # if defined __LDBL_COMPAT -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc23_vfscanf) __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc23_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc23_vsscanf) @@ -74,7 +74,7 @@ __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf) __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf) # endif # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (vfscanf, __isoc23_vfscanfieee128) __LDBL_REDIR1_DECL (vscanf, __isoc23_vscanfieee128) __LDBL_REDIR1_DECL (vsscanf, __isoc23_vsscanfieee128) diff --git a/libio/stdio.h b/libio/stdio.h index 6762cffb0f..cbecabe1d9 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -139,7 +139,7 @@ typedef __fpos64_t fpos64_t; #define FOPEN_MAX 16 -#if __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (ISOC23) /* Maximum length of printf output for a NaN. */ # define _PRINTF_NAN_LEN_MAX 4 #endif @@ -437,7 +437,7 @@ extern int sscanf (const char *__restrict __s, #include <bits/floatn.h> #if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern int __REDIRECT (fscanf, (FILE *__restrict __stream, const char *__restrict __format, ...), @@ -505,7 +505,7 @@ extern int vsscanf (const char *__restrict __s, /* Same redirection as above for the v*scanf family. */ # if !__GLIBC_USE (DEPRECATED_SCANF) -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # if defined __REDIRECT && !defined __LDBL_COMPAT \ && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 extern int __REDIRECT (vfscanf, diff --git a/manual/arith.texi b/manual/arith.texi index 2b99cd8389..0742c08ac4 100644 --- a/manual/arith.texi +++ b/manual/arith.texi @@ -1904,7 +1904,7 @@ operation. These functions, defined by TS 18661-1:2014 and TS floating-point number); if @var{x} is not a NaN, they return @minus{}1. They raise no floating-point exceptions even for signaling NaNs. (The return value of @minus{}1 for an argument that is not a -NaN is specified in C2x; the value was unspecified in TS 18661.) +NaN is specified in C23; the value was unspecified in TS 18661.) @end deftypefun @deftypefun int setpayload (double *@var{x}, double @var{payload}) @@ -2128,7 +2128,7 @@ are NaN, or either is a signaling NaN, NaN is returned. @deftypefunx {long double} fminimuml (long double @var{x}, long double @var{y}) @deftypefunx _FloatN fminimumfN (_Float@var{N} @var{x}, _Float@var{N} @var{y}) @deftypefunx _FloatNx fminimumfNx (_Float@var{N}x @var{x}, _Float@var{N}x @var{y}) -@standards{C2X, math.h} +@standards{C23, math.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{fminimum} function returns the lesser of the two values @var{x} and @var{y}. Unlike @code{fmin}, if either argument is a NaN, NaN is returned. @@ -2140,7 +2140,7 @@ Positive zero is treated as greater than negative zero. @deftypefunx {long double} fmaximuml (long double @var{x}, long double @var{y}) @deftypefunx _FloatN fmaximumfN (_Float@var{N} @var{x}, _Float@var{N} @var{y}) @deftypefunx _FloatNx fmaximumfNx (_Float@var{N}x @var{x}, _Float@var{N}x @var{y}) -@standards{C2X, math.h} +@standards{C23, math.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{fmaximum} function returns the greater of the two values @var{x} and @var{y}. Unlike @code{fmax}, if either argument is a NaN, NaN is returned. @@ -2152,7 +2152,7 @@ Positive zero is treated as greater than negative zero. @deftypefunx {long double} fminimum_numl (long double @var{x}, long double @var{y}) @deftypefunx _FloatN fminimum_numfN (_Float@var{N} @var{x}, _Float@var{N} @var{y}) @deftypefunx _FloatNx fminimum_numfNx (_Float@var{N}x @var{x}, _Float@var{N}x @var{y}) -@standards{C2X, math.h} +@standards{C23, math.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{fminimum_num} function returns the lesser of the two values @var{x} and @var{y}. If one argument is a number and the other is a @@ -2165,7 +2165,7 @@ treated as greater than negative zero. @deftypefunx {long double} fmaximum_numl (long double @var{x}, long double @var{y}) @deftypefunx _FloatN fmaximum_numfN (_Float@var{N} @var{x}, _Float@var{N} @var{y}) @deftypefunx _FloatNx fmaximum_numfNx (_Float@var{N}x @var{x}, _Float@var{N}x @var{y}) -@standards{C2X, math.h} +@standards{C23, math.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{fmaximum_num} function returns the greater of the two values @var{x} and @var{y}. If one argument is a number and the other is a @@ -2208,7 +2208,7 @@ as the @code{fmax} functions. @deftypefunx {long double} fminimum_magl (long double @var{x}, long double @var{y}) @deftypefunx _FloatN fminimum_magfN (_Float@var{N} @var{x}, _Float@var{N} @var{y}) @deftypefunx _FloatNx fminimum_magfNx (_Float@var{N}x @var{x}, _Float@var{N}x @var{y}) -@standards{C2X, math.h} +@standards{C23, math.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} These functions return whichever of the two values @var{x} and @var{y} has the smaller absolute value. If both have the same absolute value, @@ -2221,7 +2221,7 @@ functions. @deftypefunx {long double} fmaximum_magl (long double @var{x}, long double @var{y}) @deftypefunx _FloatN fmaximum_magfN (_Float@var{N} @var{x}, _Float@var{N} @var{y}) @deftypefunx _FloatNx fmaximum_magfNx (_Float@var{N}x @var{x}, _Float@var{N}x @var{y}) -@standards{C2X, math.h} +@standards{C23, math.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} These functions return whichever of the two values @var{x} and @var{y} has the greater absolute value. If both have the same absolute value, @@ -2234,7 +2234,7 @@ functions. @deftypefunx {long double} fminimum_mag_numl (long double @var{x}, long double @var{y}) @deftypefunx _FloatN fminimum_mag_numfN (_Float@var{N} @var{x}, _Float@var{N} @var{y}) @deftypefunx _FloatNx fminimum_mag_numfNx (_Float@var{N}x @var{x}, _Float@var{N}x @var{y}) -@standards{C2X, math.h} +@standards{C23, math.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} These functions return whichever of the two values @var{x} and @var{y} has the smaller absolute value. If both have the same absolute value, @@ -2247,7 +2247,7 @@ functions. @deftypefunx {long double} fmaximum_mag_numl (long double @var{x}, long double @var{y}) @deftypefunx _FloatN fmaximum_mag_numfN (_Float@var{N} @var{x}, _Float@var{N} @var{y}) @deftypefunx _FloatNx fmaximum_mag_numfNx (_Float@var{N}x @var{x}, _Float@var{N}x @var{y}) -@standards{C2X, math.h} +@standards{C23, math.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} These functions return whichever of the two values @var{x} and @var{y} has the greater absolute value. If both have the same absolute value, @@ -2663,12 +2663,12 @@ A nonempty sequence of digits in the radix specified by @var{base}. If @var{base} is zero, decimal radix is assumed unless the series of digits begins with @samp{0} (specifying octal radix), or @samp{0x} or @samp{0X} (specifying hexadecimal radix), or @samp{0b} or @samp{0B} -(specifying binary radix; only supported when C2X features are +(specifying binary radix; only supported when C23 features are enabled); in other words, the same syntax used for integer constants in C. Otherwise @var{base} must have a value between @code{2} and @code{36}. If @var{base} is @code{16}, the digits may optionally be preceded by -@samp{0x} or @samp{0X}. If @var{base} is @code{2}, and C2X features +@samp{0x} or @samp{0X}. If @var{base} is @code{2}, and C23 features are enabled, the digits may optionally be preceded by @samp{0b} or @samp{0B}. If base has no legal value the value returned is @code{0l} and the global variable @code{errno} is set to @code{EINVAL}. diff --git a/manual/creature.texi b/manual/creature.texi index fa5dd9d6ad..3fc53619ea 100644 --- a/manual/creature.texi +++ b/manual/creature.texi @@ -220,11 +220,11 @@ when the compiler uses an earlier language version. If this macro is defined, ISO C11 extensions to ISO C99 are included. @end defvr -@defvr Macro _ISOC2X_SOURCE -@standards{C2X, (none)} -If this macro is defined, ISO C2X extensions to ISO C11 are included. +@defvr Macro _ISOC23_SOURCE +@standards{C23, (none)} +If this macro is defined, ISO C23 extensions to ISO C11 are included. Only some features from this draft standard are supported by -@theglibc{}. +@theglibc{}. The older name @code{_ISOC2X_SOURCE} is also supported. @end defvr @defvr Macro __STDC_WANT_LIB_EXT2__ @@ -260,7 +260,7 @@ enabled. Only some of the features from this TS are supported by @defvr Macro __STDC_WANT_IEC_60559_EXT__ @standards{ISO, (none)} -If you define this macro, ISO C2X features defined in Annex F of that +If you define this macro, ISO C23 features defined in Annex F of that standard are enabled. This affects declarations of the @code{totalorder} functions and functions related to NaN payloads. @end defvr diff --git a/manual/stdbit.texi b/manual/stdbit.texi index 8688930f12..f74d33903a 100644 --- a/manual/stdbit.texi +++ b/manual/stdbit.texi @@ -4,7 +4,7 @@ This chapter contains information about functions and macros for determining the endianness of integer types and manipulating the bits -of unsigned integers. These functions and macros are from ISO C2X and +of unsigned integers. These functions and macros are from ISO C23 and are declared in the header file @file{stdbit.h}. The following macros describe the endianness of integer types. They @@ -45,7 +45,7 @@ In GCC 14.1 that includes support for @code{unsigned __int128} and @deftypefunx {unsigned int} stdc_leading_zeros_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_leading_zeros_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_leading_zeros_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_leading_zeros} functions count the number of leading (most significant) zero bits in @var{x}, starting from the most @@ -58,7 +58,7 @@ the width of @var{x} in bits. @deftypefunx {unsigned int} stdc_leading_ones_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_leading_ones_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_leading_ones_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_leading_ones} functions count the number of leading (most significant) one bits in @var{x}, starting from the most @@ -70,7 +70,7 @@ significant bit of the argument type. @deftypefunx {unsigned int} stdc_trailing_zeros_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_trailing_zeros_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_trailing_zeros_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_trailing_zeros} functions count the number of trailing (least significant) zero bits in @var{x}, starting from the least @@ -83,7 +83,7 @@ the width of @var{x} in bits. @deftypefunx {unsigned int} stdc_trailing_ones_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_trailing_ones_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_trailing_ones_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_trailing_ones} functions count the number of trailing (least significant) one bits in @var{x}, starting from the least @@ -95,7 +95,7 @@ significant bit of the argument type. @deftypefunx {unsigned int} stdc_first_leading_zero_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_first_leading_zero_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_first_leading_zero_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_first_leading_zero} functions return the position of the most significant zero bit in @var{x}, counting from the most @@ -108,7 +108,7 @@ significant bit of @var{x} as 1, or zero if there is no zero bit in @deftypefunx {unsigned int} stdc_first_leading_one_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_first_leading_one_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_first_leading_one_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_first_leading_one} functions return the position of the most significant one bit in @var{x}, counting from the most @@ -121,7 +121,7 @@ significant bit of @var{x} as 1, or zero if there is no one bit in @deftypefunx {unsigned int} stdc_first_trailing_zero_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_first_trailing_zero_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_first_trailing_zero_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_first_trailing_zero} functions return the position of the least significant zero bit in @var{x}, counting from the least @@ -134,7 +134,7 @@ significant bit of @var{x} as 1, or zero if there is no zero bit in @deftypefunx {unsigned int} stdc_first_trailing_one_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_first_trailing_one_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_first_trailing_one_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_first_trailing_one} functions return the position of the least significant one bit in @var{x}, counting from the least @@ -147,7 +147,7 @@ significant bit of @var{x} as 1, or zero if there is no one bit in @deftypefunx {unsigned int} stdc_count_zeros_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_count_zeros_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_count_zeros_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_count_zeros} functions count the number of zero bits in @var{x}. @@ -158,7 +158,7 @@ The @code{stdc_count_zeros} functions count the number of zero bits in @deftypefunx {unsigned int} stdc_count_ones_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_count_ones_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_count_ones_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_count_ones} functions count the number of one bits in @var{x}. @@ -169,7 +169,7 @@ The @code{stdc_count_ones} functions count the number of one bits in @deftypefunx {_Bool} stdc_has_single_bit_ui (unsigned int @var{x}) @deftypefunx {_Bool} stdc_has_single_bit_ul (unsigned long int @var{x}) @deftypefunx {_Bool} stdc_has_single_bit_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_has_single_bit} functions return whether @var{x} has exactly one bit set to one. @@ -180,7 +180,7 @@ exactly one bit set to one. @deftypefunx {unsigned int} stdc_bit_width_ui (unsigned int @var{x}) @deftypefunx {unsigned int} stdc_bit_width_ul (unsigned long int @var{x}) @deftypefunx {unsigned int} stdc_bit_width_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_bit_width} functions return the minimum number of bits needed to store @var{x}, not counting leading zero bits. If @var{x} @@ -192,7 +192,7 @@ is zero, they return zero. @deftypefunx {unsigned int} stdc_bit_floor_ui (unsigned int @var{x}) @deftypefunx {unsigned long int} stdc_bit_floor_ul (unsigned long int @var{x}) @deftypefunx {unsigned long long int} stdc_bit_floor_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_bit_floor} functions return the largest integer power of two that is less than or equal to @var{x}. If @var{x} is zero, @@ -204,7 +204,7 @@ they return zero. @deftypefunx {unsigned int} stdc_bit_ceil_ui (unsigned int @var{x}) @deftypefunx {unsigned long int} stdc_bit_ceil_ul (unsigned long int @var{x}) @deftypefunx {unsigned long long int} stdc_bit_ceil_ull (unsigned long long int @var{x}) -@standards{C2X, stdbit.h} +@standards{C23, stdbit.h} @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} The @code{stdc_bit_ceil} functions return the smallest integer power of two that is greater than or equal to @var{x}. If this cannot be diff --git a/manual/stdio.texi b/manual/stdio.texi index 002fce7a10..f5e289d58a 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -1828,8 +1828,8 @@ output, but are different when used with @code{scanf} for input @item @samp{%b}, @samp{%B} Print an integer as an unsigned binary number. @samp{%b} uses lower-case @samp{b} with the @samp{#} flag and @samp{%B} uses -upper-case. @samp{%b} is an ISO C2X feature; @samp{%B} is an -optional ISO C2X feature. @xref{Integer Conversions}, for +upper-case. @samp{%b} is an ISO C23 feature; @samp{%B} is an +optional ISO C23 feature. @xref{Integer Conversions}, for details. @item @samp{%o} @@ -2036,7 +2036,7 @@ taking signed integers, or @code{uint@var{n}_t} or taking unsigned integers. If the type is narrower than @code{int}, the promoted argument is converted back to the specified type. -This modifier was introduced in @w{ISO C2X}. +This modifier was introduced in @w{ISO C23}. @item wf@var{n} Specifies that the argument is a @code{int_fast@var{n}_t} or @@ -2044,7 +2044,7 @@ Specifies that the argument is a @code{int_fast@var{n}_t} or than @code{int}, the promoted argument is converted back to the specified type. -This modifier was introduced in @w{ISO C2X}. +This modifier was introduced in @w{ISO C23}. @item z @itemx Z @@ -2144,7 +2144,7 @@ specifier is @samp{%a}, @samp{%e}, @samp{%f}, or @samp{%g} and it is @w{[@code{-}]@code{INF}} or @code{NAN} respectively if the conversion is @samp{%A}, @samp{%E}, @samp{%F} or @samp{%G}. On some implementations, a NaN may result in longer output with information about the payload of the -NaN; ISO C2X defines a macro @code{_PRINTF_NAN_LEN_MAX} giving the +NaN; ISO C23 defines a macro @code{_PRINTF_NAN_LEN_MAX} giving the maximum length of such output. The following flags can be used to modify the behavior: @@ -3547,7 +3547,7 @@ Input Conversions}. @item @samp{%b} Matches an unsigned integer written in binary radix. This is an ISO -C2X feature. @xref{Numeric Input Conversions}. +C23 feature. @xref{Numeric Input Conversions}. @item @samp{%o} Matches an unsigned integer written in octal radix. @@ -3720,13 +3720,13 @@ Specifies that the argument is an @code{int@var{n}_t *} or @code{uint@var{n}_t *} or @code{uint_least@var{n}_t *} (which are the same type). -This modifier was introduced in @w{ISO C2X}. +This modifier was introduced in @w{ISO C23}. @item wf@var{n} Specifies that the argument is an @code{int_fast@var{n}_t *} or @code{uint_fast@var{n}_t *}. -This modifier was introduced in @w{ISO C2X}. +This modifier was introduced in @w{ISO C23}. @item z Specifies that the argument is a @code{size_t *}. diff --git a/manual/time.texi b/manual/time.texi index 7d9efc7c6f..dd77d3db04 100644 --- a/manual/time.texi +++ b/manual/time.texi @@ -1493,7 +1493,7 @@ With @code{%B}, @code{%b}, and @code{%h}: use the grammatical form for month names that is appropriate when the month is named by itself, rather than the form that is appropriate when the month is used as part of a complete date. The @code{%OB} and @code{%Ob} formats are a -C2X feature, specified in C2X to use the locale's `alternative' month +C23 feature, specified in C23 to use the locale's `alternative' month name; @theglibc{} extends this specification to say that the form used in a complete date is the default and the form naming the month by itself is the alternative. @@ -1516,14 +1516,14 @@ The full weekday name according to the current locale. @item %b The abbreviated month name according to the current locale, in the grammatical form used when the month is part of a complete date. -As a C2X feature (with a more detailed specification in @theglibc{}), +As a C23 feature (with a more detailed specification in @theglibc{}), the @code{O} modifier can be used (@code{%Ob}) to get the grammatical form used when the month is named by itself. @item %B The full month name according to the current locale, in the grammatical form used when the month is part of a complete date. -As a C2X feature (with a more detailed specification in @theglibc{}), +As a C23 feature (with a more detailed specification in @theglibc{}), the @code{O} modifier can be used (@code{%OB}) to get the grammatical form used when the month is named by itself. diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index 4916ffb8b6..f46d3000b2 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -109,7 +109,7 @@ __MATHCALL_VEC (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); -#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C2X) +#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) /* Compute exponent to base ten. */ __MATHCALL_VEC (exp10,, (_Mdouble_ __x)); #endif @@ -264,7 +264,7 @@ __MATHCALL (nextafter,, (_Mdouble_ __x, _Mdouble_ __y)); __MATHCALL (nexttoward,, (_Mdouble_ __x, long double __y)); # endif -# if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN +# if __GLIBC_USE (IEC_60559_BFP_EXT_C23) || __MATH_DECLARING_FLOATN /* Return X - epsilon. */ __MATHCALL (nextdown,, (_Mdouble_ __x)); /* Return X + epsilon. */ @@ -283,7 +283,7 @@ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n)); __MATHDECL (int,ilogb,, (_Mdouble_ __x)); #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) || __MATH_DECLARING_FLOATN /* Like ilogb, but returning long int. */ __MATHDECL (long int, llogb,, (_Mdouble_ __x)); #endif @@ -328,7 +328,7 @@ __MATHDECL (long long int,llround,, (_Mdouble_ __x)); /* Return positive difference between X and Y. */ __MATHCALL (fdim,, (_Mdouble_ __x, _Mdouble_ __y)); -# if !__MATH_DECLARING_FLOATN || defined __USE_GNU || !__GLIBC_USE (ISOC2X) +# if !__MATH_DECLARING_FLOATN || defined __USE_GNU || !__GLIBC_USE (ISOC23) /* Return maximum numeric value from X and Y. */ __MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); @@ -340,7 +340,7 @@ __MATHCALLX (fmin,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z)); #endif /* Use ISO C99. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) || __MATH_DECLARING_FLOATN +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) || __MATH_DECLARING_FLOATN /* Round X to nearest integer value, rounding halfway cases to even. */ __MATHCALLX (roundeven,, (_Mdouble_ __x), (__const__)); @@ -372,7 +372,7 @@ __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x)); #if (__GLIBC_USE (IEC_60559_BFP_EXT) \ || (__MATH_DECLARING_FLOATN \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X)))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23)))) /* Return value with maximum magnitude. */ __MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); @@ -380,7 +380,7 @@ __MATHCALLX (fmaxmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); __MATHCALLX (fminmag,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); #endif -#if __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (ISOC23) /* Return maximum value from X and Y. */ __MATHCALLX (fmaximum,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); diff --git a/math/fenv.h b/math/fenv.h index 33548fa943..72af93bd19 100644 --- a/math/fenv.h +++ b/math/fenv.h @@ -77,7 +77,7 @@ extern int fegetexceptflag (fexcept_t *__flagp, int __excepts) __THROW; /* Raise the supported exceptions represented by EXCEPTS. */ extern int feraiseexcept (int __excepts) __THROW; -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Set the supported exception flags represented by EXCEPTS, without causing enabled traps to be taken. */ extern int fesetexcept (int __excepts) __THROW; @@ -91,7 +91,7 @@ extern int fesetexceptflag (const fexcept_t *__flagp, int __excepts) __THROW; currently set. */ extern int fetestexcept (int __excepts) __THROW; -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Determine which of subset of the exceptions specified by EXCEPTS are set in *FLAGP. */ extern int fetestexceptflag (const fexcept_t *__flagp, int __excepts) __THROW; @@ -130,7 +130,7 @@ extern int feupdateenv (const fenv_t *__envp) __THROW; /* Control modes. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Store the current floating-point control modes in the object pointed to by MODEP. */ extern int fegetmode (femode_t *__modep) __THROW; @@ -143,7 +143,7 @@ extern int fesetmode (const femode_t *__modep) __THROW; /* NaN support. */ -#if (__GLIBC_USE (IEC_60559_BFP_EXT_C2X) \ +#if (__GLIBC_USE (IEC_60559_BFP_EXT_C23) \ && defined FE_INVALID \ && defined __SUPPORT_SNAN__) # define FE_SNANS_ALWAYS_SIGNAL 1 diff --git a/math/gen-tgmath-tests.py b/math/gen-tgmath-tests.py index f6f5c5a71d..216e4640ef 100755 --- a/math/gen-tgmath-tests.py +++ b/math/gen-tgmath-tests.py @@ -25,7 +25,7 @@ # complex integer types, which are a GNU extension, but are currently # disabled here because they do not work properly with tgmath.h). -# C2x makes the <tgmath.h> rules for selecting a function to call +# C23 makes the <tgmath.h> rules for selecting a function to call # correspond to the usual arithmetic conversions (applied successively # to the arguments for generic parameters in order), which choose the # type whose set of values contains that of the other type (undefined @@ -743,7 +743,7 @@ class Tests(object): self.add_tests(prefix + fn, ret, ['r'] * args) # TS 18661-4 functions. self.add_tests('exp10', 'r', ['r']) - # C2X functions. + # C23 functions. self.add_tests('fmaximum', 'r', ['r', 'r']) self.add_tests('fmaximum_mag', 'r', ['r', 'r']) self.add_tests('fmaximum_num', 'r', ['r', 'r']) diff --git a/math/libm-test-pow.inc b/math/libm-test-pow.inc index 314cd41091..914cde0a8a 100644 --- a/math/libm-test-pow.inc +++ b/math/libm-test-pow.inc @@ -249,7 +249,7 @@ static const struct test_ff_f_data pow_test_data[] = TEST_ff_f (pow, 0, plus_infty, 0, ERRNO_UNCHANGED), TEST_ff_f (pow, minus_zero, plus_infty, 0, ERRNO_UNCHANGED), /* C99 erroneously specified a divide-by-zero exception here, - which is not permitted in C2x (C11 specified it as optional). + which is not permitted in C23 (C11 specified it as optional). See <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1515.pdf> and <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2271.pdf>. */ diff --git a/math/math.h b/math/math.h index a1631a8c24..1e300c4223 100644 --- a/math/math.h +++ b/math/math.h @@ -114,37 +114,37 @@ __BEGIN_DECLS #endif #if (__HAVE_FLOAT16 \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF16 (__builtin_nansf16 ("")) #endif #if (__HAVE_FLOAT32 \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF32 (__builtin_nansf32 ("")) #endif #if (__HAVE_FLOAT64 \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF64 (__builtin_nansf64 ("")) #endif #if (__HAVE_FLOAT128 \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF128 (__builtin_nansf128 ("")) #endif #if (__HAVE_FLOAT32X \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF32X (__builtin_nansf32x ("")) #endif #if (__HAVE_FLOAT64X \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF64X (__builtin_nansf64x ("")) #endif #if (__HAVE_FLOAT128X \ && __GLIBC_USE (IEC_60559_TYPES_EXT) \ - && (defined __USE_GNU || !__GLIBC_USE (ISOC2X))) + && (defined __USE_GNU || !__GLIBC_USE (ISOC23))) # define SNANF128X (__builtin_nansf128x ("")) #endif @@ -214,7 +214,7 @@ typedef _Float128x double_t; # define FP_ILOGBNAN 2147483647 # endif #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # if __WORDSIZE == 32 # define __FP_LONG_MAX 0x7fffffffL # else @@ -246,7 +246,7 @@ typedef _Float128x double_t; #include <bits/fp-fast.h> -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Rounding direction macros for fromfp functions. */ enum { @@ -558,7 +558,7 @@ extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y), #define __MATHCALL_NARROW(func, redir, nargs) \ __MATHCALL_NARROW_NORMAL (func, nargs) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # define _Mret_ float # define _Marg_ double @@ -1051,7 +1051,7 @@ enum #endif /* Use ISO C99. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # include <bits/iscanonical.h> /* Return nonzero value if X is a signaling NaN. */ @@ -1332,7 +1332,7 @@ iszero (__T __val) # endif #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* An expression whose type has the widest of the evaluation formats of X and Y (which are of floating-point types). */ # if __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ > 64 diff --git a/math/tgmath.h b/math/tgmath.h index d3654e8cb6..dbfa92d51d 100644 --- a/math/tgmath.h +++ b/math/tgmath.h @@ -42,12 +42,12 @@ versions before GCC 13 have __builtin_tgmath semantics that, when integer arguments are passed to narrowing macros returning _Float32x, or non-narrowing macros with at least two generic - arguments, do not always correspond to the C2X semantics, so more + arguments, do not always correspond to the C23 semantics, so more complicated macro definitions are also used in some cases for versions from GCC 8 to GCC 12. */ #define __HAVE_BUILTIN_TGMATH __GNUC_PREREQ (8, 0) -#define __HAVE_BUILTIN_TGMATH_C2X __GNUC_PREREQ (13, 0) +#define __HAVE_BUILTIN_TGMATH_C23 __GNUC_PREREQ (13, 0) #if __GNUC_PREREQ (2, 7) @@ -171,7 +171,7 @@ __builtin_tgmath (__TGMATH_NARROW_FUNCS_F64 (F) (X), (Y)) # define __TGMATH_3_NARROW_F64(F, X, Y, Z) \ __builtin_tgmath (__TGMATH_NARROW_FUNCS_F64 (F) (X), (Y), (Z)) -# if __HAVE_FLOAT128 && __HAVE_BUILTIN_TGMATH_C2X +# if __HAVE_FLOAT128 && __HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_1_NARROW_F32X(F, X) \ __builtin_tgmath (__TGMATH_NARROW_FUNCS_F32X (F) (X)) # define __TGMATH_2_NARROW_F32X(F, X, Y) \ @@ -182,7 +182,7 @@ # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # ifdef __NO_LONG_DOUBLE_MATH # define __tgml(fct) fct # else @@ -261,20 +261,20 @@ __complex_integer_type (__typeof__ (+(expr)))) /* The tgmath real type of EXPR1 combined with EXPR2, without handling - the C2X rule of interpreting integer arguments as _Float32x if any + the C23 rule of interpreting integer arguments as _Float32x if any argument is _FloatNx. */ # define __tgmath_real_type2_base(expr1, expr2) \ __typeof ((__tgmath_real_type (expr1)) 0 + (__tgmath_real_type (expr2)) 0) /* The tgmath complex type of EXPR1 combined with EXPR2, without - handling the C2X rule of interpreting integer arguments as + handling the C23 rule of interpreting integer arguments as _Float32x if any argument is _FloatNx. */ # define __tgmath_complex_type2_base(expr1, expr2) \ __typeof ((__tgmath_complex_type (expr1)) 0 \ + (__tgmath_complex_type (expr2)) 0) /* The tgmath real type of EXPR1 combined with EXPR2 and EXPR3, - without handling the C2X rule of interpreting integer arguments as + without handling the C23 rule of interpreting integer arguments as _Float32x if any argument is _FloatNx. */ # define __tgmath_real_type3_base(expr1, expr2, expr3) \ __typeof ((__tgmath_real_type (expr1)) 0 \ @@ -361,7 +361,7 @@ # define __TGMATH_CF128(arg_comb, fct, cfct, arg_call) /* Nothing. */ # endif -# endif /* !__HAVE_BUILTIN_TGMATH_C2X. */ +# endif /* !__HAVE_BUILTIN_TGMATH_C23. */ /* We have two kinds of generic macros: to support functions which are only defined on real valued parameters and those which are defined @@ -374,13 +374,13 @@ __TGMATH_2 (Fct, (Val1), (Val2)) # define __TGMATH_BINARY_FIRST_REAL_STD_ONLY(Val1, Val2, Fct) \ __TGMATH_2STD (Fct, (Val1), (Val2)) -# if __HAVE_BUILTIN_TGMATH_C2X +# if __HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \ __TGMATH_2 (Fct, (Val1), (Val2)) # endif # define __TGMATH_BINARY_REAL_STD_ONLY(Val1, Val2, Fct) \ __TGMATH_2STD (Fct, (Val1), (Val2)) -# if __HAVE_BUILTIN_TGMATH_C2X +# if __HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \ __TGMATH_3 (Fct, (Val1), (Val2), (Val3)) # define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \ @@ -395,7 +395,7 @@ __TGMATH_1C (Fct, Cfct, (Val)) # define __TGMATH_UNARY_REAL_IMAG_RET_REAL_SAME(Val, Cfct) \ __TGMATH_1 (Cfct, (Val)) -# if __HAVE_BUILTIN_TGMATH_C2X +# if __HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \ __TGMATH_2C (Fct, Cfct, (Val1), (Val2)) # endif @@ -441,7 +441,7 @@ : (__tgmath_real_type (Val1)) __tgml(Fct) (Val1, Val2))) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \ (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double) \ && __builtin_classify_type ((Val1) + (Val2)) == 8) \ @@ -479,7 +479,7 @@ Fct##f (Val1, Val2))) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \ (__extension__ ((sizeof ((Val1) + (Val2)) > sizeof (double) \ && __builtin_classify_type ((Val1) + (Val2)) == 8) \ @@ -597,7 +597,7 @@ __TGMATH_UNARY_REAL_IMAG_RET_REAL ((Val), Cfct, Cfct) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 /* XXX This definition has to be changed as soon as the compiler understands the imaginary keyword. */ # define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \ @@ -664,7 +664,7 @@ distinguished using sizeof (or at all if the types are typedefs rather than different types, in which case we err on the side of using the wider type if unsure). */ -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # if __HAVE_FLOATN_NOT_TYPEDEF # define __TGMATH_NARROW_F32X_USE_F64X(X) \ !__builtin_types_compatible_p (__typeof (+(X)), _Float64) @@ -714,7 +714,7 @@ F ## f64x (X, Y, Z) \ : F ## f128 (X, Y, Z))) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_1_NARROW_F32X(F, X) \ (__extension__ (sizeof ((__tgmath_real_type (X)) 0) > sizeof (_Float64) \ || __TGMATH_NARROW_F32X_USE_F64X (X) \ @@ -761,7 +761,7 @@ # define __TGMATH_3_NARROW_F64(F, X, Y, Z) \ (F ## f128 (X, Y, Z)) # endif -# if !__HAVE_BUILTIN_TGMATH_C2X +# if !__HAVE_BUILTIN_TGMATH_C23 # define __TGMATH_1_NARROW_F32X(F, X) \ (__extension__ (sizeof ((__tgmath_real_type (X)) 0) > sizeof (_Float32x) \ || __TGMATH_NARROW_F32X_USE_F64X (X) \ @@ -871,7 +871,7 @@ /* Compute base-2 logarithm of X. */ #define log2(Val) __TGMATH_UNARY_REAL_ONLY (Val, log2) -#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C2X) +#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23) /* Compute exponent to base ten. */ #define exp10(Val) __TGMATH_UNARY_REAL_ONLY (Val, exp10) #endif @@ -949,7 +949,7 @@ prevailing rounding mode. */ #define rint(Val) __TGMATH_UNARY_REAL_ONLY (Val, rint) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Return X - epsilon. */ # define nextdown(Val) __TGMATH_UNARY_REAL_ONLY (Val, nextdown) /* Return X + epsilon. */ @@ -983,7 +983,7 @@ /* Return positive difference between X and Y. */ #define fdim(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fdim) -#if __GLIBC_USE (ISOC2X) && !defined __USE_GNU +#if __GLIBC_USE (ISOC23) && !defined __USE_GNU /* Return maximum numeric value from X and Y. */ # define fmax(Val1, Val2) __TGMATH_BINARY_REAL_STD_ONLY (Val1, Val2, fmax) @@ -1002,7 +1002,7 @@ #define fma(Val1, Val2, Val3) \ __TGMATH_TERNARY_REAL_ONLY (Val1, Val2, Val3, fma) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Round X to nearest integer value, rounding halfway cases to even. */ # define roundeven(Val) __TGMATH_UNARY_REAL_ONLY (Val, roundeven) @@ -1030,7 +1030,7 @@ # define fminmag(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fminmag) #endif -#if __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (ISOC23) /* Return maximum value from X and Y. */ # define fmaximum(Val1, Val2) __TGMATH_BINARY_REAL_ONLY (Val1, Val2, fmaximum) @@ -1086,7 +1086,7 @@ /* Narrowing functions. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Add. */ # define fadd(Val1, Val2) __TGMATH_2_NARROW_F (fadd, Val1, Val2) diff --git a/resolv/tst-inet_addr-binary.c b/resolv/tst-inet_addr-binary.c index fe7ec63e66..abbb745467 100644 --- a/resolv/tst-inet_addr-binary.c +++ b/resolv/tst-inet_addr-binary.c @@ -1,4 +1,4 @@ -/* Test inet_addr does not accept C2X binary constants. +/* Test inet_addr does not accept C23 binary constants. Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/stdio-common/Makefile b/stdio-common/Makefile index e312565f3b..60a7f4cff3 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -490,8 +490,9 @@ CFLAGS-tst-bz11319-fortify2.c += $(no-fortify-source),-D_FORTIFY_SOURCE=2 CFLAGS-tst-memstream-string.c += -fno-builtin-fprintf -# Some versions of GCC supported for building glibc do not support -std=c2x, so -# the test for that version uses -std=c11 and then _ISOC2X_SOURCE is defined in +# Some versions of GCC supported for building glibc do not support -std=c23 +# (added in GCC 14), or the older name -std=c2x (added in GCC 9), so +# the test for that version uses -std=c11 and then _ISOC23_SOURCE is defined in # the test as needed. CFLAGS-tst-scanf-binary-c11.c += -std=c11 -DOBJPFX=\"$(objpfx)\" CFLAGS-tst-scanf-binary-c2x.c += -std=c11 -DOBJPFX=\"$(objpfx)\" diff --git a/stdio-common/tst-scanf-binary-c11.c b/stdio-common/tst-scanf-binary-c11.c index b8713aeb42..1d24f2eb29 100644 --- a/stdio-common/tst-scanf-binary-c11.c +++ b/stdio-common/tst-scanf-binary-c11.c @@ -1,4 +1,4 @@ -/* Test scanf functions with C2X binary integers (narrow strings, +/* Test scanf functions with C23 binary integers (narrow strings, no extensions to C11). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -22,7 +22,7 @@ #define CHAR char #define FNW #define L_(C) C -#define TEST_C2X 0 +#define TEST_C23 0 #define STD "c11" #include <tst-scanf-binary-main.c> diff --git a/stdio-common/tst-scanf-binary-c2x.c b/stdio-common/tst-scanf-binary-c2x.c index 1b1175fcb9..ebb9f04937 100644 --- a/stdio-common/tst-scanf-binary-c2x.c +++ b/stdio-common/tst-scanf-binary-c2x.c @@ -1,4 +1,4 @@ -/* Test scanf functions with C2X binary integers (narrow strings, +/* Test scanf functions with C23 binary integers (narrow strings, no extensions). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -18,14 +18,14 @@ <https://www.gnu.org/licenses/>. */ /* Some versions of GCC supported for building glibc do not support - -std=c2x. */ + -std=c23 or -std=c2x. */ #undef _GNU_SOURCE -#define _ISOC2X_SOURCE +#define _ISOC23_SOURCE #define CHAR char #define FNW #define L_(C) C -#define TEST_C2X 1 -#define STD "c2x" +#define TEST_C23 1 +#define STD "c23" #include <tst-scanf-binary-main.c> diff --git a/stdio-common/tst-scanf-binary-gnu11.c b/stdio-common/tst-scanf-binary-gnu11.c index 433b7de34c..4524b7cda8 100644 --- a/stdio-common/tst-scanf-binary-gnu11.c +++ b/stdio-common/tst-scanf-binary-gnu11.c @@ -1,4 +1,4 @@ -/* Test scanf functions with C2X binary integers (narrow strings, +/* Test scanf functions with C23 binary integers (narrow strings, GNU extensions to C11). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,7 +20,7 @@ #define CHAR char #define FNW #define L_(C) C -#define TEST_C2X 1 +#define TEST_C23 1 #define STD "gnu11" #include <tst-scanf-binary-main.c> diff --git a/stdio-common/tst-scanf-binary-gnu89.c b/stdio-common/tst-scanf-binary-gnu89.c index 61bb60c717..0a209b37c1 100644 --- a/stdio-common/tst-scanf-binary-gnu89.c +++ b/stdio-common/tst-scanf-binary-gnu89.c @@ -1,4 +1,4 @@ -/* Test scanf functions with C2X binary integers (narrow strings, +/* Test scanf functions with C23 binary integers (narrow strings, GNU extensions to C89). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,7 +20,7 @@ #define CHAR char #define FNW #define L_(C) C -#define TEST_C2X 0 +#define TEST_C23 0 #define STD "gnu89" #include <tst-scanf-binary-main.c> diff --git a/stdio-common/tst-scanf-binary-main.c b/stdio-common/tst-scanf-binary-main.c index 8745d09c22..b1038898c9 100644 --- a/stdio-common/tst-scanf-binary-main.c +++ b/stdio-common/tst-scanf-binary-main.c @@ -1,4 +1,4 @@ -/* Test scanf functions with C2X binary integers. +/* Test scanf functions with C23 binary integers. Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -78,7 +78,7 @@ one_check (const CHAR *s, int expected, char expected_c) TEST_VERIFY_EXIT (0 <= ret); xfclose (fp); - if (!TEST_C2X) + if (!TEST_C23) { expected = 0; expected_c = s[0] == L_('-') ? s[2] : s[1]; @@ -340,7 +340,7 @@ one_check_b (const CHAR *s, int expected, char expected_c) static void one_check_scnb (const CHAR *s, int expected, char expected_c) { -#if TEST_C2X || defined _GNU_SOURCE +#if TEST_C23 || defined _GNU_SOURCE CHECK_SCNB (uint8_t, SCNb8, s, (uint8_t) expected, expected_c); CHECK_SCNB (uint16_t, SCNb16, s, (uint16_t) expected, expected_c); CHECK_SCNB (uint32_t, SCNb32, s, (uint32_t) expected, expected_c); diff --git a/stdlib/Makefile b/stdlib/Makefile index 9898cc5d8a..e9f9c7856d 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -522,9 +522,10 @@ CFLAGS-tst-makecontext2.c += $(stack-align-test-flags) CFLAGS-testmb.c += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Werror -# Some versions of GCC supported for building glibc do not support -std=c2x -# or -std=gnu2x, so the tests for those versions use -std=c11 and -std=gnu11 -# and then _ISOC2X_SOURCE is defined in the test as needed. +# Some versions of GCC supported for building glibc do not support -std=c23 +# or -std=gnu23 (added in GCC 14), or the older names -std=c2x or -std=gnu2x +# (added in GCC 9), so the tests for those versions use -std=c11 and -std=gnu11 +# and then _ISOC23_SOURCE is defined in the test as needed. CFLAGS-tst-strtol-binary-c11.c += -std=c11 CFLAGS-tst-strtol-binary-c2x.c += -std=c11 CFLAGS-tst-strtol-binary-gnu11.c += -std=gnu11 diff --git a/stdlib/bits/stdlib-ldbl.h b/stdlib/bits/stdlib-ldbl.h index 4335a9b36c..8afdeb50df 100644 --- a/stdlib/bits/stdlib-ldbl.h +++ b/stdlib/bits/stdlib-ldbl.h @@ -36,7 +36,7 @@ __LDBL_REDIR1_DECL (strtold_l, __strtoieee128_l) # endif #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # ifdef __LDBL_COMPAT __LDBL_REDIR1_DECL (strfroml, strfromd) # else diff --git a/stdlib/inttypes.h b/stdlib/inttypes.h index 2ab40635b8..cfda146aa9 100644 --- a/stdlib/inttypes.h +++ b/stdlib/inttypes.h @@ -165,7 +165,7 @@ typedef wchar_t __gwchar_t; # define PRIXPTR __PRIPTR_PREFIX "X" /* Binary notation. */ -# if __GLIBC_USE (ISOC2X) +# if __GLIBC_USE (ISOC23) # define PRIb8 "b" # define PRIb16 "b" # define PRIb32 "b" @@ -303,7 +303,7 @@ typedef wchar_t __gwchar_t; /* Binary notation. */ -# if __GLIBC_USE (ISOC2X) +# if __GLIBC_USE (ISOC23) # define SCNb8 "hhb" # define SCNb16 "hb" # define SCNb32 "b" @@ -374,7 +374,7 @@ extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -#if __GLIBC_USE (C2X_STRTOL) +#if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern intmax_t __REDIRECT_NTH (strtoimax, (const char *__restrict __nptr, char **__restrict __endptr, diff --git a/stdlib/stdint.h b/stdlib/stdint.h index 01a9abc9e5..bb3e8b5cc6 100644 --- a/stdlib/stdint.h +++ b/stdlib/stdint.h @@ -262,7 +262,7 @@ typedef __uintmax_t uintmax_t; # define UINTMAX_C(c) c ## ULL # endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) # define INT8_WIDTH 8 # define UINT8_WIDTH 8 diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index 414c49d731..901926e893 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -210,7 +210,7 @@ extern unsigned long long int strtoull (const char *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -#if __GLIBC_USE (C2X_STRTOL) +#if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern long int __REDIRECT_NTH (strtol, (const char *__restrict __nptr, char **__restrict __endptr, @@ -274,7 +274,7 @@ extern unsigned long long int __isoc23_strtoull (const char *__restrict __nptr, #endif /* Convert a floating-point number to a string. */ -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) extern int strfromd (char *__dest, size_t __size, const char *__format, double __f) __THROW __nonnull ((3)); @@ -360,7 +360,7 @@ extern unsigned long long int strtoull_l (const char *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern long int __REDIRECT_NTH (strtol_l, (const char *__restrict __nptr, char **__restrict __endptr, diff --git a/stdlib/strtol.c b/stdlib/strtol.c index 138fdcab83..5373f0c025 100644 --- a/stdlib/strtol.c +++ b/stdlib/strtol.c @@ -17,8 +17,8 @@ <https://www.gnu.org/licenses/>. */ #include <features.h> -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #include <stdlib.h> #include <wchar.h> #include <locale/localeinfo.h> diff --git a/stdlib/strtol_l.c b/stdlib/strtol_l.c index 66c4035869..ebc5b6f747 100644 --- a/stdlib/strtol_l.c +++ b/stdlib/strtol_l.c @@ -17,8 +17,8 @@ <https://www.gnu.org/licenses/>. */ #include <features.h> -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #if HAVE_CONFIG_H # include <config.h> diff --git a/stdlib/strtoll_l.c b/stdlib/strtoll_l.c index 82852d4eb9..323da6d869 100644 --- a/stdlib/strtoll_l.c +++ b/stdlib/strtoll_l.c @@ -19,8 +19,8 @@ #define QUAD 1 #include <features.h> -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #include <locale.h> #include <stdbool.h> diff --git a/stdlib/strtoul_l.c b/stdlib/strtoul_l.c index 54e66425e1..0aeb80ff34 100644 --- a/stdlib/strtoul_l.c +++ b/stdlib/strtoul_l.c @@ -19,8 +19,8 @@ #define UNSIGNED 1 #include <features.h> -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #include <locale.h> #include <stdbool.h> diff --git a/stdlib/strtoull_l.c b/stdlib/strtoull_l.c index 9e4d91c555..334f2bd505 100644 --- a/stdlib/strtoull_l.c +++ b/stdlib/strtoull_l.c @@ -20,8 +20,8 @@ #define UNSIGNED 1 #include <features.h> -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #include <locale.h> #include <stdbool.h> diff --git a/stdlib/tst-strtol-binary-c11.c b/stdlib/tst-strtol-binary-c11.c index 01274b46be..c7b51d6413 100644 --- a/stdlib/tst-strtol-binary-c11.c +++ b/stdlib/tst-strtol-binary-c11.c @@ -1,4 +1,4 @@ -/* Test strtol functions with C2X binary integers (narrow strings, +/* Test strtol functions with C23 binary integers (narrow strings, no extensions to C11). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -23,7 +23,7 @@ #define WIDE 0 #define FNPFX strto #define L_(C) C -#define TEST_C2X 0 +#define TEST_C23 0 #define TEST_Q 0 #define TEST_LOCALE 0 diff --git a/stdlib/tst-strtol-binary-c2x.c b/stdlib/tst-strtol-binary-c2x.c index 2237f3a227..5e2b6dd6a0 100644 --- a/stdlib/tst-strtol-binary-c2x.c +++ b/stdlib/tst-strtol-binary-c2x.c @@ -1,4 +1,4 @@ -/* Test strtol functions with C2X binary integers (narrow strings, +/* Test strtol functions with C23 binary integers (narrow strings, no extensions). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -18,15 +18,15 @@ <https://www.gnu.org/licenses/>. */ /* Some versions of GCC supported for building glibc do not support - -std=c2x. */ + -std=c23 or -std=c2x. */ #undef _GNU_SOURCE -#define _ISOC2X_SOURCE +#define _ISOC23_SOURCE #define CHAR char #define WIDE 0 #define FNPFX strto #define L_(C) C -#define TEST_C2X 1 +#define TEST_C23 1 #define TEST_Q 0 #define TEST_LOCALE 0 diff --git a/stdlib/tst-strtol-binary-gnu11.c b/stdlib/tst-strtol-binary-gnu11.c index 4e1d39bc21..98b63c0ae1 100644 --- a/stdlib/tst-strtol-binary-gnu11.c +++ b/stdlib/tst-strtol-binary-gnu11.c @@ -1,5 +1,5 @@ -/* Test strtol functions with C2X binary integers (narrow strings, GNU - extensions, C2X strtol features disabled). +/* Test strtol functions with C23 binary integers (narrow strings, GNU + extensions, C23 strtol features disabled). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,15 +20,15 @@ #include <features.h> /* This file tests the old versions of GNU extension functions, which are not normally available to new binaries because GNU extensions - normally imply C2X strtol features. */ -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 + normally imply C23 strtol features. */ +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #define CHAR char #define WIDE 0 #define FNPFX strto #define L_(C) C -#define TEST_C2X 0 +#define TEST_C23 0 #define TEST_Q 1 #define TEST_LOCALE 1 diff --git a/stdlib/tst-strtol-binary-gnu2x.c b/stdlib/tst-strtol-binary-gnu2x.c index 97dafe8763..7732025dab 100644 --- a/stdlib/tst-strtol-binary-gnu2x.c +++ b/stdlib/tst-strtol-binary-gnu2x.c @@ -1,4 +1,4 @@ -/* Test strtol functions with C2X binary integers (narrow strings, GNU +/* Test strtol functions with C23 binary integers (narrow strings, GNU extensions). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -21,7 +21,7 @@ #define WIDE 0 #define FNPFX strto #define L_(C) C -#define TEST_C2X 1 +#define TEST_C23 1 #define TEST_Q 1 #define TEST_LOCALE 1 diff --git a/stdlib/tst-strtol-binary-main.c b/stdlib/tst-strtol-binary-main.c index f1ed2fde7e..47a208748f 100644 --- a/stdlib/tst-strtol-binary-main.c +++ b/stdlib/tst-strtol-binary-main.c @@ -1,4 +1,4 @@ -/* Test strtol functions with C2X binary integers. +/* Test strtol functions with C23 binary integers. Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -42,7 +42,7 @@ #define CHECK_RES(ARG, RES, EP, EXPECTED, EXPECTED_EP) \ do \ { \ - if (TEST_C2X) \ + if (TEST_C23) \ { \ TEST_COMPARE ((RES), EXPECTED); \ TEST_VERIFY ((EP) == EXPECTED_EP); \ diff --git a/string/string.h b/string/string.h index 10fca472a7..d2d5c5f1f9 100644 --- a/string/string.h +++ b/string/string.h @@ -50,7 +50,7 @@ extern void *memmove (void *__dest, const void *__src, size_t __n) /* Copy no more than N bytes of SRC to DEST, stopping when C is found. Return the position in DEST one byte past where C was copied, or NULL if C was not found in the first N bytes of SRC. */ -#if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC2X) +#if defined __USE_MISC || defined __USE_XOPEN || __GLIBC_USE (ISOC23) extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __THROW __nonnull ((1, 2)) __attr_access ((__write_only__, 1, 4)); @@ -182,7 +182,7 @@ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, #endif #if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 \ - || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC2X)) + || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC23)) /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup (const char *__s) __THROW __attribute_malloc__ __nonnull ((1)); @@ -191,7 +191,7 @@ extern char *strdup (const char *__s) /* Return a malloc'd copy of at most N bytes of STRING. The resultant string is terminated even if no null terminator appears before STRING[N]. */ -#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC2X) +#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) || __GLIBC_USE (ISOC23) extern char *strndup (const char *__string, size_t __n) __THROW __attribute_malloc__ __nonnull ((1)); #endif diff --git a/sysdeps/aarch64/bits/fenv.h b/sysdeps/aarch64/bits/fenv.h index 78e54cd0e6..cefa660813 100644 --- a/sysdeps/aarch64/bits/fenv.h +++ b/sysdeps/aarch64/bits/fenv.h @@ -73,7 +73,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/alpha/fpu/bits/fenv.h b/sysdeps/alpha/fpu/bits/fenv.h index e0a2bde2b1..b664512140 100644 --- a/sysdeps/alpha/fpu/bits/fenv.h +++ b/sysdeps/alpha/fpu/bits/fenv.h @@ -132,7 +132,7 @@ typedef unsigned long int fenv_t; extern unsigned long int __ieee_get_fp_control (void) __THROW; extern void __ieee_set_fp_control (unsigned long int __value) __THROW; -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned long int femode_t; diff --git a/sysdeps/arm/bits/fenv.h b/sysdeps/arm/bits/fenv.h index fed591bf52..320e3abe0d 100644 --- a/sysdeps/arm/bits/fenv.h +++ b/sysdeps/arm/bits/fenv.h @@ -81,7 +81,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/csky/bits/fenv.h b/sysdeps/csky/bits/fenv.h index 0c55d29a7b..99c4470732 100644 --- a/sysdeps/csky/bits/fenv.h +++ b/sysdeps/csky/bits/fenv.h @@ -102,7 +102,7 @@ typedef struct # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/hppa/fpu/bits/fenv.h b/sysdeps/hppa/fpu/bits/fenv.h index 68a634e4ba..796155f0d0 100644 --- a/sysdeps/hppa/fpu/bits/fenv.h +++ b/sysdeps/hppa/fpu/bits/fenv.h @@ -89,7 +89,7 @@ typedef struct # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile index 34273a5f58..20cb2dbe35 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile @@ -354,8 +354,9 @@ tests += tst-ibm128-scanf-binary-c11 \ tst-ieee128-scanf-binary-gnu11 \ tst-ieee128-scanf-binary-gnu89 -# Some versions of GCC supported for building glibc do not support -std=c2x, so -# the test for that version uses -std=c11 and then _ISOC2X_SOURCE is defined in +# Some versions of GCC supported for building glibc do not support -std=c23 +# (added in GCC 14), or the older name -std=c2x (added in GCC 9), so +# the test for that version uses -std=c11 and then _ISOC23_SOURCE is defined in # the test as needed. CFLAGS-tst-ibm128-scanf-binary-c11.c += -mabi=ibmlongdouble -Wno-psabi \ -std=c11 -DOBJPFX=\"$(objpfx)\" @@ -390,8 +391,9 @@ tests += tst-ibm128-wscanf-binary-c11 \ tst-ieee128-wscanf-binary-gnu11 \ tst-ieee128-wscanf-binary-gnu89 -# Some versions of GCC supported for building glibc do not support -std=c2x, so -# the test for that version uses -std=c11 and then _ISOC2X_SOURCE is defined in +# Some versions of GCC supported for building glibc do not support -std=c23 +# (added in GCC 14), or the older name -std=c2x (added in GCC 9), so +# the test for that version uses -std=c11 and then _ISOC23_SOURCE is defined in # the test as needed. CFLAGS-tst-ibm128-wscanf-binary-c11.c += -mabi=ibmlongdouble -Wno-psabi \ -std=c11 -DOBJPFX=\"$(objpfx)\" diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile index 0ed1cd2cae..f20c267081 100644 --- a/sysdeps/ieee754/ldbl-opt/Makefile +++ b/sysdeps/ieee754/ldbl-opt/Makefile @@ -236,8 +236,9 @@ tests += tst-nldbl-scanf-binary-c11 \ tst-nldbl-scanf-binary-gnu11 \ tst-nldbl-scanf-binary-gnu89 -# Some versions of GCC supported for building glibc do not support -std=c2x, so -# the test for that version uses -std=c11 and then _ISOC2X_SOURCE is defined in +# Some versions of GCC supported for building glibc do not support -std=c23 +# (added in GCC 14), or the older name -std=c2x (added in GCC 9), so +# the test for that version uses -std=c11 and then _ISOC23_SOURCE is defined in # the test as needed. CFLAGS-tst-nldbl-scanf-binary-c11.c += -mlong-double-64 -std=c11 \ -DOBJPFX=\"$(objpfx)\" @@ -256,8 +257,9 @@ tests += tst-nldbl-wscanf-binary-c11 \ tst-nldbl-wscanf-binary-gnu11 \ tst-nldbl-wscanf-binary-gnu89 -# Some versions of GCC supported for building glibc do not support -std=c2x, so -# the test for that version uses -std=c11 and then _ISOC2X_SOURCE is defined in +# Some versions of GCC supported for building glibc do not support -std=c23 +# (added in GCC 14), or the older name -std=c2x (added in GCC 9), so +# the test for that version uses -std=c11 and then _ISOC23_SOURCE is defined in # the test as needed. CFLAGS-tst-nldbl-wscanf-binary-c11.c += -mlong-double-64 -std=c11 \ -DOBJPFX=\"$(objpfx)\" diff --git a/sysdeps/loongarch/bits/fenv.h b/sysdeps/loongarch/bits/fenv.h index 4d4abefe5d..4417c42a19 100644 --- a/sysdeps/loongarch/bits/fenv.h +++ b/sysdeps/loongarch/bits/fenv.h @@ -81,7 +81,7 @@ typedef struct #define FE_NOMASK_ENV ((const fenv_t *) -257) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/m68k/bits/fenv.h b/sysdeps/m68k/bits/fenv.h index e6912c3096..4dad131fb0 100644 --- a/sysdeps/m68k/bits/fenv.h +++ b/sysdeps/m68k/bits/fenv.h @@ -122,7 +122,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/microblaze/bits/fenv.h b/sysdeps/microblaze/bits/fenv.h index 50a58f730e..b44888e09a 100644 --- a/sysdeps/microblaze/bits/fenv.h +++ b/sysdeps/microblaze/bits/fenv.h @@ -41,7 +41,7 @@ typedef unsigned int fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((const fenv_t *) -1l) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/mips/bits/fenv.h b/sysdeps/mips/bits/fenv.h index 707c11735a..9c82239b17 100644 --- a/sysdeps/mips/bits/fenv.h +++ b/sysdeps/mips/bits/fenv.h @@ -104,7 +104,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/nios2/bits/fenv.h b/sysdeps/nios2/bits/fenv.h index 6d46e61d6a..a8ec0cdcdb 100644 --- a/sysdeps/nios2/bits/fenv.h +++ b/sysdeps/nios2/bits/fenv.h @@ -43,7 +43,7 @@ typedef unsigned int fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((const fenv_t *) -1) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/powerpc/bits/fenv.h b/sysdeps/powerpc/bits/fenv.h index 1050d8d6f0..fee7a567e7 100644 --- a/sysdeps/powerpc/bits/fenv.h +++ b/sysdeps/powerpc/bits/fenv.h @@ -170,7 +170,7 @@ extern const fenv_t __fe_nonieee_env; #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef double femode_t; diff --git a/sysdeps/riscv/bits/fenv.h b/sysdeps/riscv/bits/fenv.h index c90e8a117d..f3a069b2bd 100644 --- a/sysdeps/riscv/bits/fenv.h +++ b/sysdeps/riscv/bits/fenv.h @@ -65,7 +65,7 @@ typedef unsigned int fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((__const fenv_t *) -1) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/s390/fpu/bits/fenv.h b/sysdeps/s390/fpu/bits/fenv.h index 3573140f85..258828eacc 100644 --- a/sysdeps/s390/fpu/bits/fenv.h +++ b/sysdeps/s390/fpu/bits/fenv.h @@ -90,7 +90,7 @@ typedef struct # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/sh/bits/fenv.h b/sysdeps/sh/bits/fenv.h index 4cc6ac79fd..200b6f52a8 100644 --- a/sysdeps/sh/bits/fenv.h +++ b/sysdeps/sh/bits/fenv.h @@ -75,7 +75,7 @@ fenv_t; /* If the default argument is used we use this value. */ #define FE_DFL_ENV ((const fenv_t *) -1) -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned int femode_t; diff --git a/sysdeps/sparc/fpu/bits/fenv.h b/sysdeps/sparc/fpu/bits/fenv.h index f49950d53e..8bee114973 100644 --- a/sysdeps/sparc/fpu/bits/fenv.h +++ b/sysdeps/sparc/fpu/bits/fenv.h @@ -83,7 +83,7 @@ typedef unsigned long int fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef unsigned long int femode_t; diff --git a/sysdeps/x86/fpu/bits/fenv.h b/sysdeps/x86/fpu/bits/fenv.h index 472e751a88..8b4a95a904 100644 --- a/sysdeps/x86/fpu/bits/fenv.h +++ b/sysdeps/x86/fpu/bits/fenv.h @@ -101,7 +101,7 @@ fenv_t; # define FE_NOMASK_ENV ((const fenv_t *) -2) #endif -#if __GLIBC_USE (IEC_60559_BFP_EXT_C2X) +#if __GLIBC_USE (IEC_60559_BFP_EXT_C23) /* Type representing floating-point control modes. */ typedef struct { diff --git a/time/time.h b/time/time.h index 1609aaeffa..b34cf22b4e 100644 --- a/time/time.h +++ b/time/time.h @@ -148,7 +148,7 @@ extern struct tm *__REDIRECT_NTH (localtime, (const time_t *__timer), #endif -#if defined __USE_POSIX || __GLIBC_USE (ISOC2X) +#if defined __USE_POSIX || __GLIBC_USE (ISOC23) # ifndef __USE_TIME_BITS64 /* Return the `struct tm' representation of *TIMER in UTC, using *TP to store the result. */ @@ -173,7 +173,7 @@ extern struct tm*__REDIRECT_NTH (localtime_r, (const time_t *__restrict __t, # define localtime_r __localtime_r # endif # endif -#endif /* POSIX || C2X */ +#endif /* POSIX || C23 */ /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" that is the representation of TP in this format. */ @@ -241,7 +241,7 @@ extern long int timezone; ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) -#if defined __USE_MISC || __GLIBC_USE (ISOC2X) +#if defined __USE_MISC || __GLIBC_USE (ISOC23) # ifndef __USE_TIME_BITS64 /* Like `mktime', but for TP represents Universal Time, not local time. */ extern time_t timegm (struct tm *__tp) __THROW; @@ -394,7 +394,7 @@ extern int __REDIRECT_NTH (timespec_get, (struct timespec *__ts, int __base), #endif -#if __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (ISOC23) # ifndef __USE_TIME_BITS64 /* Set TS to resolution of time base BASE. */ extern int timespec_getres (struct timespec *__ts, int __base) diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile index 65173e28aa..b64a5e1ce5 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -285,9 +285,10 @@ CPPFLAGS-wcstold_l.c += -I../stdlib $(objpfx)tst-wcstod-nan-locale: $(libm) $(objpfx)tst-wcstod-nan-sign: $(libm) -# Some versions of GCC supported for building glibc do not support -std=c2x -# or -std=gnu2x, so the tests for those versions use -std=c11 and -std=gnu11 -# and then _ISOC2X_SOURCE is defined in the test as needed. +# Some versions of GCC supported for building glibc do not support -std=c23 +# or -std=gnu23 (added in GCC 14), or the older names -std=c2x or -std=gnu2x +# (added in GCC 9), so the tests for those versions use -std=c11 and -std=gnu11 +# and then _ISOC23_SOURCE is defined in the test as needed. CFLAGS-tst-wcstol-binary-c11.c += -std=c11 CFLAGS-tst-wcstol-binary-c2x.c += -std=c11 CFLAGS-tst-wcstol-binary-gnu11.c += -std=gnu11 diff --git a/wcsmbs/bits/wchar-ldbl.h b/wcsmbs/bits/wchar-ldbl.h index 839eab7320..13de8c5077 100644 --- a/wcsmbs/bits/wchar-ldbl.h +++ b/wcsmbs/bits/wchar-ldbl.h @@ -29,7 +29,7 @@ __LDBL_REDIR_DECL (vwprintf); __LDBL_REDIR_DECL (vswprintf); # if !__GLIBC_USE (DEPRECATED_SCANF) # if defined __LDBL_COMPAT -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc23_fwscanf) __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc23_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc23_swscanf) @@ -39,7 +39,7 @@ __LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf) __LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf) # endif # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (fwscanf, __isoc23_fwscanfieee128) __LDBL_REDIR1_DECL (wscanf, __isoc23_wscanfieee128) __LDBL_REDIR1_DECL (swscanf, __isoc23_swscanfieee128) @@ -66,7 +66,7 @@ __LDBL_REDIR1_DECL (wcstold, __wcstoieee128) # endif # if !__GLIBC_USE (DEPRECATED_SCANF) # if defined __LDBL_COMPAT -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc23_vfwscanf) __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc23_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc23_vswscanf) @@ -76,7 +76,7 @@ __LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf) __LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf) # endif # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) __LDBL_REDIR1_DECL (vfwscanf, __isoc23_vfwscanfieee128) __LDBL_REDIR1_DECL (vwscanf, __isoc23_vwscanfieee128) __LDBL_REDIR1_DECL (vswscanf, __isoc23_vswscanfieee128) diff --git a/wcsmbs/tst-wcstol-binary-c11.c b/wcsmbs/tst-wcstol-binary-c11.c index 7266a987b0..7916f51773 100644 --- a/wcsmbs/tst-wcstol-binary-c11.c +++ b/wcsmbs/tst-wcstol-binary-c11.c @@ -1,4 +1,4 @@ -/* Test wcstol functions with C2X binary integers (wide strings, +/* Test wcstol functions with C23 binary integers (wide strings, no extensions to C11). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -23,7 +23,7 @@ #define WIDE 1 #define FNPFX wcsto #define L_(C) L ## C -#define TEST_C2X 0 +#define TEST_C23 0 #define TEST_Q 0 #define TEST_LOCALE 0 diff --git a/wcsmbs/tst-wcstol-binary-c2x.c b/wcsmbs/tst-wcstol-binary-c2x.c index 258e088596..1d7f90f7f0 100644 --- a/wcsmbs/tst-wcstol-binary-c2x.c +++ b/wcsmbs/tst-wcstol-binary-c2x.c @@ -1,4 +1,4 @@ -/* Test wcstol functions with C2X binary integers (wide strings, +/* Test wcstol functions with C23 binary integers (wide strings, no extensions). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -18,15 +18,15 @@ <https://www.gnu.org/licenses/>. */ /* Some versions of GCC supported for building glibc do not support - -std=c2x. */ + -std=c23 or -std-c2x. */ #undef _GNU_SOURCE -#define _ISOC2X_SOURCE +#define _ISOC23_SOURCE #define CHAR wchar_t #define WIDE 1 #define FNPFX wcsto #define L_(C) L ## C -#define TEST_C2X 1 +#define TEST_C23 1 #define TEST_Q 0 #define TEST_LOCALE 0 diff --git a/wcsmbs/tst-wcstol-binary-gnu11.c b/wcsmbs/tst-wcstol-binary-gnu11.c index eb58550125..f9d7b61d06 100644 --- a/wcsmbs/tst-wcstol-binary-gnu11.c +++ b/wcsmbs/tst-wcstol-binary-gnu11.c @@ -1,5 +1,5 @@ -/* Test wcstol functions with C2X binary integers (wide strings, GNU - extensions, C2X wcstol features disabled). +/* Test wcstol functions with C23 binary integers (wide strings, GNU + extensions, C23 wcstol features disabled). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,15 +20,15 @@ #include <features.h> /* This file tests the old versions of GNU extension functions, which are not normally available to new binaries because GNU extensions - normally imply C2X wcstol features. */ -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 + normally imply C23 wcstol features. */ +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #define CHAR wchar_t #define WIDE 1 #define FNPFX wcsto #define L_(C) L ## C -#define TEST_C2X 0 +#define TEST_C23 0 #define TEST_Q 1 #define TEST_LOCALE 1 diff --git a/wcsmbs/tst-wcstol-binary-gnu2x.c b/wcsmbs/tst-wcstol-binary-gnu2x.c index d830f6d0ee..7bd7c0dd84 100644 --- a/wcsmbs/tst-wcstol-binary-gnu2x.c +++ b/wcsmbs/tst-wcstol-binary-gnu2x.c @@ -1,4 +1,4 @@ -/* Test wcstol functions with C2X binary integers (wide strings, GNU +/* Test wcstol functions with C23 binary integers (wide strings, GNU extensions). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -21,7 +21,7 @@ #define WIDE 1 #define FNPFX wcsto #define L_(C) L ## C -#define TEST_C2X 1 +#define TEST_C23 1 #define TEST_Q 1 #define TEST_LOCALE 1 diff --git a/wcsmbs/tst-wscanf-binary-c11.c b/wcsmbs/tst-wscanf-binary-c11.c index 521842e094..50fb9c0ccd 100644 --- a/wcsmbs/tst-wscanf-binary-c11.c +++ b/wcsmbs/tst-wscanf-binary-c11.c @@ -1,4 +1,4 @@ -/* Test wscanf functions with C2X binary integers (wide strings, +/* Test wscanf functions with C23 binary integers (wide strings, no extensions to C11). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -22,7 +22,7 @@ #define CHAR wchar_t #define FNW w #define L_(C) L ## C -#define TEST_C2X 0 +#define TEST_C23 0 #define STD "c11" #include "../stdio-common/tst-scanf-binary-main.c" diff --git a/wcsmbs/tst-wscanf-binary-c2x.c b/wcsmbs/tst-wscanf-binary-c2x.c index 8049ce5f2f..06d99f235e 100644 --- a/wcsmbs/tst-wscanf-binary-c2x.c +++ b/wcsmbs/tst-wscanf-binary-c2x.c @@ -1,4 +1,4 @@ -/* Test wscanf functions with C2X binary integers (wide strings, +/* Test wscanf functions with C23 binary integers (wide strings, no extensions). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -18,14 +18,14 @@ <https://www.gnu.org/licenses/>. */ /* Some versions of GCC supported for building glibc do not support - -std=c2x. */ + -std=c23 or -std=c2x. */ #undef _GNU_SOURCE -#define _ISOC2X_SOURCE +#define _ISOC23_SOURCE #define CHAR wchar_t #define FNW w #define L_(C) L ## C -#define TEST_C2X 1 -#define STD "c2x" +#define TEST_C23 1 +#define STD "c23" #include "../stdio-common/tst-scanf-binary-main.c" diff --git a/wcsmbs/tst-wscanf-binary-gnu11.c b/wcsmbs/tst-wscanf-binary-gnu11.c index 0aec47ad5f..819ad89420 100644 --- a/wcsmbs/tst-wscanf-binary-gnu11.c +++ b/wcsmbs/tst-wscanf-binary-gnu11.c @@ -1,4 +1,4 @@ -/* Test wscanf functions with C2X binary integers (wide strings, +/* Test wscanf functions with C23 binary integers (wide strings, GNU extensions to C11). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,7 +20,7 @@ #define CHAR wchar_t #define FNW w #define L_(C) L ## C -#define TEST_C2X 1 +#define TEST_C23 1 #define STD "gnu11" #include "../stdio-common/tst-scanf-binary-main.c" diff --git a/wcsmbs/tst-wscanf-binary-gnu89.c b/wcsmbs/tst-wscanf-binary-gnu89.c index bdf858c8f5..2f3c38d7d0 100644 --- a/wcsmbs/tst-wscanf-binary-gnu89.c +++ b/wcsmbs/tst-wscanf-binary-gnu89.c @@ -1,4 +1,4 @@ -/* Test wscanf functions with C2X binary integers (wide strings, +/* Test wscanf functions with C23 binary integers (wide strings, GNU extensions to C89). Copyright (C) 2022-2024 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -20,7 +20,7 @@ #define CHAR wchar_t #define FNW w #define L_(C) L ## C -#define TEST_C2X 0 +#define TEST_C23 0 #define STD "gnu89" #include "../stdio-common/tst-scanf-binary-main.c" diff --git a/wcsmbs/uchar.h b/wcsmbs/uchar.h index 442b1ca932..7123f46500 100644 --- a/wcsmbs/uchar.h +++ b/wcsmbs/uchar.h @@ -31,9 +31,9 @@ #include <bits/types.h> #include <bits/types/mbstate_t.h> -/* Declare the C2x char8_t typedef in C2x modes, but only if the C++ +/* Declare the C23 char8_t typedef in C23 modes, but only if the C++ __cpp_char8_t feature test macro is not defined. */ -#if __GLIBC_USE (ISOC2X) && !defined __cpp_char8_t +#if __GLIBC_USE (ISOC23) && !defined __cpp_char8_t #if __GNUC_PREREQ (10, 0) && defined __cplusplus /* Suppress the diagnostic regarding char8_t being a keyword in C++20. */ # pragma GCC diagnostic push @@ -55,9 +55,9 @@ typedef __uint_least32_t char32_t; __BEGIN_DECLS -/* Declare the C2x mbrtoc8() and c8rtomb() functions in C2x modes or if +/* Declare the C23 mbrtoc8() and c8rtomb() functions in C23 modes or if the C++ __cpp_char8_t feature test macro is defined. */ -#if __GLIBC_USE (ISOC2X) || defined __cpp_char8_t +#if __GLIBC_USE (ISOC23) || defined __cpp_char8_t /* Write char8_t representation of multibyte character pointed to by S to PC8. */ extern size_t mbrtoc8 (char8_t *__restrict __pc8, diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index e52fb18567..554d811a22 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -410,7 +410,7 @@ extern long double wcstold (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; #endif /* C99 */ -#if __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC2X) +#if __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC23) /* Likewise for `_FloatN' and `_FloatNx' when support is enabled. */ # if __HAVE_FLOAT16 @@ -447,7 +447,7 @@ extern _Float64x wcstof64x (const wchar_t *__restrict __nptr, extern _Float128x wcstof128x (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; # endif -#endif /* __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC2X) */ +#endif /* __GLIBC_USE (IEC_60559_TYPES_EXT) && __GLIBC_USE (ISOC23) */ /* Convert initial portion of wide string NPTR to `long int' @@ -495,7 +495,7 @@ extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -#if __GLIBC_USE (C2X_STRTOL) +#if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern long int __REDIRECT_NTH (wcstol, (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, @@ -579,7 +579,7 @@ extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr, /* Versions of the above functions that handle '0b' and '0B' prefixes in base 0 or 2. */ -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern long int __REDIRECT_NTH (wcstol_l, (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, @@ -790,7 +790,7 @@ extern int swscanf (const wchar_t *__restrict __s, bits/wchar-ldbl.h. */ # if !__GLIBC_USE (DEPRECATED_SCANF) && !defined __LDBL_COMPAT \ && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...), @@ -870,7 +870,7 @@ extern int vswscanf (const wchar_t *__restrict __s, && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) \ && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0 -# if __GLIBC_USE (C2X_STRTOL) +# if __GLIBC_USE (C23_STRTOL) # ifdef __REDIRECT extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s, const wchar_t *__restrict __format, diff --git a/wcsmbs/wcstol_l.c b/wcsmbs/wcstol_l.c index dcea69ae8b..ebbef5d7a1 100644 --- a/wcsmbs/wcstol_l.c +++ b/wcsmbs/wcstol_l.c @@ -17,8 +17,8 @@ <https://www.gnu.org/licenses/>. */ #include <features.h> -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #define __need_wchar_t #include <stddef.h> #include <locale.h> diff --git a/wcsmbs/wcstoll_l.c b/wcsmbs/wcstoll_l.c index bc8d22638b..96c65d05c5 100644 --- a/wcsmbs/wcstoll_l.c +++ b/wcsmbs/wcstoll_l.c @@ -17,8 +17,8 @@ <https://www.gnu.org/licenses/>. */ #include <features.h> -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #define __need_wchar_t #include <stddef.h> #include <locale.h> diff --git a/wcsmbs/wcstoul_l.c b/wcsmbs/wcstoul_l.c index 0642dab652..ea332bf016 100644 --- a/wcsmbs/wcstoul_l.c +++ b/wcsmbs/wcstoul_l.c @@ -17,8 +17,8 @@ <https://www.gnu.org/licenses/>. */ #include <features.h> -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #define __need_wchar_t #include <stddef.h> #include <locale.h> diff --git a/wcsmbs/wcstoull_l.c b/wcsmbs/wcstoull_l.c index 1694705bbd..04b27e8482 100644 --- a/wcsmbs/wcstoull_l.c +++ b/wcsmbs/wcstoull_l.c @@ -17,8 +17,8 @@ <https://www.gnu.org/licenses/>. */ #include <features.h> -#undef __GLIBC_USE_C2X_STRTOL -#define __GLIBC_USE_C2X_STRTOL 0 +#undef __GLIBC_USE_C23_STRTOL +#define __GLIBC_USE_C23_STRTOL 0 #define __need_wchar_t #include <stddef.h> #include <locale.h> |