aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2020-02-23 01:24:21 -0800
committerPaul Eggert2020-02-23 01:27:19 -0800
commitb6be1ce644a07b6dc30eaa24dec082effd7add40 (patch)
tree02de8983f45751bf5da9b2f409758f2934306746 /lib
parentbce17355ac9f6a6f8ed778bd310f3baaea514270 (diff)
downloademacs-b6be1ce644a07b6dc30eaa24dec082effd7add40.tar.gz
emacs-b6be1ce644a07b6dc30eaa24dec082effd7add40.zip
Update from Gnulib
This incorporates: 2020-02-22 fchmodat, lchmod: simplify 2020-02-22 lchmod: fix link error on Solaris 10 2020-02-22 use 'restrict' in all POSIX function declarations 2020-02-22 chmodat, chownat: new modules * lib/gnulib.mk.in: Regenerate. * lib/inttypes.in.h, lib/openat.h, lib/signal.in.h: * lib/stdio.in.h, lib/stdlib.in.h, lib/string.in.h: * lib/sys_stat.in.h, lib/time.in.h, lib/unistd.in.h, m4/inttypes.m4: * m4/signal_h.m4, m4/stdio_h.m4, m4/stdlib_h.m4, m4/string_h.m4: * m4/sys_socket_h.m4, m4/sys_stat_h.m4, m4/time_h.m4: * m4/unistd_h.m4: Copy from Gnulib.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnulib.mk.in2
-rw-r--r--lib/inttypes.in.h24
-rw-r--r--lib/openat.h20
-rw-r--r--lib/signal.in.h24
-rw-r--r--lib/stdio.in.h270
-rw-r--r--lib/stdlib.in.h72
-rw-r--r--lib/string.in.h11
-rw-r--r--lib/sys_stat.in.h44
-rw-r--r--lib/time.in.h17
-rw-r--r--lib/unistd.in.h24
10 files changed, 310 insertions, 198 deletions
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 6775db00015..3c01e61b266 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -886,7 +886,6 @@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
886REPLACE_GMTIME = @REPLACE_GMTIME@ 886REPLACE_GMTIME = @REPLACE_GMTIME@
887REPLACE_INITSTATE = @REPLACE_INITSTATE@ 887REPLACE_INITSTATE = @REPLACE_INITSTATE@
888REPLACE_ISATTY = @REPLACE_ISATTY@ 888REPLACE_ISATTY = @REPLACE_ISATTY@
889REPLACE_LCHMOD = @REPLACE_LCHMOD@
890REPLACE_LCHOWN = @REPLACE_LCHOWN@ 889REPLACE_LCHOWN = @REPLACE_LCHOWN@
891REPLACE_LINK = @REPLACE_LINK@ 890REPLACE_LINK = @REPLACE_LINK@
892REPLACE_LINKAT = @REPLACE_LINKAT@ 891REPLACE_LINKAT = @REPLACE_LINKAT@
@@ -2941,7 +2940,6 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
2941 -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ 2940 -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
2942 -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ 2941 -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
2943 -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ 2942 -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
2944 -e 's|@''REPLACE_LCHMOD''@|$(REPLACE_LCHMOD)|g' \
2945 -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ 2943 -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
2946 -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ 2944 -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
2947 -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ 2945 -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h
index d6efc7eeeef..9f04a6ced4a 100644
--- a/lib/inttypes.in.h
+++ b/lib/inttypes.in.h
@@ -1093,15 +1093,19 @@ _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
1093# define strtoimax rpl_strtoimax 1093# define strtoimax rpl_strtoimax
1094# endif 1094# endif
1095_GL_FUNCDECL_RPL (strtoimax, intmax_t, 1095_GL_FUNCDECL_RPL (strtoimax, intmax_t,
1096 (const char *, char **, int) _GL_ARG_NONNULL ((1))); 1096 (const char *restrict, char **restrict, int)
1097_GL_CXXALIAS_RPL (strtoimax, intmax_t, (const char *, char **, int)); 1097 _GL_ARG_NONNULL ((1)));
1098_GL_CXXALIAS_RPL (strtoimax, intmax_t,
1099 (const char *restrict, char **restrict, int));
1098# else 1100# else
1099# if !@HAVE_DECL_STRTOIMAX@ 1101# if !@HAVE_DECL_STRTOIMAX@
1100# undef strtoimax 1102# undef strtoimax
1101_GL_FUNCDECL_SYS (strtoimax, intmax_t, 1103_GL_FUNCDECL_SYS (strtoimax, intmax_t,
1102 (const char *, char **, int) _GL_ARG_NONNULL ((1))); 1104 (const char *restrict, char **restrict, int)
1105 _GL_ARG_NONNULL ((1)));
1103# endif 1106# endif
1104_GL_CXXALIAS_SYS (strtoimax, intmax_t, (const char *, char **, int)); 1107_GL_CXXALIAS_SYS (strtoimax, intmax_t,
1108 (const char *restrict, char **restrict, int));
1105# endif 1109# endif
1106_GL_CXXALIASWARN (strtoimax); 1110_GL_CXXALIASWARN (strtoimax);
1107#elif defined GNULIB_POSIXCHECK 1111#elif defined GNULIB_POSIXCHECK
@@ -1119,15 +1123,19 @@ _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
1119# define strtoumax rpl_strtoumax 1123# define strtoumax rpl_strtoumax
1120# endif 1124# endif
1121_GL_FUNCDECL_RPL (strtoumax, uintmax_t, 1125_GL_FUNCDECL_RPL (strtoumax, uintmax_t,
1122 (const char *, char **, int) _GL_ARG_NONNULL ((1))); 1126 (const char *restrict, char **restrict, int)
1123_GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int)); 1127 _GL_ARG_NONNULL ((1)));
1128_GL_CXXALIAS_RPL (strtoumax, uintmax_t,
1129 (const char *restrict, char **restrict, int));
1124# else 1130# else
1125# if !@HAVE_DECL_STRTOUMAX@ 1131# if !@HAVE_DECL_STRTOUMAX@
1126# undef strtoumax 1132# undef strtoumax
1127_GL_FUNCDECL_SYS (strtoumax, uintmax_t, 1133_GL_FUNCDECL_SYS (strtoumax, uintmax_t,
1128 (const char *, char **, int) _GL_ARG_NONNULL ((1))); 1134 (const char *restrict, char **restrict, int)
1135 _GL_ARG_NONNULL ((1)));
1129# endif 1136# endif
1130_GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int)); 1137_GL_CXXALIAS_SYS (strtoumax, uintmax_t,
1138 (const char *restrict, char **restrict, int));
1131# endif 1139# endif
1132_GL_CXXALIASWARN (strtoumax); 1140_GL_CXXALIASWARN (strtoumax);
1133#elif defined GNULIB_POSIXCHECK 1141#elif defined GNULIB_POSIXCHECK
diff --git a/lib/openat.h b/lib/openat.h
index 7589150f34f..824ce560e34 100644
--- a/lib/openat.h
+++ b/lib/openat.h
@@ -52,19 +52,19 @@ _Noreturn void openat_save_fail (int);
52 slightly more readable than it would be with 52 slightly more readable than it would be with
53 fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW). */ 53 fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW). */
54 54
55#if GNULIB_FCHOWNAT 55#if GNULIB_CHOWNAT
56 56
57# ifndef FCHOWNAT_INLINE 57# ifndef CHOWNAT_INLINE
58# define FCHOWNAT_INLINE _GL_INLINE 58# define CHOWNAT_INLINE _GL_INLINE
59# endif 59# endif
60 60
61FCHOWNAT_INLINE int 61CHOWNAT_INLINE int
62chownat (int fd, char const *file, uid_t owner, gid_t group) 62chownat (int fd, char const *file, uid_t owner, gid_t group)
63{ 63{
64 return fchownat (fd, file, owner, group, 0); 64 return fchownat (fd, file, owner, group, 0);
65} 65}
66 66
67FCHOWNAT_INLINE int 67CHOWNAT_INLINE int
68lchownat (int fd, char const *file, uid_t owner, gid_t group) 68lchownat (int fd, char const *file, uid_t owner, gid_t group)
69{ 69{
70 return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW); 70 return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
@@ -72,19 +72,19 @@ lchownat (int fd, char const *file, uid_t owner, gid_t group)
72 72
73#endif 73#endif
74 74
75#if GNULIB_FCHMODAT 75#if GNULIB_CHMODAT
76 76
77# ifndef FCHMODAT_INLINE 77# ifndef CHMODAT_INLINE
78# define FCHMODAT_INLINE _GL_INLINE 78# define CHMODAT_INLINE _GL_INLINE
79# endif 79# endif
80 80
81FCHMODAT_INLINE int 81CHMODAT_INLINE int
82chmodat (int fd, char const *file, mode_t mode) 82chmodat (int fd, char const *file, mode_t mode)
83{ 83{
84 return fchmodat (fd, file, mode, 0); 84 return fchmodat (fd, file, mode, 0);
85} 85}
86 86
87FCHMODAT_INLINE int 87CHMODAT_INLINE int
88lchmodat (int fd, char const *file, mode_t mode) 88lchmodat (int fd, char const *file, mode_t mode)
89{ 89{
90 return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW); 90 return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
diff --git a/lib/signal.in.h b/lib/signal.in.h
index 9fe9f605c3a..c94b053d6af 100644
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -133,16 +133,24 @@ typedef void (*sighandler_t) (int);
133# define pthread_sigmask rpl_pthread_sigmask 133# define pthread_sigmask rpl_pthread_sigmask
134# endif 134# endif
135_GL_FUNCDECL_RPL (pthread_sigmask, int, 135_GL_FUNCDECL_RPL (pthread_sigmask, int,
136 (int how, const sigset_t *new_mask, sigset_t *old_mask)); 136 (int how,
137 const sigset_t *restrict new_mask,
138 sigset_t *restrict old_mask));
137_GL_CXXALIAS_RPL (pthread_sigmask, int, 139_GL_CXXALIAS_RPL (pthread_sigmask, int,
138 (int how, const sigset_t *new_mask, sigset_t *old_mask)); 140 (int how,
141 const sigset_t *restrict new_mask,
142 sigset_t *restrict old_mask));
139# else 143# else
140# if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask) 144# if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask)
141_GL_FUNCDECL_SYS (pthread_sigmask, int, 145_GL_FUNCDECL_SYS (pthread_sigmask, int,
142 (int how, const sigset_t *new_mask, sigset_t *old_mask)); 146 (int how,
147 const sigset_t *restrict new_mask,
148 sigset_t *restrict old_mask));
143# endif 149# endif
144_GL_CXXALIAS_SYS (pthread_sigmask, int, 150_GL_CXXALIAS_SYS (pthread_sigmask, int,
145 (int how, const sigset_t *new_mask, sigset_t *old_mask)); 151 (int how,
152 const sigset_t *restrict new_mask,
153 sigset_t *restrict old_mask));
146# endif 154# endif
147# if __GLIBC__ >= 2 155# if __GLIBC__ >= 2
148_GL_CXXALIASWARN (pthread_sigmask); 156_GL_CXXALIASWARN (pthread_sigmask);
@@ -295,10 +303,14 @@ _GL_CXXALIASWARN (sigpending);
295# define SIG_SETMASK 1 /* blocked_set = *set; */ 303# define SIG_SETMASK 1 /* blocked_set = *set; */
296# define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */ 304# define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */
297_GL_FUNCDECL_SYS (sigprocmask, int, 305_GL_FUNCDECL_SYS (sigprocmask, int,
298 (int operation, const sigset_t *set, sigset_t *old_set)); 306 (int operation,
307 const sigset_t *restrict set,
308 sigset_t *restrict old_set));
299# endif 309# endif
300_GL_CXXALIAS_SYS (sigprocmask, int, 310_GL_CXXALIAS_SYS (sigprocmask, int,
301 (int operation, const sigset_t *set, sigset_t *old_set)); 311 (int operation,
312 const sigset_t *restrict set,
313 sigset_t *restrict old_set));
302_GL_CXXALIASWARN (sigprocmask); 314_GL_CXXALIASWARN (sigprocmask);
303 315
304/* Install the handler FUNC for signal SIG, and return the previous 316/* Install the handler FUNC for signal SIG, and return the previous
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index ebcbfaf5e77..4a95f323a9a 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -171,17 +171,17 @@
171# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 171# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
172# define dprintf rpl_dprintf 172# define dprintf rpl_dprintf
173# endif 173# endif
174_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...) 174_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...)
175 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) 175 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
176 _GL_ARG_NONNULL ((2))); 176 _GL_ARG_NONNULL ((2)));
177_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...)); 177_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...));
178# else 178# else
179# if !@HAVE_DPRINTF@ 179# if !@HAVE_DPRINTF@
180_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...) 180_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...)
181 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) 181 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
182 _GL_ARG_NONNULL ((2))); 182 _GL_ARG_NONNULL ((2)));
183# endif 183# endif
184_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...)); 184_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...));
185# endif 185# endif
186_GL_CXXALIASWARN (dprintf); 186_GL_CXXALIASWARN (dprintf);
187#elif defined GNULIB_POSIXCHECK 187#elif defined GNULIB_POSIXCHECK
@@ -281,11 +281,14 @@ _GL_CXXALIASWARN (fgetc);
281# undef fgets 281# undef fgets
282# define fgets rpl_fgets 282# define fgets rpl_fgets
283# endif 283# endif
284_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream) 284_GL_FUNCDECL_RPL (fgets, char *,
285 _GL_ARG_NONNULL ((1, 3))); 285 (char *restrict s, int n, FILE *restrict stream)
286_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream)); 286 _GL_ARG_NONNULL ((1, 3)));
287_GL_CXXALIAS_RPL (fgets, char *,
288 (char *restrict s, int n, FILE *restrict stream));
287# else 289# else
288_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream)); 290_GL_CXXALIAS_SYS (fgets, char *,
291 (char *restrict s, int n, FILE *restrict stream));
289# endif 292# endif
290# if __GLIBC__ >= 2 293# if __GLIBC__ >= 2
291_GL_CXXALIASWARN (fgets); 294_GL_CXXALIASWARN (fgets);
@@ -298,11 +301,14 @@ _GL_CXXALIASWARN (fgets);
298# undef fopen 301# undef fopen
299# define fopen rpl_fopen 302# define fopen rpl_fopen
300# endif 303# endif
301_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode) 304_GL_FUNCDECL_RPL (fopen, FILE *,
302 _GL_ARG_NONNULL ((1, 2))); 305 (const char *restrict filename, const char *restrict mode)
303_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode)); 306 _GL_ARG_NONNULL ((1, 2)));
307_GL_CXXALIAS_RPL (fopen, FILE *,
308 (const char *restrict filename, const char *restrict mode));
304# else 309# else
305_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode)); 310_GL_CXXALIAS_SYS (fopen, FILE *,
311 (const char *restrict filename, const char *restrict mode));
306# endif 312# endif
307# if __GLIBC__ >= 2 313# if __GLIBC__ >= 2
308_GL_CXXALIASWARN (fopen); 314_GL_CXXALIASWARN (fopen);
@@ -322,17 +328,21 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX complian
322# endif 328# endif
323# define GNULIB_overrides_fprintf 1 329# define GNULIB_overrides_fprintf 1
324# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ 330# if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
325_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...) 331_GL_FUNCDECL_RPL (fprintf, int,
326 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) 332 (FILE *restrict fp, const char *restrict format, ...)
327 _GL_ARG_NONNULL ((1, 2))); 333 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
334 _GL_ARG_NONNULL ((1, 2)));
328# else 335# else
329_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...) 336_GL_FUNCDECL_RPL (fprintf, int,
330 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3) 337 (FILE *restrict fp, const char *restrict format, ...)
331 _GL_ARG_NONNULL ((1, 2))); 338 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
339 _GL_ARG_NONNULL ((1, 2)));
332# endif 340# endif
333_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...)); 341_GL_CXXALIAS_RPL (fprintf, int,
342 (FILE *restrict fp, const char *restrict format, ...));
334# else 343# else
335_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...)); 344_GL_CXXALIAS_SYS (fprintf, int,
345 (FILE *restrict fp, const char *restrict format, ...));
336# endif 346# endif
337# if __GLIBC__ >= 2 347# if __GLIBC__ >= 2
338_GL_CXXALIASWARN (fprintf); 348_GL_CXXALIASWARN (fprintf);
@@ -398,11 +408,14 @@ _GL_CXXALIASWARN (fputc);
398# undef fputs 408# undef fputs
399# define fputs rpl_fputs 409# define fputs rpl_fputs
400# endif 410# endif
401_GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream) 411_GL_FUNCDECL_RPL (fputs, int,
402 _GL_ARG_NONNULL ((1, 2))); 412 (const char *restrict string, FILE *restrict stream)
403_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream)); 413 _GL_ARG_NONNULL ((1, 2)));
414_GL_CXXALIAS_RPL (fputs, int,
415 (const char *restrict string, FILE *restrict stream));
404# else 416# else
405_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream)); 417_GL_CXXALIAS_SYS (fputs, int,
418 (const char *restrict string, FILE *restrict stream));
406# endif 419# endif
407# if __GLIBC__ >= 2 420# if __GLIBC__ >= 2
408_GL_CXXALIASWARN (fputs); 421_GL_CXXALIASWARN (fputs);
@@ -415,11 +428,17 @@ _GL_CXXALIASWARN (fputs);
415# undef fread 428# undef fread
416# define fread rpl_fread 429# define fread rpl_fread
417# endif 430# endif
418_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream) 431_GL_FUNCDECL_RPL (fread, size_t,
419 _GL_ARG_NONNULL ((4))); 432 (void *restrict ptr, size_t s, size_t n,
420_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)); 433 FILE *restrict stream)
434 _GL_ARG_NONNULL ((4)));
435_GL_CXXALIAS_RPL (fread, size_t,
436 (void *restrict ptr, size_t s, size_t n,
437 FILE *restrict stream));
421# else 438# else
422_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)); 439_GL_CXXALIAS_SYS (fread, size_t,
440 (void *restrict ptr, size_t s, size_t n,
441 FILE *restrict stream));
423# endif 442# endif
424# if __GLIBC__ >= 2 443# if __GLIBC__ >= 2
425_GL_CXXALIASWARN (fread); 444_GL_CXXALIASWARN (fread);
@@ -433,13 +452,16 @@ _GL_CXXALIASWARN (fread);
433# define freopen rpl_freopen 452# define freopen rpl_freopen
434# endif 453# endif
435_GL_FUNCDECL_RPL (freopen, FILE *, 454_GL_FUNCDECL_RPL (freopen, FILE *,
436 (const char *filename, const char *mode, FILE *stream) 455 (const char *restrict filename, const char *restrict mode,
456 FILE *restrict stream)
437 _GL_ARG_NONNULL ((2, 3))); 457 _GL_ARG_NONNULL ((2, 3)));
438_GL_CXXALIAS_RPL (freopen, FILE *, 458_GL_CXXALIAS_RPL (freopen, FILE *,
439 (const char *filename, const char *mode, FILE *stream)); 459 (const char *restrict filename, const char *restrict mode,
460 FILE *restrict stream));
440# else 461# else
441_GL_CXXALIAS_SYS (freopen, FILE *, 462_GL_CXXALIAS_SYS (freopen, FILE *,
442 (const char *filename, const char *mode, FILE *stream)); 463 (const char *restrict filename, const char *restrict mode,
464 FILE *restrict stream));
443# endif 465# endif
444# if __GLIBC__ >= 2 466# if __GLIBC__ >= 2
445_GL_CXXALIASWARN (freopen); 467_GL_CXXALIASWARN (freopen);
@@ -458,12 +480,15 @@ _GL_WARN_ON_USE (freopen,
458# undef fscanf 480# undef fscanf
459# define fscanf rpl_fscanf 481# define fscanf rpl_fscanf
460# endif 482# endif
461_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...) 483_GL_FUNCDECL_RPL (fscanf, int,
462 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3) 484 (FILE *restrict stream, const char *restrict format, ...)
463 _GL_ARG_NONNULL ((1, 2))); 485 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
464_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...)); 486 _GL_ARG_NONNULL ((1, 2)));
487_GL_CXXALIAS_RPL (fscanf, int,
488 (FILE *restrict stream, const char *restrict format, ...));
465# else 489# else
466_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...)); 490_GL_CXXALIAS_SYS (fscanf, int,
491 (FILE *restrict stream, const char *restrict format, ...));
467# endif 492# endif
468# if __GLIBC__ >= 2 493# if __GLIBC__ >= 2
469_GL_CXXALIASWARN (fscanf); 494_GL_CXXALIASWARN (fscanf);
@@ -634,13 +659,16 @@ _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
634# define fwrite rpl_fwrite 659# define fwrite rpl_fwrite
635# endif 660# endif
636_GL_FUNCDECL_RPL (fwrite, size_t, 661_GL_FUNCDECL_RPL (fwrite, size_t,
637 (const void *ptr, size_t s, size_t n, FILE *stream) 662 (const void *restrict ptr, size_t s, size_t n,
663 FILE *restrict stream)
638 _GL_ARG_NONNULL ((1, 4))); 664 _GL_ARG_NONNULL ((1, 4)));
639_GL_CXXALIAS_RPL (fwrite, size_t, 665_GL_CXXALIAS_RPL (fwrite, size_t,
640 (const void *ptr, size_t s, size_t n, FILE *stream)); 666 (const void *restrict ptr, size_t s, size_t n,
667 FILE *restrict stream));
641# else 668# else
642_GL_CXXALIAS_SYS (fwrite, size_t, 669_GL_CXXALIAS_SYS (fwrite, size_t,
643 (const void *ptr, size_t s, size_t n, FILE *stream)); 670 (const void *restrict ptr, size_t s, size_t n,
671 FILE *restrict stream));
644 672
645/* Work around bug 11959 when fortifying glibc 2.4 through 2.15 673/* Work around bug 11959 when fortifying glibc 2.4 through 2.15
646 <https://sourceware.org/bugzilla/show_bug.cgi?id=11959>, 674 <https://sourceware.org/bugzilla/show_bug.cgi?id=11959>,
@@ -715,22 +743,26 @@ _GL_CXXALIASWARN (getchar);
715# define getdelim rpl_getdelim 743# define getdelim rpl_getdelim
716# endif 744# endif
717_GL_FUNCDECL_RPL (getdelim, ssize_t, 745_GL_FUNCDECL_RPL (getdelim, ssize_t,
718 (char **lineptr, size_t *linesize, int delimiter, 746 (char **restrict lineptr, size_t *restrict linesize,
719 FILE *stream) 747 int delimiter,
748 FILE *restrict stream)
720 _GL_ARG_NONNULL ((1, 2, 4))); 749 _GL_ARG_NONNULL ((1, 2, 4)));
721_GL_CXXALIAS_RPL (getdelim, ssize_t, 750_GL_CXXALIAS_RPL (getdelim, ssize_t,
722 (char **lineptr, size_t *linesize, int delimiter, 751 (char **restrict lineptr, size_t *restrict linesize,
723 FILE *stream)); 752 int delimiter,
753 FILE *restrict stream));
724# else 754# else
725# if !@HAVE_DECL_GETDELIM@ 755# if !@HAVE_DECL_GETDELIM@
726_GL_FUNCDECL_SYS (getdelim, ssize_t, 756_GL_FUNCDECL_SYS (getdelim, ssize_t,
727 (char **lineptr, size_t *linesize, int delimiter, 757 (char **restrict lineptr, size_t *restrict linesize,
728 FILE *stream) 758 int delimiter,
759 FILE *restrict stream)
729 _GL_ARG_NONNULL ((1, 2, 4))); 760 _GL_ARG_NONNULL ((1, 2, 4)));
730# endif 761# endif
731_GL_CXXALIAS_SYS (getdelim, ssize_t, 762_GL_CXXALIAS_SYS (getdelim, ssize_t,
732 (char **lineptr, size_t *linesize, int delimiter, 763 (char **restrict lineptr, size_t *restrict linesize,
733 FILE *stream)); 764 int delimiter,
765 FILE *restrict stream));
734# endif 766# endif
735_GL_CXXALIASWARN (getdelim); 767_GL_CXXALIASWARN (getdelim);
736#elif defined GNULIB_POSIXCHECK 768#elif defined GNULIB_POSIXCHECK
@@ -754,18 +786,22 @@ _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
754# define getline rpl_getline 786# define getline rpl_getline
755# endif 787# endif
756_GL_FUNCDECL_RPL (getline, ssize_t, 788_GL_FUNCDECL_RPL (getline, ssize_t,
757 (char **lineptr, size_t *linesize, FILE *stream) 789 (char **restrict lineptr, size_t *restrict linesize,
790 FILE *restrict stream)
758 _GL_ARG_NONNULL ((1, 2, 3))); 791 _GL_ARG_NONNULL ((1, 2, 3)));
759_GL_CXXALIAS_RPL (getline, ssize_t, 792_GL_CXXALIAS_RPL (getline, ssize_t,
760 (char **lineptr, size_t *linesize, FILE *stream)); 793 (char **restrict lineptr, size_t *restrict linesize,
794 FILE *restrict stream));
761# else 795# else
762# if !@HAVE_DECL_GETLINE@ 796# if !@HAVE_DECL_GETLINE@
763_GL_FUNCDECL_SYS (getline, ssize_t, 797_GL_FUNCDECL_SYS (getline, ssize_t,
764 (char **lineptr, size_t *linesize, FILE *stream) 798 (char **restrict lineptr, size_t *restrict linesize,
799 FILE *restrict stream)
765 _GL_ARG_NONNULL ((1, 2, 3))); 800 _GL_ARG_NONNULL ((1, 2, 3)));
766# endif 801# endif
767_GL_CXXALIAS_SYS (getline, ssize_t, 802_GL_CXXALIAS_SYS (getline, ssize_t,
768 (char **lineptr, size_t *linesize, FILE *stream)); 803 (char **restrict lineptr, size_t *restrict linesize,
804 FILE *restrict stream));
769# endif 805# endif
770# if @HAVE_DECL_GETLINE@ 806# if @HAVE_DECL_GETLINE@
771_GL_CXXALIASWARN (getline); 807_GL_CXXALIASWARN (getline);
@@ -909,14 +945,14 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
909# endif 945# endif
910# if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ 946# if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
911_GL_FUNCDECL_RPL_1 (__printf__, int, 947_GL_FUNCDECL_RPL_1 (__printf__, int,
912 (const char *format, ...) 948 (const char *restrict format, ...)
913 __asm__ (@ASM_SYMBOL_PREFIX@ 949 __asm__ (@ASM_SYMBOL_PREFIX@
914 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)) 950 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
915 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2) 951 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
916 _GL_ARG_NONNULL ((1))); 952 _GL_ARG_NONNULL ((1)));
917# else 953# else
918_GL_FUNCDECL_RPL_1 (__printf__, int, 954_GL_FUNCDECL_RPL_1 (__printf__, int,
919 (const char *format, ...) 955 (const char *restrict format, ...)
920 __asm__ (@ASM_SYMBOL_PREFIX@ 956 __asm__ (@ASM_SYMBOL_PREFIX@
921 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)) 957 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
922 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2) 958 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
@@ -928,14 +964,14 @@ _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
928# define printf rpl_printf 964# define printf rpl_printf
929# endif 965# endif
930_GL_FUNCDECL_RPL (printf, int, 966_GL_FUNCDECL_RPL (printf, int,
931 (const char *format, ...) 967 (const char *restrict format, ...)
932 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2) 968 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
933 _GL_ARG_NONNULL ((1))); 969 _GL_ARG_NONNULL ((1)));
934_GL_CXXALIAS_RPL (printf, int, (const char *format, ...)); 970_GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...));
935# endif 971# endif
936# define GNULIB_overrides_printf 1 972# define GNULIB_overrides_printf 1
937# else 973# else
938_GL_CXXALIAS_SYS (printf, int, (const char *format, ...)); 974_GL_CXXALIAS_SYS (printf, int, (const char *restrict format, ...));
939# endif 975# endif
940# if __GLIBC__ >= 2 976# if __GLIBC__ >= 2
941_GL_CXXALIASWARN (printf); 977_GL_CXXALIASWARN (printf);
@@ -1083,24 +1119,24 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
1083# define scanf __scanf__ 1119# define scanf __scanf__
1084# endif 1120# endif
1085_GL_FUNCDECL_RPL_1 (__scanf__, int, 1121_GL_FUNCDECL_RPL_1 (__scanf__, int,
1086 (const char *format, ...) 1122 (const char *restrict format, ...)
1087 __asm__ (@ASM_SYMBOL_PREFIX@ 1123 __asm__ (@ASM_SYMBOL_PREFIX@
1088 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf)) 1124 _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
1089 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2) 1125 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1090 _GL_ARG_NONNULL ((1))); 1126 _GL_ARG_NONNULL ((1)));
1091_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...)); 1127_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *restrict format, ...));
1092# else 1128# else
1093# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1129# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1094# undef scanf 1130# undef scanf
1095# define scanf rpl_scanf 1131# define scanf rpl_scanf
1096# endif 1132# endif
1097_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...) 1133_GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...)
1098 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2) 1134 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
1099 _GL_ARG_NONNULL ((1))); 1135 _GL_ARG_NONNULL ((1)));
1100_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...)); 1136_GL_CXXALIAS_RPL (scanf, int, (const char *restrict format, ...));
1101# endif 1137# endif
1102# else 1138# else
1103_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...)); 1139_GL_CXXALIAS_SYS (scanf, int, (const char *restrict format, ...));
1104# endif 1140# endif
1105# if __GLIBC__ >= 2 1141# if __GLIBC__ >= 2
1106_GL_CXXALIASWARN (scanf); 1142_GL_CXXALIASWARN (scanf);
@@ -1113,20 +1149,24 @@ _GL_CXXALIASWARN (scanf);
1113# define snprintf rpl_snprintf 1149# define snprintf rpl_snprintf
1114# endif 1150# endif
1115_GL_FUNCDECL_RPL (snprintf, int, 1151_GL_FUNCDECL_RPL (snprintf, int,
1116 (char *str, size_t size, const char *format, ...) 1152 (char *restrict str, size_t size,
1153 const char *restrict format, ...)
1117 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) 1154 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
1118 _GL_ARG_NONNULL ((3))); 1155 _GL_ARG_NONNULL ((3)));
1119_GL_CXXALIAS_RPL (snprintf, int, 1156_GL_CXXALIAS_RPL (snprintf, int,
1120 (char *str, size_t size, const char *format, ...)); 1157 (char *restrict str, size_t size,
1158 const char *restrict format, ...));
1121# else 1159# else
1122# if !@HAVE_DECL_SNPRINTF@ 1160# if !@HAVE_DECL_SNPRINTF@
1123_GL_FUNCDECL_SYS (snprintf, int, 1161_GL_FUNCDECL_SYS (snprintf, int,
1124 (char *str, size_t size, const char *format, ...) 1162 (char *restrict str, size_t size,
1163 const char *restrict format, ...)
1125 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) 1164 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
1126 _GL_ARG_NONNULL ((3))); 1165 _GL_ARG_NONNULL ((3)));
1127# endif 1166# endif
1128_GL_CXXALIAS_SYS (snprintf, int, 1167_GL_CXXALIAS_SYS (snprintf, int,
1129 (char *str, size_t size, const char *format, ...)); 1168 (char *restrict str, size_t size,
1169 const char *restrict format, ...));
1130# endif 1170# endif
1131_GL_CXXALIASWARN (snprintf); 1171_GL_CXXALIASWARN (snprintf);
1132#elif defined GNULIB_POSIXCHECK 1172#elif defined GNULIB_POSIXCHECK
@@ -1151,12 +1191,15 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
1151# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1191# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1152# define sprintf rpl_sprintf 1192# define sprintf rpl_sprintf
1153# endif 1193# endif
1154_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...) 1194_GL_FUNCDECL_RPL (sprintf, int,
1155 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) 1195 (char *restrict str, const char *restrict format, ...)
1156 _GL_ARG_NONNULL ((1, 2))); 1196 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
1157_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...)); 1197 _GL_ARG_NONNULL ((1, 2)));
1198_GL_CXXALIAS_RPL (sprintf, int,
1199 (char *restrict str, const char *restrict format, ...));
1158# else 1200# else
1159_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...)); 1201_GL_CXXALIAS_SYS (sprintf, int,
1202 (char *restrict str, const char *restrict format, ...));
1160# endif 1203# endif
1161# if __GLIBC__ >= 2 1204# if __GLIBC__ >= 2
1162_GL_CXXALIASWARN (sprintf); 1205_GL_CXXALIASWARN (sprintf);
@@ -1244,20 +1287,23 @@ _GL_CXXALIASWARN (vasprintf);
1244# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1287# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1245# define vdprintf rpl_vdprintf 1288# define vdprintf rpl_vdprintf
1246# endif 1289# endif
1247_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args) 1290_GL_FUNCDECL_RPL (vdprintf, int,
1248 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) 1291 (int fd, const char *restrict format, va_list args)
1249 _GL_ARG_NONNULL ((2))); 1292 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1250_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args)); 1293 _GL_ARG_NONNULL ((2)));
1294_GL_CXXALIAS_RPL (vdprintf, int,
1295 (int fd, const char *restrict format, va_list args));
1251# else 1296# else
1252# if !@HAVE_VDPRINTF@ 1297# if !@HAVE_VDPRINTF@
1253_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args) 1298_GL_FUNCDECL_SYS (vdprintf, int,
1254 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) 1299 (int fd, const char *restrict format, va_list args)
1255 _GL_ARG_NONNULL ((2))); 1300 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1301 _GL_ARG_NONNULL ((2)));
1256# endif 1302# endif
1257/* Need to cast, because on Solaris, the third parameter will likely be 1303/* Need to cast, because on Solaris, the third parameter will likely be
1258 __va_list args. */ 1304 __va_list args. */
1259_GL_CXXALIAS_SYS_CAST (vdprintf, int, 1305_GL_CXXALIAS_SYS_CAST (vdprintf, int,
1260 (int fd, const char *format, va_list args)); 1306 (int fd, const char *restrict format, va_list args));
1261# endif 1307# endif
1262# if __GLIBC__ >= 2 1308# if __GLIBC__ >= 2
1263_GL_CXXALIASWARN (vdprintf); 1309_GL_CXXALIASWARN (vdprintf);
@@ -1278,21 +1324,28 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
1278# endif 1324# endif
1279# define GNULIB_overrides_vfprintf 1 1325# define GNULIB_overrides_vfprintf 1
1280# if @GNULIB_VFPRINTF_POSIX@ 1326# if @GNULIB_VFPRINTF_POSIX@
1281_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args) 1327_GL_FUNCDECL_RPL (vfprintf, int,
1282 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) 1328 (FILE *restrict fp,
1283 _GL_ARG_NONNULL ((1, 2))); 1329 const char *restrict format, va_list args)
1330 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1331 _GL_ARG_NONNULL ((1, 2)));
1284# else 1332# else
1285_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args) 1333_GL_FUNCDECL_RPL (vfprintf, int,
1286 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0) 1334 (FILE *restrict fp,
1287 _GL_ARG_NONNULL ((1, 2))); 1335 const char *restrict format, va_list args)
1336 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
1337 _GL_ARG_NONNULL ((1, 2)));
1288# endif 1338# endif
1289_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)); 1339_GL_CXXALIAS_RPL (vfprintf, int,
1340 (FILE *restrict fp,
1341 const char *restrict format, va_list args));
1290# else 1342# else
1291/* Need to cast, because on Solaris, the third parameter is 1343/* Need to cast, because on Solaris, the third parameter is
1292 __va_list args 1344 __va_list args
1293 and GCC's fixincludes did not change this to __gnuc_va_list. */ 1345 and GCC's fixincludes did not change this to __gnuc_va_list. */
1294_GL_CXXALIAS_SYS_CAST (vfprintf, int, 1346_GL_CXXALIAS_SYS_CAST (vfprintf, int,
1295 (FILE *fp, const char *format, va_list args)); 1347 (FILE *restrict fp,
1348 const char *restrict format, va_list args));
1296# endif 1349# endif
1297# if __GLIBC__ >= 2 1350# if __GLIBC__ >= 2
1298_GL_CXXALIASWARN (vfprintf); 1351_GL_CXXALIASWARN (vfprintf);
@@ -1315,14 +1368,17 @@ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
1315# define vfscanf rpl_vfscanf 1368# define vfscanf rpl_vfscanf
1316# endif 1369# endif
1317_GL_FUNCDECL_RPL (vfscanf, int, 1370_GL_FUNCDECL_RPL (vfscanf, int,
1318 (FILE *stream, const char *format, va_list args) 1371 (FILE *restrict stream,
1372 const char *restrict format, va_list args)
1319 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0) 1373 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
1320 _GL_ARG_NONNULL ((1, 2))); 1374 _GL_ARG_NONNULL ((1, 2)));
1321_GL_CXXALIAS_RPL (vfscanf, int, 1375_GL_CXXALIAS_RPL (vfscanf, int,
1322 (FILE *stream, const char *format, va_list args)); 1376 (FILE *restrict stream,
1377 const char *restrict format, va_list args));
1323# else 1378# else
1324_GL_CXXALIAS_SYS (vfscanf, int, 1379_GL_CXXALIAS_SYS (vfscanf, int,
1325 (FILE *stream, const char *format, va_list args)); 1380 (FILE *restrict stream,
1381 const char *restrict format, va_list args));
1326# endif 1382# endif
1327_GL_CXXALIASWARN (vfscanf); 1383_GL_CXXALIASWARN (vfscanf);
1328#endif 1384#endif
@@ -1335,20 +1391,21 @@ _GL_CXXALIASWARN (vfscanf);
1335# endif 1391# endif
1336# define GNULIB_overrides_vprintf 1 1392# define GNULIB_overrides_vprintf 1
1337# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ 1393# if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
1338_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args) 1394_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
1339 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0) 1395 _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
1340 _GL_ARG_NONNULL ((1))); 1396 _GL_ARG_NONNULL ((1)));
1341# else 1397# else
1342_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args) 1398_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
1343 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0) 1399 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
1344 _GL_ARG_NONNULL ((1))); 1400 _GL_ARG_NONNULL ((1)));
1345# endif 1401# endif
1346_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args)); 1402_GL_CXXALIAS_RPL (vprintf, int, (const char *restrict format, va_list args));
1347# else 1403# else
1348/* Need to cast, because on Solaris, the second parameter is 1404/* Need to cast, because on Solaris, the second parameter is
1349 __va_list args 1405 __va_list args
1350 and GCC's fixincludes did not change this to __gnuc_va_list. */ 1406 and GCC's fixincludes did not change this to __gnuc_va_list. */
1351_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args)); 1407_GL_CXXALIAS_SYS_CAST (vprintf, int,
1408 (const char *restrict format, va_list args));
1352# endif 1409# endif
1353# if __GLIBC__ >= 2 1410# if __GLIBC__ >= 2
1354_GL_CXXALIASWARN (vprintf); 1411_GL_CXXALIASWARN (vprintf);
@@ -1370,12 +1427,12 @@ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
1370# undef vscanf 1427# undef vscanf
1371# define vscanf rpl_vscanf 1428# define vscanf rpl_vscanf
1372# endif 1429# endif
1373_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args) 1430_GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args)
1374 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0) 1431 _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
1375 _GL_ARG_NONNULL ((1))); 1432 _GL_ARG_NONNULL ((1)));
1376_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args)); 1433_GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args));
1377# else 1434# else
1378_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args)); 1435_GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args));
1379# endif 1436# endif
1380_GL_CXXALIASWARN (vscanf); 1437_GL_CXXALIASWARN (vscanf);
1381#endif 1438#endif
@@ -1386,20 +1443,24 @@ _GL_CXXALIASWARN (vscanf);
1386# define vsnprintf rpl_vsnprintf 1443# define vsnprintf rpl_vsnprintf
1387# endif 1444# endif
1388_GL_FUNCDECL_RPL (vsnprintf, int, 1445_GL_FUNCDECL_RPL (vsnprintf, int,
1389 (char *str, size_t size, const char *format, va_list args) 1446 (char *restrict str, size_t size,
1447 const char *restrict format, va_list args)
1390 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) 1448 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1391 _GL_ARG_NONNULL ((3))); 1449 _GL_ARG_NONNULL ((3)));
1392_GL_CXXALIAS_RPL (vsnprintf, int, 1450_GL_CXXALIAS_RPL (vsnprintf, int,
1393 (char *str, size_t size, const char *format, va_list args)); 1451 (char *restrict str, size_t size,
1452 const char *restrict format, va_list args));
1394# else 1453# else
1395# if !@HAVE_DECL_VSNPRINTF@ 1454# if !@HAVE_DECL_VSNPRINTF@
1396_GL_FUNCDECL_SYS (vsnprintf, int, 1455_GL_FUNCDECL_SYS (vsnprintf, int,
1397 (char *str, size_t size, const char *format, va_list args) 1456 (char *restrict str, size_t size,
1457 const char *restrict format, va_list args)
1398 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) 1458 _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1399 _GL_ARG_NONNULL ((3))); 1459 _GL_ARG_NONNULL ((3)));
1400# endif 1460# endif
1401_GL_CXXALIAS_SYS (vsnprintf, int, 1461_GL_CXXALIAS_SYS (vsnprintf, int,
1402 (char *str, size_t size, const char *format, va_list args)); 1462 (char *restrict str, size_t size,
1463 const char *restrict format, va_list args));
1403# endif 1464# endif
1404_GL_CXXALIASWARN (vsnprintf); 1465_GL_CXXALIASWARN (vsnprintf);
1405#elif defined GNULIB_POSIXCHECK 1466#elif defined GNULIB_POSIXCHECK
@@ -1416,17 +1477,20 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
1416# define vsprintf rpl_vsprintf 1477# define vsprintf rpl_vsprintf
1417# endif 1478# endif
1418_GL_FUNCDECL_RPL (vsprintf, int, 1479_GL_FUNCDECL_RPL (vsprintf, int,
1419 (char *str, const char *format, va_list args) 1480 (char *restrict str,
1481 const char *restrict format, va_list args)
1420 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) 1482 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1421 _GL_ARG_NONNULL ((1, 2))); 1483 _GL_ARG_NONNULL ((1, 2)));
1422_GL_CXXALIAS_RPL (vsprintf, int, 1484_GL_CXXALIAS_RPL (vsprintf, int,
1423 (char *str, const char *format, va_list args)); 1485 (char *restrict str,
1486 const char *restrict format, va_list args));
1424# else 1487# else
1425/* Need to cast, because on Solaris, the third parameter is 1488/* Need to cast, because on Solaris, the third parameter is
1426 __va_list args 1489 __va_list args
1427 and GCC's fixincludes did not change this to __gnuc_va_list. */ 1490 and GCC's fixincludes did not change this to __gnuc_va_list. */
1428_GL_CXXALIAS_SYS_CAST (vsprintf, int, 1491_GL_CXXALIAS_SYS_CAST (vsprintf, int,
1429 (char *str, const char *format, va_list args)); 1492 (char *restrict str,
1493 const char *restrict format, va_list args));
1430# endif 1494# endif
1431# if __GLIBC__ >= 2 1495# if __GLIBC__ >= 2
1432_GL_CXXALIASWARN (vsprintf); 1496_GL_CXXALIASWARN (vsprintf);
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 49bbf6fccfb..ec5f124a366 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -311,13 +311,17 @@ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
311# undef mbtowc 311# undef mbtowc
312# define mbtowc rpl_mbtowc 312# define mbtowc rpl_mbtowc
313# endif 313# endif
314_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); 314_GL_FUNCDECL_RPL (mbtowc, int,
315_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); 315 (wchar_t *restrict pwc, const char *restrict s, size_t n));
316_GL_CXXALIAS_RPL (mbtowc, int,
317 (wchar_t *restrict pwc, const char *restrict s, size_t n));
316# else 318# else
317# if !@HAVE_MBTOWC@ 319# if !@HAVE_MBTOWC@
318_GL_FUNCDECL_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); 320_GL_FUNCDECL_SYS (mbtowc, int,
321 (wchar_t *restrict pwc, const char *restrict s, size_t n));
319# endif 322# endif
320_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n)); 323_GL_CXXALIAS_SYS (mbtowc, int,
324 (wchar_t *restrict pwc, const char *restrict s, size_t n));
321# endif 325# endif
322# if __GLIBC__ >= 2 326# if __GLIBC__ >= 2
323_GL_CXXALIASWARN (mbtowc); 327_GL_CXXALIASWARN (mbtowc);
@@ -866,15 +870,19 @@ _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
866# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 870# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
867# define realpath rpl_realpath 871# define realpath rpl_realpath
868# endif 872# endif
869_GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved) 873_GL_FUNCDECL_RPL (realpath, char *,
870 _GL_ARG_NONNULL ((1))); 874 (const char *restrict name, char *restrict resolved)
871_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved)); 875 _GL_ARG_NONNULL ((1)));
876_GL_CXXALIAS_RPL (realpath, char *,
877 (const char *restrict name, char *restrict resolved));
872# else 878# else
873# if !@HAVE_REALPATH@ 879# if !@HAVE_REALPATH@
874_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved) 880_GL_FUNCDECL_SYS (realpath, char *,
875 _GL_ARG_NONNULL ((1))); 881 (const char *restrict name, char *restrict resolved)
882 _GL_ARG_NONNULL ((1)));
876# endif 883# endif
877_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved)); 884_GL_CXXALIAS_SYS (realpath, char *,
885 (const char *restrict name, char *restrict resolved));
878# endif 886# endif
879_GL_CXXALIASWARN (realpath); 887_GL_CXXALIASWARN (realpath);
880#elif defined GNULIB_POSIXCHECK 888#elif defined GNULIB_POSIXCHECK
@@ -957,15 +965,19 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
957# define strtod rpl_strtod 965# define strtod rpl_strtod
958# endif 966# endif
959# define GNULIB_defined_strtod_function 1 967# define GNULIB_defined_strtod_function 1
960_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) 968_GL_FUNCDECL_RPL (strtod, double,
961 _GL_ARG_NONNULL ((1))); 969 (const char *restrict str, char **restrict endp)
962_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); 970 _GL_ARG_NONNULL ((1)));
971_GL_CXXALIAS_RPL (strtod, double,
972 (const char *restrict str, char **restrict endp));
963# else 973# else
964# if !@HAVE_STRTOD@ 974# if !@HAVE_STRTOD@
965_GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp) 975_GL_FUNCDECL_SYS (strtod, double,
966 _GL_ARG_NONNULL ((1))); 976 (const char *restrict str, char **restrict endp)
977 _GL_ARG_NONNULL ((1)));
967# endif 978# endif
968_GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp)); 979_GL_CXXALIAS_SYS (strtod, double,
980 (const char *restrict str, char **restrict endp));
969# endif 981# endif
970# if __GLIBC__ >= 2 982# if __GLIBC__ >= 2
971_GL_CXXALIASWARN (strtod); 983_GL_CXXALIASWARN (strtod);
@@ -985,15 +997,19 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
985# define strtold rpl_strtold 997# define strtold rpl_strtold
986# endif 998# endif
987# define GNULIB_defined_strtold_function 1 999# define GNULIB_defined_strtold_function 1
988_GL_FUNCDECL_RPL (strtold, long double, (const char *str, char **endp) 1000_GL_FUNCDECL_RPL (strtold, long double,
989 _GL_ARG_NONNULL ((1))); 1001 (const char *restrict str, char **restrict endp)
990_GL_CXXALIAS_RPL (strtold, long double, (const char *str, char **endp)); 1002 _GL_ARG_NONNULL ((1)));
1003_GL_CXXALIAS_RPL (strtold, long double,
1004 (const char *restrict str, char **restrict endp));
991# else 1005# else
992# if !@HAVE_STRTOLD@ 1006# if !@HAVE_STRTOLD@
993_GL_FUNCDECL_SYS (strtold, long double, (const char *str, char **endp) 1007_GL_FUNCDECL_SYS (strtold, long double,
994 _GL_ARG_NONNULL ((1))); 1008 (const char *restrict str, char **restrict endp)
1009 _GL_ARG_NONNULL ((1)));
995# endif 1010# endif
996_GL_CXXALIAS_SYS (strtold, long double, (const char *str, char **endp)); 1011_GL_CXXALIAS_SYS (strtold, long double,
1012 (const char *restrict str, char **restrict endp));
997# endif 1013# endif
998_GL_CXXALIASWARN (strtold); 1014_GL_CXXALIASWARN (strtold);
999#elif defined GNULIB_POSIXCHECK 1015#elif defined GNULIB_POSIXCHECK
@@ -1015,11 +1031,13 @@ _GL_WARN_ON_USE (strtold, "strtold is unportable - "
1015 to ERANGE. */ 1031 to ERANGE. */
1016# if !@HAVE_STRTOLL@ 1032# if !@HAVE_STRTOLL@
1017_GL_FUNCDECL_SYS (strtoll, long long, 1033_GL_FUNCDECL_SYS (strtoll, long long,
1018 (const char *string, char **endptr, int base) 1034 (const char *restrict string, char **restrict endptr,
1035 int base)
1019 _GL_ARG_NONNULL ((1))); 1036 _GL_ARG_NONNULL ((1)));
1020# endif 1037# endif
1021_GL_CXXALIAS_SYS (strtoll, long long, 1038_GL_CXXALIAS_SYS (strtoll, long long,
1022 (const char *string, char **endptr, int base)); 1039 (const char *restrict string, char **restrict endptr,
1040 int base));
1023_GL_CXXALIASWARN (strtoll); 1041_GL_CXXALIASWARN (strtoll);
1024#elif defined GNULIB_POSIXCHECK 1042#elif defined GNULIB_POSIXCHECK
1025# undef strtoll 1043# undef strtoll
@@ -1040,11 +1058,13 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
1040 ERANGE. */ 1058 ERANGE. */
1041# if !@HAVE_STRTOULL@ 1059# if !@HAVE_STRTOULL@
1042_GL_FUNCDECL_SYS (strtoull, unsigned long long, 1060_GL_FUNCDECL_SYS (strtoull, unsigned long long,
1043 (const char *string, char **endptr, int base) 1061 (const char *restrict string, char **restrict endptr,
1062 int base)
1044 _GL_ARG_NONNULL ((1))); 1063 _GL_ARG_NONNULL ((1)));
1045# endif 1064# endif
1046_GL_CXXALIAS_SYS (strtoull, unsigned long long, 1065_GL_CXXALIAS_SYS (strtoull, unsigned long long,
1047 (const char *string, char **endptr, int base)); 1066 (const char *restrict string, char **restrict endptr,
1067 int base));
1048_GL_CXXALIASWARN (strtoull); 1068_GL_CXXALIASWARN (strtoull);
1049#elif defined GNULIB_POSIXCHECK 1069#elif defined GNULIB_POSIXCHECK
1050# undef strtoull 1070# undef strtoull
diff --git a/lib/string.in.h b/lib/string.in.h
index 2c04e5f4f71..5bc00845205 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -411,11 +411,14 @@ _GL_WARN_ON_USE (strdup, "strdup is unportable - "
411# undef strncat 411# undef strncat
412# define strncat rpl_strncat 412# define strncat rpl_strncat
413# endif 413# endif
414_GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n) 414_GL_FUNCDECL_RPL (strncat, char *,
415 _GL_ARG_NONNULL ((1, 2))); 415 (char *restrict dest, const char *restrict src, size_t n)
416_GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n)); 416 _GL_ARG_NONNULL ((1, 2)));
417_GL_CXXALIAS_RPL (strncat, char *,
418 (char *restrict dest, const char *restrict src, size_t n));
417# else 419# else
418_GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n)); 420_GL_CXXALIAS_SYS (strncat, char *,
421 (char *restrict dest, const char *restrict src, size_t n));
419# endif 422# endif
420# if __GLIBC__ >= 2 423# if __GLIBC__ >= 2
421_GL_CXXALIASWARN (strncat); 424_GL_CXXALIASWARN (strncat);
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index e3ab3153fbf..44946072795 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -455,18 +455,22 @@ _GL_WARN_ON_USE (fstat, "fstat has portability problems - "
455# define fstatat rpl_fstatat 455# define fstatat rpl_fstatat
456# endif 456# endif
457_GL_FUNCDECL_RPL (fstatat, int, 457_GL_FUNCDECL_RPL (fstatat, int,
458 (int fd, char const *name, struct stat *st, int flags) 458 (int fd, char const *restrict name, struct stat *restrict st,
459 int flags)
459 _GL_ARG_NONNULL ((2, 3))); 460 _GL_ARG_NONNULL ((2, 3)));
460_GL_CXXALIAS_RPL (fstatat, int, 461_GL_CXXALIAS_RPL (fstatat, int,
461 (int fd, char const *name, struct stat *st, int flags)); 462 (int fd, char const *restrict name, struct stat *restrict st,
463 int flags));
462# else 464# else
463# if !@HAVE_FSTATAT@ 465# if !@HAVE_FSTATAT@
464_GL_FUNCDECL_SYS (fstatat, int, 466_GL_FUNCDECL_SYS (fstatat, int,
465 (int fd, char const *name, struct stat *st, int flags) 467 (int fd, char const *restrict name, struct stat *restrict st,
468 int flags)
466 _GL_ARG_NONNULL ((2, 3))); 469 _GL_ARG_NONNULL ((2, 3)));
467# endif 470# endif
468_GL_CXXALIAS_SYS (fstatat, int, 471_GL_CXXALIAS_SYS (fstatat, int,
469 (int fd, char const *name, struct stat *st, int flags)); 472 (int fd, char const *restrict name, struct stat *restrict st,
473 int flags));
470# endif 474# endif
471_GL_CXXALIASWARN (fstatat); 475_GL_CXXALIASWARN (fstatat);
472#elif @GNULIB_OVERRIDES_STRUCT_STAT@ 476#elif @GNULIB_OVERRIDES_STRUCT_STAT@
@@ -514,23 +518,11 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - "
514#if @GNULIB_LCHMOD@ 518#if @GNULIB_LCHMOD@
515/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME 519/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
516 denotes a symbolic link. */ 520 denotes a symbolic link. */
517# if @REPLACE_LCHMOD@ 521# if !@HAVE_LCHMOD@ || defined __hpux
518# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
519# undef lchmod
520# define lchmod rpl_lchmod
521# endif
522_GL_FUNCDECL_RPL (lchmod, int,
523 (char const *filename, mode_t mode)
524 _GL_ARG_NONNULL ((1)));
525_GL_CXXALIAS_RPL (lchmod, int,
526 (char const *filename, mode_t mode));
527# else
528# if !@HAVE_LCHMOD@ || defined __hpux
529_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode) 522_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
530 _GL_ARG_NONNULL ((1))); 523 _GL_ARG_NONNULL ((1)));
531# endif
532_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
533# endif 524# endif
525_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
534_GL_CXXALIASWARN (lchmod); 526_GL_CXXALIASWARN (lchmod);
535#elif defined GNULIB_POSIXCHECK 527#elif defined GNULIB_POSIXCHECK
536# undef lchmod 528# undef lchmod
@@ -548,17 +540,21 @@ _GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
548# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 540# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
549# define lstat stat 541# define lstat stat
550# endif 542# endif
551_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf)); 543_GL_CXXALIAS_RPL_1 (lstat, stat, int,
544 (const char *restrict name, struct stat *restrict buf));
552# elif @REPLACE_LSTAT@ 545# elif @REPLACE_LSTAT@
553# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 546# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
554# undef lstat 547# undef lstat
555# define lstat rpl_lstat 548# define lstat rpl_lstat
556# endif 549# endif
557_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf) 550_GL_FUNCDECL_RPL (lstat, int,
558 _GL_ARG_NONNULL ((1, 2))); 551 (const char *restrict name, struct stat *restrict buf)
559_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf)); 552 _GL_ARG_NONNULL ((1, 2)));
553_GL_CXXALIAS_RPL (lstat, int,
554 (const char *restrict name, struct stat *restrict buf));
560# else 555# else
561_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf)); 556_GL_CXXALIAS_SYS (lstat, int,
557 (const char *restrict name, struct stat *restrict buf));
562# endif 558# endif
563# if @HAVE_LSTAT@ 559# if @HAVE_LSTAT@
564_GL_CXXALIASWARN (lstat); 560_GL_CXXALIASWARN (lstat);
@@ -771,7 +767,7 @@ _GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
771# define stat(name, st) rpl_stat (name, st) 767# define stat(name, st) rpl_stat (name, st)
772# endif /* !_LARGE_FILES */ 768# endif /* !_LARGE_FILES */
773# endif /* !@GNULIB_OVERRIDES_STRUCT_STAT@ */ 769# endif /* !@GNULIB_OVERRIDES_STRUCT_STAT@ */
774_GL_EXTERN_C int stat (const char *name, struct stat *buf) 770_GL_EXTERN_C int stat (const char *restrict name, struct stat *restrict buf)
775 _GL_ARG_NONNULL ((1, 2)); 771 _GL_ARG_NONNULL ((1, 2));
776# endif 772# endif
777#elif @GNULIB_OVERRIDES_STRUCT_STAT@ 773#elif @GNULIB_OVERRIDES_STRUCT_STAT@
diff --git a/lib/time.in.h b/lib/time.in.h
index 3f942b704dc..1d11650e77f 100644
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -286,14 +286,17 @@ _GL_CXXALIASWARN (ctime);
286# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 286# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
287# define strftime rpl_strftime 287# define strftime rpl_strftime
288# endif 288# endif
289_GL_FUNCDECL_RPL (strftime, size_t, (char *__buf, size_t __bufsize, 289_GL_FUNCDECL_RPL (strftime, size_t,
290 const char *__fmt, const struct tm *__tp) 290 (char *restrict __buf, size_t __bufsize,
291 _GL_ARG_NONNULL ((1, 3, 4))); 291 const char *restrict __fmt, const struct tm *restrict __tp)
292_GL_CXXALIAS_RPL (strftime, size_t, (char *__buf, size_t __bufsize, 292 _GL_ARG_NONNULL ((1, 3, 4)));
293 const char *__fmt, const struct tm *__tp)); 293_GL_CXXALIAS_RPL (strftime, size_t,
294 (char *restrict __buf, size_t __bufsize,
295 const char *restrict __fmt, const struct tm *restrict __tp));
294# else 296# else
295_GL_CXXALIAS_SYS (strftime, size_t, (char *__buf, size_t __bufsize, 297_GL_CXXALIAS_SYS (strftime, size_t,
296 const char *__fmt, const struct tm *__tp)); 298 (char *restrict __buf, size_t __bufsize,
299 const char *restrict __fmt, const struct tm *restrict __tp));
297# endif 300# endif
298# if __GLIBC__ >= 2 301# if __GLIBC__ >= 2
299_GL_CXXALIASWARN (strftime); 302_GL_CXXALIASWARN (strftime);
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index d6176adc00d..c9b9ac95821 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -1370,18 +1370,22 @@ _GL_CXXALIASWARN (read);
1370# define readlink rpl_readlink 1370# define readlink rpl_readlink
1371# endif 1371# endif
1372_GL_FUNCDECL_RPL (readlink, ssize_t, 1372_GL_FUNCDECL_RPL (readlink, ssize_t,
1373 (const char *file, char *buf, size_t bufsize) 1373 (const char *restrict file,
1374 char *restrict buf, size_t bufsize)
1374 _GL_ARG_NONNULL ((1, 2))); 1375 _GL_ARG_NONNULL ((1, 2)));
1375_GL_CXXALIAS_RPL (readlink, ssize_t, 1376_GL_CXXALIAS_RPL (readlink, ssize_t,
1376 (const char *file, char *buf, size_t bufsize)); 1377 (const char *restrict file,
1378 char *restrict buf, size_t bufsize));
1377# else 1379# else
1378# if !@HAVE_READLINK@ 1380# if !@HAVE_READLINK@
1379_GL_FUNCDECL_SYS (readlink, ssize_t, 1381_GL_FUNCDECL_SYS (readlink, ssize_t,
1380 (const char *file, char *buf, size_t bufsize) 1382 (const char *restrict file,
1383 char *restrict buf, size_t bufsize)
1381 _GL_ARG_NONNULL ((1, 2))); 1384 _GL_ARG_NONNULL ((1, 2)));
1382# endif 1385# endif
1383_GL_CXXALIAS_SYS (readlink, ssize_t, 1386_GL_CXXALIAS_SYS (readlink, ssize_t,
1384 (const char *file, char *buf, size_t bufsize)); 1387 (const char *restrict file,
1388 char *restrict buf, size_t bufsize));
1385# endif 1389# endif
1386_GL_CXXALIASWARN (readlink); 1390_GL_CXXALIASWARN (readlink);
1387#elif defined GNULIB_POSIXCHECK 1391#elif defined GNULIB_POSIXCHECK
@@ -1399,18 +1403,22 @@ _GL_WARN_ON_USE (readlink, "readlink is unportable - "
1399# define readlinkat rpl_readlinkat 1403# define readlinkat rpl_readlinkat
1400# endif 1404# endif
1401_GL_FUNCDECL_RPL (readlinkat, ssize_t, 1405_GL_FUNCDECL_RPL (readlinkat, ssize_t,
1402 (int fd, char const *file, char *buf, size_t len) 1406 (int fd, char const *restrict file,
1407 char *restrict buf, size_t len)
1403 _GL_ARG_NONNULL ((2, 3))); 1408 _GL_ARG_NONNULL ((2, 3)));
1404_GL_CXXALIAS_RPL (readlinkat, ssize_t, 1409_GL_CXXALIAS_RPL (readlinkat, ssize_t,
1405 (int fd, char const *file, char *buf, size_t len)); 1410 (int fd, char const *restrict file,
1411 char *restrict buf, size_t len));
1406# else 1412# else
1407# if !@HAVE_READLINKAT@ 1413# if !@HAVE_READLINKAT@
1408_GL_FUNCDECL_SYS (readlinkat, ssize_t, 1414_GL_FUNCDECL_SYS (readlinkat, ssize_t,
1409 (int fd, char const *file, char *buf, size_t len) 1415 (int fd, char const *restrict file,
1416 char *restrict buf, size_t len)
1410 _GL_ARG_NONNULL ((2, 3))); 1417 _GL_ARG_NONNULL ((2, 3)));
1411# endif 1418# endif
1412_GL_CXXALIAS_SYS (readlinkat, ssize_t, 1419_GL_CXXALIAS_SYS (readlinkat, ssize_t,
1413 (int fd, char const *file, char *buf, size_t len)); 1420 (int fd, char const *restrict file,
1421 char *restrict buf, size_t len));
1414# endif 1422# endif
1415_GL_CXXALIASWARN (readlinkat); 1423_GL_CXXALIASWARN (readlinkat);
1416#elif defined GNULIB_POSIXCHECK 1424#elif defined GNULIB_POSIXCHECK