about summary refs log tree commit diff
path: root/stdlib
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 /stdlib
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 'stdlib')
-rw-r--r--stdlib/Makefile7
-rw-r--r--stdlib/bits/stdlib-ldbl.h2
-rw-r--r--stdlib/inttypes.h6
-rw-r--r--stdlib/stdint.h2
-rw-r--r--stdlib/stdlib.h6
-rw-r--r--stdlib/strtol.c4
-rw-r--r--stdlib/strtol_l.c4
-rw-r--r--stdlib/strtoll_l.c4
-rw-r--r--stdlib/strtoul_l.c4
-rw-r--r--stdlib/strtoull_l.c4
-rw-r--r--stdlib/tst-strtol-binary-c11.c4
-rw-r--r--stdlib/tst-strtol-binary-c2x.c8
-rw-r--r--stdlib/tst-strtol-binary-gnu11.c12
-rw-r--r--stdlib/tst-strtol-binary-gnu2x.c4
-rw-r--r--stdlib/tst-strtol-binary-main.c4
15 files changed, 38 insertions, 37 deletions
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);				\