diff --git a/admin/gnulib-patches/lib/getloadavg.c.diff b/admin/gnulib-patches/lib/getloadavg.c.diff deleted file mode 100644 index afa633703b7..00000000000 --- a/admin/gnulib-patches/lib/getloadavg.c.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/lib/getloadavg.c b/lib/getloadavg.c -index 9da41c16c02..1cb1c01097d 100644 ---- a/lib/getloadavg.c -+++ b/lib/getloadavg.c -@@ -499,7 +499,8 @@ getloadavg (double loadavg[], int nelem) - } - # endif - --# if !defined (LDAV_DONE) && (defined __linux__ || defined __ANDROID__) -+# if !defined (LDAV_DONE) && (defined __linux__ || defined __ANDROID__) \ -+ && (!defined __ANDROID__ || __ANDROID_API__ >= 13) - /* Linux without glibc, Android, Cygwin */ - # define LDAV_DONE - # undef LOAD_AVE_TYPE diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 88f74d6eb7f..54dcf275d55 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -80,10 +80,6 @@ case $src in *) src=$src/ ;; esac -GNULIB_TOOL_FLAGS="$GNULIB_TOOL_FLAGS - --local-dir="$src"admin/gnulib-patches -" - # Gnulib's source directory. gnulib_srcdir=${1-$src../gnulib} diff --git a/lib/attribute.h b/lib/attribute.h index 625195c8565..ae7bbe8e2cb 100644 --- a/lib/attribute.h +++ b/lib/attribute.h @@ -85,10 +85,10 @@ _GL_ATTRIBUTE_FALLTHROUGH, _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_LEAF, _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_MAY_ALIAS, _GL_ATTRIBUTE_MAYBE_UNUSED, _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE, _GL_ATTRIBUTE_NONNULL, - _GL_ATTRIBUTE_NONSTRING, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, - _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_REPRODUCIBLE, - _GL_ATTRIBUTE_RETURNS_NONNULL, _GL_ATTRIBUTE_SENTINEL, - _GL_ATTRIBUTE_UNSEQUENCED. */ + _GL_ATTRIBUTE_NONNULL_IF_NONZERO, _GL_ATTRIBUTE_NONSTRING, + _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, _GL_ATTRIBUTE_PURE, + _GL_ATTRIBUTE_REPRODUCIBLE, _GL_ATTRIBUTE_RETURNS_NONNULL, + _GL_ATTRIBUTE_SENTINEL, _GL_ATTRIBUTE_UNSEQUENCED. */ #if !_GL_CONFIG_H_INCLUDED #error "Please include config.h first." #endif @@ -170,6 +170,12 @@ /* Applies to: functions. */ #define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL (args) +/* ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) - Argument NP (a pointer) + must not be NULL if the argument NI (an integer) is != 0. */ +/* Applies to: functions. */ +#define ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (np, ni) + + /* The function's return value is a non-NULL pointer. */ /* Applies to: functions. */ #define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL diff --git a/lib/cdefs.h b/lib/cdefs.h index 53269033d9d..65da09dc096 100644 --- a/lib/cdefs.h +++ b/lib/cdefs.h @@ -482,7 +482,7 @@ run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ -#if !(__GNUC_PREREQ (2,8) || defined __clang__) +#if ! (__GNUC_PREREQ (2,8) || defined __clang__ || 0x5150 <= __SUNPRO_C) # define __extension__ /* Ignore */ #endif diff --git a/lib/diffseq.h b/lib/diffseq.h index 8a823f98ea0..914bc643bb4 100644 --- a/lib/diffseq.h +++ b/lib/diffseq.h @@ -77,6 +77,11 @@ #include "minmax.h" */ +/* This file uses _GL_GNUC_PREREQ. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Maximum value of type OFFSET. */ #ifndef OFFSET_MAX # define OFFSET_MAX \ @@ -93,7 +98,7 @@ #endif /* Suppress gcc's "...may be used before initialized" warnings, - generated by GCC versions up to at least GCC 14.2. + generated by GCC versions up to at least GCC 15.1. Likewise for gcc -fanalyzer's "use of uninitialized value" warnings. */ #if _GL_GNUC_PREREQ (4, 7) # pragma GCC diagnostic push diff --git a/lib/getloadavg.c b/lib/getloadavg.c index 1cb1c01097d..752ec1f5ae7 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -140,7 +140,7 @@ # define SUNOS_5 # endif -# if defined (__osf__) && (defined (__alpha) || defined (__alpha__)) +# if defined (__osf__) && defined (__alpha) # define OSF_ALPHA # include # include @@ -499,9 +499,9 @@ getloadavg (double loadavg[], int nelem) } # endif -# if !defined (LDAV_DONE) && (defined __linux__ || defined __ANDROID__) \ - && (!defined __ANDROID__ || __ANDROID_API__ >= 13) - /* Linux without glibc, Android, Cygwin */ +# if (!defined LDAV_DONE \ + && (defined __ANDROID__ ? 13 <= __ANDROID_API__ : defined __linux__)) + /* non-Android Linux without glibc, Android 3.2+, Cygwin */ # define LDAV_DONE # undef LOAD_AVE_TYPE @@ -514,7 +514,7 @@ getloadavg (double loadavg[], int nelem) loadavg[2] = info.loads[2] / (double)(1U << SI_LOAD_SHIFT); elem = 3; } -# endif /* __linux__ || __ANDROID__ */ +# endif /* __ANDROID__ ? 13 <= __ANDROID_API__ : __linux__ */ # if !defined (LDAV_DONE) && defined __CYGWIN__ /* Cygwin */ diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index cf7d0470f67..fb34cf2cc1d 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -22,7 +22,6 @@ # Generated by gnulib-tool. # Reproduce by: # gnulib-tool --import \ -# --local-dir=./admin/gnulib-patches \ # --lib=libgnu \ # --source-base=lib \ # --m4-base=m4 \ diff --git a/lib/stddef.in.h b/lib/stddef.in.h index 3e4a8ec6032..dc689b8df80 100644 --- a/lib/stddef.in.h +++ b/lib/stddef.in.h @@ -31,7 +31,7 @@ || defined __need_ptrdiff_t || defined __need_NULL \ || defined __need_wint_t) \ /* Avoid warning triggered by "gcc -std=gnu23 -Wsystem-headers" \ - in Fedora 40 with gcc 14.0.1. \ + in GCC 13.3 and 14.2 \ . */ \ && !@STDDEF_NOT_IDEMPOTENT@ /* Special invocation convention inside gcc header files. In diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index dbe8ebc8502..1342db48772 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -168,6 +168,18 @@ _GL_INLINE_HEADER_BEGIN # endif #endif +/* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP + (a pointer) must not be NULL if the argument NI (an integer) is != 0. */ +/* Applies to: functions. */ +#ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO +# if __GNUC__ >= 15 && !defined __clang__ +# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) \ + __attribute__ ((__nonnull_if_nonzero__ (np, ni))) +# else +# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) +# endif +#endif + /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. */ #ifndef _GL_ATTRIBUTE_NOTHROW @@ -223,6 +235,18 @@ _GL_INLINE_HEADER_BEGIN #endif +/* Declarations for ISO C N3322. */ +#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__ +_GL_EXTERN_C void *bsearch (const void *__key, + const void *__base, size_t __nmemb, size_t __size, + int (*__compare) (const void *, const void *)) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3) _GL_ARG_NONNULL ((5)); +_GL_EXTERN_C void qsort (void *__base, size_t __nmemb, size_t __size, + int (*__compare) (const void *, const void *)) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ARG_NONNULL ((4)); +#endif + + #if @GNULIB__EXIT@ /* Terminate the current process with the given return code, without running the 'atexit' handlers. */ @@ -1182,7 +1206,8 @@ typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *); _GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, _gl_qsort_r_compar_fn compare, void *arg), - _GL_ARG_NONNULL ((1, 4))); + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) + _GL_ARG_NONNULL ((4))); _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, _gl_qsort_r_compar_fn compare, void *arg)); @@ -1191,7 +1216,8 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, _GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, _gl_qsort_r_compar_fn compare, void *arg), - _GL_ARG_NONNULL ((1, 4))); + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) + _GL_ARG_NONNULL ((4))); # endif _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, _gl_qsort_r_compar_fn compare, diff --git a/lib/string.in.h b/lib/string.in.h index 44b9497d802..e7642211685 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -116,6 +116,18 @@ # endif #endif +/* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP + (a pointer) must not be NULL if the argument NI (an integer) is != 0. */ +/* Applies to: functions. */ +#ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO +# if __GNUC__ >= 15 && !defined __clang__ +# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) \ + __attribute__ ((__nonnull_if_nonzero__ (np, ni))) +# else +# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) +# endif +#endif + /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. */ #ifndef _GL_ATTRIBUTE_NOTHROW @@ -154,6 +166,7 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ + /* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though may not have been included yet. */ #if @GNULIB_FREE_POSIX@ @@ -198,6 +211,44 @@ _GL_EXTERN_C void free (void *); # endif #endif + +/* Declarations for ISO C N3322. */ +#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__ +_GL_EXTERN_C void *memcpy (void *__dest, const void *__src, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3); +_GL_EXTERN_C void *memccpy (void *__dest, const void *__src, int __c, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 4) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 4); +_GL_EXTERN_C void *memmove (void *__dest, const void *__src, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3); +_GL_EXTERN_C char *strncpy (char *__dest, const char *__src, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3); +_GL_EXTERN_C char *strndup (const char *__s, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2); +_GL_EXTERN_C char *strncat (char *__dest, const char *__src, size_t __n) + _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3); +_GL_EXTERN_C int memcmp (const void *__s1, const void *__s2, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3); +_GL_EXTERN_C int strncmp (const char *__s1, const char *__s2, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3); +# ifndef __cplusplus +_GL_EXTERN_C void *memchr (const void *__s, int __c, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3); +_GL_EXTERN_C void *memrchr (const void *__s, int __c, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3); +# endif +_GL_EXTERN_C void *memset (void *__s, int __c, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3); +_GL_EXTERN_C void *memset_explicit (void *__s, int __c, size_t __n) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3); +#endif + + /* Clear a block of memory. The compiler will not delete a call to this function, even if the block is dead after the call. */ #if @GNULIB_EXPLICIT_BZERO@ @@ -215,6 +266,7 @@ _GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - " # endif #endif + /* Find the index of the least-significant set bit. */ #if @GNULIB_FFSL@ # if !@HAVE_FFSL@ @@ -281,7 +333,7 @@ _GL_CXXALIASWARN (memccpy); # endif _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n), _GL_ATTRIBUTE_PURE - _GL_ARG_NONNULL ((1))); + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)); _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); # else /* On some systems, this function is defined as an overloaded function: @@ -388,7 +440,7 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - " # if ! @HAVE_DECL_MEMRCHR@ _GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t), _GL_ATTRIBUTE_PURE - _GL_ARG_NONNULL ((1))); + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)); # endif /* On some systems, this function is defined as an overloaded function: extern "C++" { const void * std::memrchr (const void *, int, size_t); } @@ -425,12 +477,14 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - " # define memset_explicit rpl_memset_explicit # endif _GL_FUNCDECL_RPL (memset_explicit, void *, - (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1))); + (void *__dest, int __c, size_t __n), + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)); _GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t __n)); # else # if !@HAVE_MEMSET_EXPLICIT@ _GL_FUNCDECL_SYS (memset_explicit, void *, - (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1))); + (void *__dest, int __c, size_t __n), + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)); # endif _GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n)); # endif @@ -697,7 +751,8 @@ _GL_CXXALIASWARN (strdup); # endif _GL_FUNCDECL_RPL (strncat, char *, (char *restrict dest, const char *restrict src, size_t n), - _GL_ARG_NONNULL ((1, 2))); + _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3)); _GL_CXXALIAS_RPL (strncat, char *, (char *restrict dest, const char *restrict src, size_t n)); # else @@ -724,7 +779,7 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - " # endif _GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n), - _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); # else @@ -733,13 +788,13 @@ _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 _GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n), - _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) _GL_ATTRIBUTE_NOTHROW; # else _GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n), - _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); # endif # endif @@ -752,13 +807,13 @@ _GL_CXXALIASWARN (strndup); # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 _GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n), - _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) _GL_ATTRIBUTE_NOTHROW; # else _GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n), - _GL_ARG_NONNULL ((1)) + _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); # endif # endif diff --git a/lib/utimensat.c b/lib/utimensat.c index ca1d39e5900..fcf2d27eb3e 100644 --- a/lib/utimensat.c +++ b/lib/utimensat.c @@ -118,7 +118,7 @@ rpl_utimensat (int fd, char const *file, struct timespec const times[2], ts[1] = times[1]; times = ts; } -# if defined __hppa__ || defined __NetBSD__ +# if defined __hppa || defined __NetBSD__ /* Linux kernel 2.6.22.19 on hppa does not reject invalid tv_nsec values. diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index daf05db2a47..d5bf2fb358e 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ # gnulib-common.m4 -# serial 109 +# serial 110 dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -117,6 +117,9 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) # else # define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr +/* The following lines list the first GCC version that supports the attribute. + Although the lines are not used in GCC 5 and later (as GCC 5 introduced + __has_attribute support), list GCC versions 5+ anyway for completeness. */ # define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3) # define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2) # define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3) @@ -137,14 +140,15 @@ AC_DEFUN([gl_COMMON_BODY], [ # endif # define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1) # define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3) +# define _GL_ATTR_nonnull_if_nonzero _GL_GNUC_PREREQ (15, 1) # define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0) # define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3) # define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7) # define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96) -# define _GL_ATTR_reproducible 0 /* not yet supported, as of GCC 14 */ +# define _GL_ATTR_reproducible _GL_GNUC_PREREQ (15, 1) # define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9) # define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0) -# define _GL_ATTR_unsequenced 0 /* not yet supported, as of GCC 14 */ +# define _GL_ATTR_unsequenced _GL_GNUC_PREREQ (15, 1) # define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7) # define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) # endif @@ -681,6 +685,17 @@ AC_DEFUN([gl_COMMON_BODY], [ # endif #endif +/* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP + (a pointer) must not be NULL if the argument NI (an integer) is != 0. */ +/* Applies to: functions. */ +#ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO +# if _GL_HAS_ATTRIBUTE (nonnull_if_nonzero) +# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) __attribute__ ((__nonnull_if_nonzero__ (np, ni))) +# else +# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) +# endif +#endif + /* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is not meant to be NUL-terminated. */ /* Applies to: struct/union members and variables that are arrays of element diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index cf3f730b4c3..eebba901806 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -97,7 +97,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], # export LC_ALL=C && comm -3 \ # <((sed -n 's/^ *\(-[^ 0-9][^ ]*\).*/\1/p' manywarnings.m4; \ # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \ - # <(LC_ALL=C gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort) + # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort) $1= for gl_manywarn_item in -fanalyzer -fstrict-flex-arrays \ @@ -106,7 +106,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], -Wbad-function-cast \ -Wcast-align=strict \ -Wdate-time \ - -Wdisabled-optimization \ -Wdouble-promotion \ -Wduplicated-branches \ -Wduplicated-cond \ diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4 index a6bc6243143..3bc8cd85fea 100644 --- a/m4/stddef_h.m4 +++ b/m4/stddef_h.m4 @@ -1,5 +1,5 @@ # stddef_h.m4 -# serial 19 +# serial 21 dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -91,12 +91,14 @@ AC_DEFUN_ONCE([gl_STDDEF_H], fi dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870 - dnl affects GCC 13 and 14. + dnl affects GCC 13.3 and 14.2. AC_CACHE_CHECK([whether is idempotent], [gl_cv_stddef_idempotent], [AC_COMPILE_IFELSE([AC_LANG_SOURCE( [[ - #if __GNUC__ == 13 || __GNUC__ == 14 + #if \ + ((__GNUC__ == 13 && __GNUC_MINOR__ <= 3) \ + || (__GNUC__ == 14 && __GNUC_MINOR__ <= 2)) #error "bug 114870 is present" #endif ]])],