about summary refs log tree commit diff
path: root/wcsmbs
diff options
context:
space:
mode:
authorJoseph Myers <josmyers@redhat.com>2024-02-01 11:02:01 +0000
committerJoseph Myers <josmyers@redhat.com>2024-02-01 11:02:01 +0000
commit42cc619dfbc44e263239c2de870bae11ad65810a (patch)
tree13f7e2f0ad1e9b3c4a36f9ecd4e3e49b1d268120 /wcsmbs
parent7c8df0b9441e34928f2d7d70531e3d55e016c32e (diff)
downloadglibc-42cc619dfbc44e263239c2de870bae11ad65810a.tar.gz
glibc-42cc619dfbc44e263239c2de870bae11ad65810a.tar.xz
glibc-42cc619dfbc44e263239c2de870bae11ad65810a.zip
Refer to C23 in place of C2X in glibc
WG14 decided to use the name C23 as the informal name of the next
revision of the C standard (notwithstanding the publication date in
2024).  Update references to C2X in glibc to use the C23 name.

This is intended to update everything *except* where it involves
renaming files (the changes involving renaming tests are intended to
be done separately).  In the case of the _ISOC2X_SOURCE feature test
macro - the only user-visible interface involved - support for that
macro is kept for backwards compatibility, while adding
_ISOC23_SOURCE.

Tested for x86_64.
Diffstat (limited to 'wcsmbs')
-rw-r--r--wcsmbs/Makefile7
-rw-r--r--wcsmbs/bits/wchar-ldbl.h8
-rw-r--r--wcsmbs/tst-wcstol-binary-c11.c4
-rw-r--r--wcsmbs/tst-wcstol-binary-c2x.c8
-rw-r--r--wcsmbs/tst-wcstol-binary-gnu11.c12
-rw-r--r--wcsmbs/tst-wcstol-binary-gnu2x.c4
-rw-r--r--wcsmbs/tst-wscanf-binary-c11.c4
-rw-r--r--wcsmbs/tst-wscanf-binary-c2x.c10
-rw-r--r--wcsmbs/tst-wscanf-binary-gnu11.c4
-rw-r--r--wcsmbs/tst-wscanf-binary-gnu89.c4
-rw-r--r--wcsmbs/uchar.h8
-rw-r--r--wcsmbs/wchar.h12
-rw-r--r--wcsmbs/wcstol_l.c4
-rw-r--r--wcsmbs/wcstoll_l.c4
-rw-r--r--wcsmbs/wcstoul_l.c4
-rw-r--r--wcsmbs/wcstoull_l.c4
16 files changed, 51 insertions, 50 deletions
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>