aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2025-05-07 23:57:18 -0700
committerPaul Eggert2025-05-08 00:16:46 -0700
commitc9c6abfa81c58b4a62f4fa5fcaad94b219f5d706 (patch)
treed018390e6532a07121cc64e4ce7c80c7618f9876
parent322ed637b4c2fe826d41c5af3800b2f2e381bb0f (diff)
downloademacs-c9c6abfa81c58b4a62f4fa5fcaad94b219f5d706.tar.gz
emacs-c9c6abfa81c58b4a62f4fa5fcaad94b219f5d706.zip
Update from Gnulib by running admin/merge-gnulib
The following changes were made by hand, so that admin/merge-gnulib could succeed instead of failing because the diff didn’t match. * admin/gnulib-patches/lib/getloadavg.c.diff: Remove, as it is no longer needed now that recent Gnulib has been merged. * admin/merge-gnulib (GNULIB_TOOL_FLAGS): Remove the --local-dir="$src"admin/gnulib-patches option, as it is no longer needed either.
-rw-r--r--admin/gnulib-patches/lib/getloadavg.c.diff14
-rwxr-xr-xadmin/merge-gnulib4
-rw-r--r--lib/attribute.h14
-rw-r--r--lib/cdefs.h2
-rw-r--r--lib/diffseq.h7
-rw-r--r--lib/getloadavg.c10
-rw-r--r--lib/gnulib.mk.in1
-rw-r--r--lib/stddef.in.h2
-rw-r--r--lib/stdlib.in.h30
-rw-r--r--lib/string.in.h75
-rw-r--r--lib/utimensat.c2
-rw-r--r--m4/gnulib-common.m421
-rw-r--r--m4/manywarnings.m43
-rw-r--r--m4/stddef_h.m48
14 files changed, 141 insertions, 52 deletions
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 @@
1diff --git a/lib/getloadavg.c b/lib/getloadavg.c
2index 9da41c16c02..1cb1c01097d 100644
3--- a/lib/getloadavg.c
4+++ b/lib/getloadavg.c
5@@ -499,7 +499,8 @@ getloadavg (double loadavg[], int nelem)
6 }
7 # endif
8
9-# if !defined (LDAV_DONE) && (defined __linux__ || defined __ANDROID__)
10+# if !defined (LDAV_DONE) && (defined __linux__ || defined __ANDROID__) \
11+ && (!defined __ANDROID__ || __ANDROID_API__ >= 13)
12 /* Linux without glibc, Android, Cygwin */
13 # define LDAV_DONE
14 # 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
80 *) src=$src/ ;; 80 *) src=$src/ ;;
81esac 81esac
82 82
83GNULIB_TOOL_FLAGS="$GNULIB_TOOL_FLAGS
84 --local-dir="$src"admin/gnulib-patches
85"
86
87# Gnulib's source directory. 83# Gnulib's source directory.
88gnulib_srcdir=${1-$src../gnulib} 84gnulib_srcdir=${1-$src../gnulib}
89 85
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 @@
85 _GL_ATTRIBUTE_FALLTHROUGH, _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_LEAF, 85 _GL_ATTRIBUTE_FALLTHROUGH, _GL_ATTRIBUTE_FORMAT, _GL_ATTRIBUTE_LEAF,
86 _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_MAY_ALIAS, _GL_ATTRIBUTE_MAYBE_UNUSED, 86 _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_MAY_ALIAS, _GL_ATTRIBUTE_MAYBE_UNUSED,
87 _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE, _GL_ATTRIBUTE_NONNULL, 87 _GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE, _GL_ATTRIBUTE_NONNULL,
88 _GL_ATTRIBUTE_NONSTRING, _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, 88 _GL_ATTRIBUTE_NONNULL_IF_NONZERO, _GL_ATTRIBUTE_NONSTRING,
89 _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_REPRODUCIBLE, 89 _GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, _GL_ATTRIBUTE_PURE,
90 _GL_ATTRIBUTE_RETURNS_NONNULL, _GL_ATTRIBUTE_SENTINEL, 90 _GL_ATTRIBUTE_REPRODUCIBLE, _GL_ATTRIBUTE_RETURNS_NONNULL,
91 _GL_ATTRIBUTE_UNSEQUENCED. */ 91 _GL_ATTRIBUTE_SENTINEL, _GL_ATTRIBUTE_UNSEQUENCED. */
92#if !_GL_CONFIG_H_INCLUDED 92#if !_GL_CONFIG_H_INCLUDED
93 #error "Please include config.h first." 93 #error "Please include config.h first."
94#endif 94#endif
@@ -170,6 +170,12 @@
170/* Applies to: functions. */ 170/* Applies to: functions. */
171#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL (args) 171#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL (args)
172 172
173/* ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) - Argument NP (a pointer)
174 must not be NULL if the argument NI (an integer) is != 0. */
175/* Applies to: functions. */
176#define ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (np, ni)
177
178
173/* The function's return value is a non-NULL pointer. */ 179/* The function's return value is a non-NULL pointer. */
174/* Applies to: functions. */ 180/* Applies to: functions. */
175#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL 181#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 @@
482 run in pedantic mode if the uses are carefully marked using the 482 run in pedantic mode if the uses are carefully marked using the
483 `__extension__' keyword. But this is not generally available before 483 `__extension__' keyword. But this is not generally available before
484 version 2.8. */ 484 version 2.8. */
485#if !(__GNUC_PREREQ (2,8) || defined __clang__) 485#if ! (__GNUC_PREREQ (2,8) || defined __clang__ || 0x5150 <= __SUNPRO_C)
486# define __extension__ /* Ignore */ 486# define __extension__ /* Ignore */
487#endif 487#endif
488 488
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 @@
77 #include "minmax.h" 77 #include "minmax.h"
78 */ 78 */
79 79
80/* This file uses _GL_GNUC_PREREQ. */
81#if !_GL_CONFIG_H_INCLUDED
82 #error "Please include config.h first."
83#endif
84
80/* Maximum value of type OFFSET. */ 85/* Maximum value of type OFFSET. */
81#ifndef OFFSET_MAX 86#ifndef OFFSET_MAX
82# define OFFSET_MAX \ 87# define OFFSET_MAX \
@@ -93,7 +98,7 @@
93#endif 98#endif
94 99
95/* Suppress gcc's "...may be used before initialized" warnings, 100/* Suppress gcc's "...may be used before initialized" warnings,
96 generated by GCC versions up to at least GCC 14.2. 101 generated by GCC versions up to at least GCC 15.1.
97 Likewise for gcc -fanalyzer's "use of uninitialized value" warnings. */ 102 Likewise for gcc -fanalyzer's "use of uninitialized value" warnings. */
98#if _GL_GNUC_PREREQ (4, 7) 103#if _GL_GNUC_PREREQ (4, 7)
99# pragma GCC diagnostic push 104# 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 @@
140# define SUNOS_5 140# define SUNOS_5
141# endif 141# endif
142 142
143# if defined (__osf__) && (defined (__alpha) || defined (__alpha__)) 143# if defined (__osf__) && defined (__alpha)
144# define OSF_ALPHA 144# define OSF_ALPHA
145# include <sys/mbuf.h> 145# include <sys/mbuf.h>
146# include <sys/socket.h> 146# include <sys/socket.h>
@@ -499,9 +499,9 @@ getloadavg (double loadavg[], int nelem)
499 } 499 }
500# endif 500# endif
501 501
502# if !defined (LDAV_DONE) && (defined __linux__ || defined __ANDROID__) \ 502# if (!defined LDAV_DONE \
503 && (!defined __ANDROID__ || __ANDROID_API__ >= 13) 503 && (defined __ANDROID__ ? 13 <= __ANDROID_API__ : defined __linux__))
504 /* Linux without glibc, Android, Cygwin */ 504 /* non-Android Linux without glibc, Android 3.2+, Cygwin */
505# define LDAV_DONE 505# define LDAV_DONE
506# undef LOAD_AVE_TYPE 506# undef LOAD_AVE_TYPE
507 507
@@ -514,7 +514,7 @@ getloadavg (double loadavg[], int nelem)
514 loadavg[2] = info.loads[2] / (double)(1U << SI_LOAD_SHIFT); 514 loadavg[2] = info.loads[2] / (double)(1U << SI_LOAD_SHIFT);
515 elem = 3; 515 elem = 3;
516 } 516 }
517# endif /* __linux__ || __ANDROID__ */ 517# endif /* __ANDROID__ ? 13 <= __ANDROID_API__ : __linux__ */
518 518
519# if !defined (LDAV_DONE) && defined __CYGWIN__ 519# if !defined (LDAV_DONE) && defined __CYGWIN__
520 /* Cygwin */ 520 /* 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 @@
22# Generated by gnulib-tool. 22# Generated by gnulib-tool.
23# Reproduce by: 23# Reproduce by:
24# gnulib-tool --import \ 24# gnulib-tool --import \
25# --local-dir=./admin/gnulib-patches \
26# --lib=libgnu \ 25# --lib=libgnu \
27# --source-base=lib \ 26# --source-base=lib \
28# --m4-base=m4 \ 27# --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 @@
31 || defined __need_ptrdiff_t || defined __need_NULL \ 31 || defined __need_ptrdiff_t || defined __need_NULL \
32 || defined __need_wint_t) \ 32 || defined __need_wint_t) \
33 /* Avoid warning triggered by "gcc -std=gnu23 -Wsystem-headers" \ 33 /* Avoid warning triggered by "gcc -std=gnu23 -Wsystem-headers" \
34 in Fedora 40 with gcc 14.0.1. \ 34 in GCC 13.3 and 14.2 \
35 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870>. */ \ 35 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870>. */ \
36 && !@STDDEF_NOT_IDEMPOTENT@ 36 && !@STDDEF_NOT_IDEMPOTENT@
37/* Special invocation convention inside gcc header files. In 37/* 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
168# endif 168# endif
169#endif 169#endif
170 170
171/* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP
172 (a pointer) must not be NULL if the argument NI (an integer) is != 0. */
173/* Applies to: functions. */
174#ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO
175# if __GNUC__ >= 15 && !defined __clang__
176# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) \
177 __attribute__ ((__nonnull_if_nonzero__ (np, ni)))
178# else
179# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni)
180# endif
181#endif
182
171/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. 183/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
172 */ 184 */
173#ifndef _GL_ATTRIBUTE_NOTHROW 185#ifndef _GL_ATTRIBUTE_NOTHROW
@@ -223,6 +235,18 @@ _GL_INLINE_HEADER_BEGIN
223#endif 235#endif
224 236
225 237
238/* Declarations for ISO C N3322. */
239#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__
240_GL_EXTERN_C void *bsearch (const void *__key,
241 const void *__base, size_t __nmemb, size_t __size,
242 int (*__compare) (const void *, const void *))
243 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3) _GL_ARG_NONNULL ((5));
244_GL_EXTERN_C void qsort (void *__base, size_t __nmemb, size_t __size,
245 int (*__compare) (const void *, const void *))
246 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2) _GL_ARG_NONNULL ((4));
247#endif
248
249
226#if @GNULIB__EXIT@ 250#if @GNULIB__EXIT@
227/* Terminate the current process with the given return code, without running 251/* Terminate the current process with the given return code, without running
228 the 'atexit' handlers. */ 252 the 'atexit' handlers. */
@@ -1182,7 +1206,8 @@ typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
1182_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, 1206_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
1183 _gl_qsort_r_compar_fn compare, 1207 _gl_qsort_r_compar_fn compare,
1184 void *arg), 1208 void *arg),
1185 _GL_ARG_NONNULL ((1, 4))); 1209 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
1210 _GL_ARG_NONNULL ((4)));
1186_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, 1211_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
1187 _gl_qsort_r_compar_fn compare, 1212 _gl_qsort_r_compar_fn compare,
1188 void *arg)); 1213 void *arg));
@@ -1191,7 +1216,8 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
1191_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, 1216_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
1192 _gl_qsort_r_compar_fn compare, 1217 _gl_qsort_r_compar_fn compare,
1193 void *arg), 1218 void *arg),
1194 _GL_ARG_NONNULL ((1, 4))); 1219 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
1220 _GL_ARG_NONNULL ((4)));
1195# endif 1221# endif
1196_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, 1222_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
1197 _gl_qsort_r_compar_fn compare, 1223 _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 @@
116# endif 116# endif
117#endif 117#endif
118 118
119/* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP
120 (a pointer) must not be NULL if the argument NI (an integer) is != 0. */
121/* Applies to: functions. */
122#ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO
123# if __GNUC__ >= 15 && !defined __clang__
124# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) \
125 __attribute__ ((__nonnull_if_nonzero__ (np, ni)))
126# else
127# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni)
128# endif
129#endif
130
119/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. 131/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
120 */ 132 */
121#ifndef _GL_ATTRIBUTE_NOTHROW 133#ifndef _GL_ATTRIBUTE_NOTHROW
@@ -154,6 +166,7 @@
154 166
155/* The definition of _GL_WARN_ON_USE is copied here. */ 167/* The definition of _GL_WARN_ON_USE is copied here. */
156 168
169
157/* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though <stdlib.h> may not have 170/* Make _GL_ATTRIBUTE_DEALLOC_FREE work, even though <stdlib.h> may not have
158 been included yet. */ 171 been included yet. */
159#if @GNULIB_FREE_POSIX@ 172#if @GNULIB_FREE_POSIX@
@@ -198,6 +211,44 @@ _GL_EXTERN_C void free (void *);
198# endif 211# endif
199#endif 212#endif
200 213
214
215/* Declarations for ISO C N3322. */
216#if defined __GNUC__ && __GNUC__ >= 15 && !defined __clang__
217_GL_EXTERN_C void *memcpy (void *__dest, const void *__src, size_t __n)
218 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
219 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
220_GL_EXTERN_C void *memccpy (void *__dest, const void *__src, int __c, size_t __n)
221 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 4)
222 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 4);
223_GL_EXTERN_C void *memmove (void *__dest, const void *__src, size_t __n)
224 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
225 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
226_GL_EXTERN_C char *strncpy (char *__dest, const char *__src, size_t __n)
227 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
228 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
229_GL_EXTERN_C char *strndup (const char *__s, size_t __n)
230 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2);
231_GL_EXTERN_C char *strncat (char *__dest, const char *__src, size_t __n)
232 _GL_ARG_NONNULL ((1)) _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
233_GL_EXTERN_C int memcmp (const void *__s1, const void *__s2, size_t __n)
234 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
235 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
236_GL_EXTERN_C int strncmp (const char *__s1, const char *__s2, size_t __n)
237 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3)
238 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3);
239# ifndef __cplusplus
240_GL_EXTERN_C void *memchr (const void *__s, int __c, size_t __n)
241 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3);
242_GL_EXTERN_C void *memrchr (const void *__s, int __c, size_t __n)
243 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3);
244# endif
245_GL_EXTERN_C void *memset (void *__s, int __c, size_t __n)
246 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3);
247_GL_EXTERN_C void *memset_explicit (void *__s, int __c, size_t __n)
248 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3);
249#endif
250
251
201/* Clear a block of memory. The compiler will not delete a call to 252/* Clear a block of memory. The compiler will not delete a call to
202 this function, even if the block is dead after the call. */ 253 this function, even if the block is dead after the call. */
203#if @GNULIB_EXPLICIT_BZERO@ 254#if @GNULIB_EXPLICIT_BZERO@
@@ -215,6 +266,7 @@ _GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - "
215# endif 266# endif
216#endif 267#endif
217 268
269
218/* Find the index of the least-significant set bit. */ 270/* Find the index of the least-significant set bit. */
219#if @GNULIB_FFSL@ 271#if @GNULIB_FFSL@
220# if !@HAVE_FFSL@ 272# if !@HAVE_FFSL@
@@ -281,7 +333,7 @@ _GL_CXXALIASWARN (memccpy);
281# endif 333# endif
282_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n), 334_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n),
283 _GL_ATTRIBUTE_PURE 335 _GL_ATTRIBUTE_PURE
284 _GL_ARG_NONNULL ((1))); 336 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3));
285_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); 337_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
286# else 338# else
287 /* On some systems, this function is defined as an overloaded function: 339 /* On some systems, this function is defined as an overloaded function:
@@ -388,7 +440,7 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
388# if ! @HAVE_DECL_MEMRCHR@ 440# if ! @HAVE_DECL_MEMRCHR@
389_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t), 441_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t),
390 _GL_ATTRIBUTE_PURE 442 _GL_ATTRIBUTE_PURE
391 _GL_ARG_NONNULL ((1))); 443 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3));
392# endif 444# endif
393 /* On some systems, this function is defined as an overloaded function: 445 /* On some systems, this function is defined as an overloaded function:
394 extern "C++" { const void * std::memrchr (const void *, int, size_t); } 446 extern "C++" { const void * std::memrchr (const void *, int, size_t); }
@@ -425,12 +477,14 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
425# define memset_explicit rpl_memset_explicit 477# define memset_explicit rpl_memset_explicit
426# endif 478# endif
427_GL_FUNCDECL_RPL (memset_explicit, void *, 479_GL_FUNCDECL_RPL (memset_explicit, void *,
428 (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1))); 480 (void *__dest, int __c, size_t __n),
481 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3));
429_GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t __n)); 482_GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t __n));
430# else 483# else
431# if !@HAVE_MEMSET_EXPLICIT@ 484# if !@HAVE_MEMSET_EXPLICIT@
432_GL_FUNCDECL_SYS (memset_explicit, void *, 485_GL_FUNCDECL_SYS (memset_explicit, void *,
433 (void *__dest, int __c, size_t __n), _GL_ARG_NONNULL ((1))); 486 (void *__dest, int __c, size_t __n),
487 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 3));
434# endif 488# endif
435_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n)); 489_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n));
436# endif 490# endif
@@ -697,7 +751,8 @@ _GL_CXXALIASWARN (strdup);
697# endif 751# endif
698_GL_FUNCDECL_RPL (strncat, char *, 752_GL_FUNCDECL_RPL (strncat, char *,
699 (char *restrict dest, const char *restrict src, size_t n), 753 (char *restrict dest, const char *restrict src, size_t n),
700 _GL_ARG_NONNULL ((1, 2))); 754 _GL_ARG_NONNULL ((1))
755 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (2, 3));
701_GL_CXXALIAS_RPL (strncat, char *, 756_GL_CXXALIAS_RPL (strncat, char *,
702 (char *restrict dest, const char *restrict src, size_t n)); 757 (char *restrict dest, const char *restrict src, size_t n));
703# else 758# else
@@ -724,7 +779,7 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - "
724# endif 779# endif
725_GL_FUNCDECL_RPL (strndup, char *, 780_GL_FUNCDECL_RPL (strndup, char *,
726 (char const *__s, size_t __n), 781 (char const *__s, size_t __n),
727 _GL_ARG_NONNULL ((1)) 782 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
728 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 783 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
729_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); 784_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
730# else 785# else
@@ -733,13 +788,13 @@ _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
733# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 788# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
734_GL_FUNCDECL_SYS (strndup, char *, 789_GL_FUNCDECL_SYS (strndup, char *,
735 (char const *__s, size_t __n), 790 (char const *__s, size_t __n),
736 _GL_ARG_NONNULL ((1)) 791 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
737 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) 792 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
738 _GL_ATTRIBUTE_NOTHROW; 793 _GL_ATTRIBUTE_NOTHROW;
739# else 794# else
740_GL_FUNCDECL_SYS (strndup, char *, 795_GL_FUNCDECL_SYS (strndup, char *,
741 (char const *__s, size_t __n), 796 (char const *__s, size_t __n),
742 _GL_ARG_NONNULL ((1)) 797 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
743 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 798 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
744# endif 799# endif
745# endif 800# endif
@@ -752,13 +807,13 @@ _GL_CXXALIASWARN (strndup);
752# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 807# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
753_GL_FUNCDECL_SYS (strndup, char *, 808_GL_FUNCDECL_SYS (strndup, char *,
754 (char const *__s, size_t __n), 809 (char const *__s, size_t __n),
755 _GL_ARG_NONNULL ((1)) 810 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
756 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE) 811 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE)
757 _GL_ATTRIBUTE_NOTHROW; 812 _GL_ATTRIBUTE_NOTHROW;
758# else 813# else
759_GL_FUNCDECL_SYS (strndup, char *, 814_GL_FUNCDECL_SYS (strndup, char *,
760 (char const *__s, size_t __n), 815 (char const *__s, size_t __n),
761 _GL_ARG_NONNULL ((1)) 816 _GL_ATTRIBUTE_NONNULL_IF_NONZERO (1, 2)
762 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); 817 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
763# endif 818# endif
764# endif 819# 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],
118 ts[1] = times[1]; 118 ts[1] = times[1];
119 times = ts; 119 times = ts;
120 } 120 }
121# if defined __hppa__ || defined __NetBSD__ 121# if defined __hppa || defined __NetBSD__
122 /* Linux kernel 2.6.22.19 on hppa does not reject invalid tv_nsec 122 /* Linux kernel 2.6.22.19 on hppa does not reject invalid tv_nsec
123 values. 123 values.
124 124
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 @@
1# gnulib-common.m4 1# gnulib-common.m4
2# serial 109 2# serial 110
3dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. 3dnl Copyright (C) 2007-2025 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
@@ -117,6 +117,9 @@ AC_DEFUN([gl_COMMON_BODY], [
117# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) 117# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
118# else 118# else
119# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr 119# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
120/* The following lines list the first GCC version that supports the attribute.
121 Although the lines are not used in GCC 5 and later (as GCC 5 introduced
122 __has_attribute support), list GCC versions 5+ anyway for completeness. */
120# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3) 123# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
121# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2) 124# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
122# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3) 125# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
@@ -137,14 +140,15 @@ AC_DEFUN([gl_COMMON_BODY], [
137# endif 140# endif
138# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1) 141# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
139# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3) 142# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
143# define _GL_ATTR_nonnull_if_nonzero _GL_GNUC_PREREQ (15, 1)
140# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0) 144# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
141# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3) 145# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
142# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7) 146# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
143# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96) 147# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
144# define _GL_ATTR_reproducible 0 /* not yet supported, as of GCC 14 */ 148# define _GL_ATTR_reproducible _GL_GNUC_PREREQ (15, 1)
145# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9) 149# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
146# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0) 150# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
147# define _GL_ATTR_unsequenced 0 /* not yet supported, as of GCC 14 */ 151# define _GL_ATTR_unsequenced _GL_GNUC_PREREQ (15, 1)
148# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7) 152# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
149# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) 153# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
150# endif 154# endif
@@ -681,6 +685,17 @@ AC_DEFUN([gl_COMMON_BODY], [
681# endif 685# endif
682#endif 686#endif
683 687
688/* _GL_ATTRIBUTE_NONNULL_IF_NONZERO (NP, NI) declares that the argument NP
689 (a pointer) must not be NULL if the argument NI (an integer) is != 0. */
690/* Applies to: functions. */
691#ifndef _GL_ATTRIBUTE_NONNULL_IF_NONZERO
692# if _GL_HAS_ATTRIBUTE (nonnull_if_nonzero)
693# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni) __attribute__ ((__nonnull_if_nonzero__ (np, ni)))
694# else
695# define _GL_ATTRIBUTE_NONNULL_IF_NONZERO(np, ni)
696# endif
697#endif
698
684/* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is 699/* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is
685 not meant to be NUL-terminated. */ 700 not meant to be NUL-terminated. */
686/* Applies to: struct/union members and variables that are arrays of element 701/* 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)],
97 # export LC_ALL=C && comm -3 \ 97 # export LC_ALL=C && comm -3 \
98 # <((sed -n 's/^ *\(-[^ 0-9][^ ]*\).*/\1/p' manywarnings.m4; \ 98 # <((sed -n 's/^ *\(-[^ 0-9][^ ]*\).*/\1/p' manywarnings.m4; \
99 # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \ 99 # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \
100 # <(LC_ALL=C gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort) 100 # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort)
101 101
102 $1= 102 $1=
103 for gl_manywarn_item in -fanalyzer -fstrict-flex-arrays \ 103 for gl_manywarn_item in -fanalyzer -fstrict-flex-arrays \
@@ -106,7 +106,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
106 -Wbad-function-cast \ 106 -Wbad-function-cast \
107 -Wcast-align=strict \ 107 -Wcast-align=strict \
108 -Wdate-time \ 108 -Wdate-time \
109 -Wdisabled-optimization \
110 -Wdouble-promotion \ 109 -Wdouble-promotion \
111 -Wduplicated-branches \ 110 -Wduplicated-branches \
112 -Wduplicated-cond \ 111 -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 @@
1# stddef_h.m4 1# stddef_h.m4
2# serial 19 2# serial 21
3dnl Copyright (C) 2009-2025 Free Software Foundation, Inc. 3dnl Copyright (C) 2009-2025 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
@@ -91,12 +91,14 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
91 fi 91 fi
92 92
93 dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870 93 dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870
94 dnl affects GCC 13 and 14. 94 dnl affects GCC 13.3 and 14.2.
95 AC_CACHE_CHECK([whether <stddef.h> is idempotent], 95 AC_CACHE_CHECK([whether <stddef.h> is idempotent],
96 [gl_cv_stddef_idempotent], 96 [gl_cv_stddef_idempotent],
97 [AC_COMPILE_IFELSE([AC_LANG_SOURCE( 97 [AC_COMPILE_IFELSE([AC_LANG_SOURCE(
98 [[ 98 [[
99 #if __GNUC__ == 13 || __GNUC__ == 14 99 #if \
100 ((__GNUC__ == 13 && __GNUC_MINOR__ <= 3) \
101 || (__GNUC__ == 14 && __GNUC_MINOR__ <= 2))
100 #error "bug 114870 is present" 102 #error "bug 114870 is present"
101 #endif 103 #endif
102 ]])], 104 ]])],