diff options
author | Joseph Myers <josmyers@redhat.com> | 2024-02-01 11:02:01 +0000 |
---|---|---|
committer | Joseph Myers <josmyers@redhat.com> | 2024-02-01 11:02:01 +0000 |
commit | 42cc619dfbc44e263239c2de870bae11ad65810a (patch) | |
tree | 13f7e2f0ad1e9b3c4a36f9ecd4e3e49b1d268120 /include | |
parent | 7c8df0b9441e34928f2d7d70531e3d55e016c32e (diff) | |
download | glibc-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 'include')
-rw-r--r-- | include/features.h | 44 | ||||
-rw-r--r-- | include/limits.h | 6 | ||||
-rw-r--r-- | include/stdio.h | 2 | ||||
-rw-r--r-- | include/stdlib.h | 4 | ||||
-rw-r--r-- | include/wchar.h | 4 |
5 files changed, 34 insertions, 26 deletions
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 |