https://gcc.gnu.org/g:828297e35daeaf077b194ef2775271e27ccc3a9c
commit r17-6297-g828297e35daeaf077b194ef2775271e27ccc3a9c Author: Kael Andrew Franco <[email protected]> Date: Sun Nov 15 10:40:42 2026 -0500 libcpp: Remove HAVE_LIMITS_H in system.h. [PR112422] Since r17-5293 assume at least C89, limits.h must exist so remove HAVE_LIMITS_H. limits.h has UCHAR_MAX so remove #ifndef UCHAR_MAX. Bootstrapped on x86_64-pc-linux-gnu. PR bootstrap/112422 libcpp/ChangeLog: * configure.ac: Remove check for limits.h. * config.in: Regenerate. * configure: Regenerate. * system.h: Remove #ifndef UCHAR_MAX and HAVE_LIMITS_H. Diff: --- libcpp/config.in | 3 --- libcpp/configure | 2 +- libcpp/configure.ac | 2 +- libcpp/system.h | 9 +-------- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/libcpp/config.in b/libcpp/config.in index 04133ae6d424..cebf0bae1745 100644 --- a/libcpp/config.in +++ b/libcpp/config.in @@ -184,9 +184,6 @@ /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET -/* Define to 1 if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - /* Define to 1 if you have the <locale.h> header file. */ #undef HAVE_LOCALE_H diff --git a/libcpp/configure b/libcpp/configure index 98a88aaf47b4..577405bd3c0f 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -5426,7 +5426,7 @@ $as_echo "#define STRING_WITH_STRINGS 1" >>confdefs.h fi -for ac_header in locale.h fcntl.h limits.h strings.h string.h sys/file.h unistd.h +for ac_header in locale.h fcntl.h strings.h string.h sys/file.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/libcpp/configure.ac b/libcpp/configure.ac index 4aafc0aebe68..01aa928f7d22 100644 --- a/libcpp/configure.ac +++ b/libcpp/configure.ac @@ -56,7 +56,7 @@ ZW_PROG_COMPILER_DEPENDENCIES([CXX]) AC_HEADER_TIME ACX_HEADER_STRING -AC_CHECK_HEADERS(locale.h fcntl.h limits.h strings.h string.h sys/file.h unistd.h) +AC_CHECK_HEADERS(locale.h fcntl.h strings.h string.h sys/file.h unistd.h) # Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN diff --git a/libcpp/system.h b/libcpp/system.h index 86e3fd49a883..c00904394715 100644 --- a/libcpp/system.h +++ b/libcpp/system.h @@ -214,9 +214,7 @@ extern int fprintf_unlocked (FILE *, const char *, ...); # include <unistd.h> #endif -#if HAVE_LIMITS_H -# include <limits.h> -#endif +#include <limits.h> /* Infrastructure for defining missing _MAX and _MIN macros. Note that macros defined with these cannot be used in #if. */ @@ -229,11 +227,6 @@ extern int fprintf_unlocked (FILE *, const char *, ...); ? (t) 1 << (sizeof (t) * CHAR_BIT - 1) : (t) 0)) #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t))) -/* Use that infrastructure to provide a few constants. */ -#ifndef UCHAR_MAX -# define UCHAR_MAX INTTYPE_MAXIMUM (unsigned char) -#endif - #ifdef TIME_WITH_SYS_TIME # include <sys/time.h> # include <time.h>
