+++ /dev/null
-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
*) src=$src/ ;;
esac
-GNULIB_TOOL_FLAGS="$GNULIB_TOOL_FLAGS
- --local-dir="$src"admin/gnulib-patches
-"
-
# Gnulib's source directory.
gnulib_srcdir=${1-$src../gnulib}
_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
/* 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
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
#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 \
#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
# define SUNOS_5
# endif
-# if defined (__osf__) && (defined (__alpha) || defined (__alpha__))
+# if defined (__osf__) && defined (__alpha)
# define OSF_ALPHA
# include <sys/mbuf.h>
# include <sys/socket.h>
}
# 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
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 */
# Generated by gnulib-tool.
# Reproduce by:
# gnulib-tool --import \
-# --local-dir=./admin/gnulib-patches \
# --lib=libgnu \
# --source-base=lib \
# --m4-base=m4 \
|| 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 \
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870>. */ \
&& !@STDDEF_NOT_IDEMPOTENT@
/* Special invocation convention inside gcc header files. In
# 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
#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. */
_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));
_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,
# 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
/* The definition of _GL_WARN_ON_USE is copied here. */
+
/* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though <stdlib.h> may not have
been included yet. */
#if @GNULIB_FREE_POSIX@
# 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@
# endif
#endif
+
/* Find the index of the least-significant set bit. */
#if @GNULIB_FFSL@
# if !@HAVE_FFSL@
# 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:
# 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); }
# 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
# 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
# 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
# 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
# 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
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.
# 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,
# 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)
# 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
# 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
# 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 \
-Wbad-function-cast \
-Wcast-align=strict \
-Wdate-time \
- -Wdisabled-optimization \
-Wdouble-promotion \
-Wduplicated-branches \
-Wduplicated-cond \
# 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,
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 <stddef.h> 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
]])],