https://gcc.gnu.org/g:2c8cf85d94741b046a849da9121be9cb43d6ba13
commit r17-5293-g2c8cf85d94741b046a849da9121be9cb43d6ba13 Author: Sam James <[email protected]> Date: Wed Oct 14 02:39:21 2026 +0100 libcpp: assume errno C89. libcpp/ChangeLog: PR bootstrap/112422 * config.in: Regenerate. * configure: Regenerate. * configure.ac: Don't check for errno. * system.h: Drop errno fallback. Diff: --- libcpp/config.in | 4 ---- libcpp/configure | 10 ---------- libcpp/configure.ac | 2 +- libcpp/system.h | 4 ---- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/libcpp/config.in b/libcpp/config.in index 8eb46835c1c6..04133ae6d424 100644 --- a/libcpp/config.in +++ b/libcpp/config.in @@ -62,10 +62,6 @@ you don't. */ #undef HAVE_DECL_CLEARERR_UNLOCKED -/* Define to 1 if you have the declaration of `errno', and to 0 if you don't. - */ -#undef HAVE_DECL_ERRNO - /* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FEOF_UNLOCKED diff --git a/libcpp/configure b/libcpp/configure index 19bb0984868e..98a88aaf47b4 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -5942,16 +5942,6 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_BASENAME $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "errno" "ac_cv_have_decl_errno" "$ac_includes_default" -if test "x$ac_cv_have_decl_errno" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ERRNO $ac_have_decl -_ACEOF ac_fn_c_check_decl "$LINENO" "getopt" "ac_cv_have_decl_getopt" "$ac_includes_default" if test "x$ac_cv_have_decl_getopt" = xyes; then : ac_have_decl=1 diff --git a/libcpp/configure.ac b/libcpp/configure.ac index d31bee8e0070..4aafc0aebe68 100644 --- a/libcpp/configure.ac +++ b/libcpp/configure.ac @@ -79,7 +79,7 @@ define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl putchar_unlocked putc_unlocked) AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS setlocale) -AC_CHECK_DECLS([asprintf, basename(char *), errno, getopt, vasprintf]) +AC_CHECK_DECLS([asprintf, basename(char *), getopt, vasprintf]) AC_CHECK_DECLS(m4_split(m4_normalize(libcpp_UNLOCKED_FUNCS))) # Checks for library functions. diff --git a/libcpp/system.h b/libcpp/system.h index 3b0e497f0893..86e3fd49a883 100644 --- a/libcpp/system.h +++ b/libcpp/system.h @@ -191,10 +191,6 @@ extern int fprintf_unlocked (FILE *, const char *, ...); #include <sys/types.h> #include <errno.h> -#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO -extern int errno; -#endif - /* Some of glibc's string inlines cause warnings. Plus we'd rather rely on (and therefore test) GCC's string builtins. */ #define __NO_STRING_INLINES
