emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f5dbdedcc53 01/13: Update from Gnulib by running admin/merge-gnul


From: Paul Eggert
Subject: master f5dbdedcc53 01/13: Update from Gnulib by running admin/merge-gnulib
Date: Tue, 16 Jul 2024 18:37:43 -0400 (EDT)

branch: master
commit f5dbdedcc53d2c57b9ddecbe9248c90ef0fa08d6
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Update from Gnulib by running admin/merge-gnulib
---
 build-aux/gitlog-to-changelog |  31 +++++++--
 build-aux/move-if-change      |   4 +-
 build-aux/update-copyright    |   4 +-
 lib/gnulib.mk.in              |  32 ++++++---
 lib/qcopy-acl.c               |  21 +++++-
 lib/stdio.in.h                | 147 +++++++++++++++++++++++++++++++++++++-----
 lib/stdlib.in.h               |  24 ++++++-
 m4/acl.m4                     |  25 +++++--
 m4/gnulib-comp.m4             |   9 +--
 m4/manywarnings.m4            |   3 +-
 m4/memmem.m4                  |   4 +-
 m4/stdio_h.m4                 |  18 ++++--
 m4/strnlen.m4                 |  51 ++++++++++++++-
 13 files changed, 309 insertions(+), 64 deletions(-)

diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 49e7ef95cef..a2c348e2cf0 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -35,7 +35,7 @@
 eval 'exec perl -wSx "$0" "$@"'
      if 0;
 
-my $VERSION = '2023-06-24 21:59'; # UTC
+my $VERSION = '2024-07-04 10:56'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
@@ -97,6 +97,7 @@ OPTIONS:
    --strip-cherry-pick  remove data inserted by "git cherry-pick";
                   this includes the "cherry picked from commit ..." line,
                   and the possible final "Conflicts:" paragraph.
+   --commit-timezone  use dates respecting the timezone commits were made in.
    --help       display this help and exit
    --version    output version information and exit
 
@@ -247,6 +248,7 @@ sub git_dir_option($)
   my $ignore_line;
   my $strip_tab = 0;
   my $strip_cherry_pick = 0;
+  my $commit_timezone = 0;
   my $srcdir;
   GetOptions
     (
@@ -262,6 +264,7 @@ sub git_dir_option($)
      'ignore-line=s' => \$ignore_line,
      'strip-tab' => \$strip_tab,
      'strip-cherry-pick' => \$strip_cherry_pick,
+     'commit-timezone' => \$commit_timezone,
      'srcdir=s' => \$srcdir,
     ) or usage 1;
 
@@ -274,10 +277,12 @@ sub git_dir_option($)
   # that makes a correction in the log or attribution of that commit.
   my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {};
 
+  my $commit_time_format = $commit_timezone ? '%cI' : '%ct';
   my @cmd = ('git',
              git_dir_option $srcdir,
              qw(log --log-size),
-             '--pretty=format:%H:%ct  %an  <%ae>%n%n'.$format_string, @ARGV);
+             ("--pretty=format:%H:$commit_time_format"
+              . '  %an  <%ae>%n%n'.$format_string, @ARGV));
   open PIPE, '-|', @cmd
     or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n"
             . "(Is your Git too old?  Version 1.5.1 or later is required.)\n");
@@ -350,17 +355,31 @@ sub git_dir_option($)
       my $author_line = shift @line;
       defined $author_line
         or die "$ME:$.: unexpected EOF\n";
-      $author_line =~ /^(\d+)  (.*>)$/
+      $author_line =~ /^(\S+)  (.*>)$/
         or die "$ME:$.: Invalid line "
           . "(expected date/author/email):\n$author_line\n";
 
+      # Author  <email>
+      my $author = $2;
+
+      my $commit_date = $1;
+      if (! $commit_timezone)
+        {
+          # Seconds since the Epoch.
+          $commit_date = strftime "%Y-%m-%d", localtime ($commit_date);
+        }
+      else
+        {
+          # ISO 8601 date.
+          $commit_date =~ s/T.*$//;
+        }
+
       # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
       # '(tiny change)' annotation.
       my $tiny = (grep 
(/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line)
                   ? '  (tiny change)' : '');
 
-      my $date_line = sprintf "%s  %s$tiny\n",
-        strftime ("%Y-%m-%d", localtime ($1)), $2;
+      my $date_line = "$commit_date  $author$tiny\n";
 
       my @coauthors = grep /^Co-authored-by:.*$/, @line;
       # Omit meta-data lines we've already interpreted.
@@ -507,7 +526,7 @@ sub git_dir_option($)
 # Local Variables:
 # mode: perl
 # indent-tabs-mode: nil
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
 # time-stamp-line-limit: 50
 # time-stamp-start: "my $VERSION = '"
 # time-stamp-format: "%:y-%02m-%02d %02H:%02M"
diff --git a/build-aux/move-if-change b/build-aux/move-if-change
index 18a720735cd..a73bd2403cf 100755
--- a/build-aux/move-if-change
+++ b/build-aux/move-if-change
@@ -2,7 +2,7 @@
 # Like mv $1 $2, but if the files are the same, just delete $1.
 # Status is zero if successful, nonzero otherwise.
 
-VERSION='2018-03-07 03:47'; # UTC
+VERSION='2024-07-04 10:56'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
@@ -76,7 +76,7 @@ else
 fi
 
 ## Local Variables:
-## eval: (add-hook 'before-save-hook 'time-stamp)
+## eval: (add-hook 'before-save-hook 'time-stamp nil t)
 ## time-stamp-start: "VERSION='"
 ## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
 ## time-stamp-time-zone: "UTC0"
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index ea3e46fe60f..42f26933835 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -138,7 +138,7 @@
 eval 'exec perl -wSx -0777 -pi "$0" "$@"'
      if 0;
 
-my $VERSION = '2024-01-15.18:30'; # UTC
+my $VERSION = '2024-07-04.10:56'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
@@ -298,7 +298,7 @@ if (!$found)
 # coding: utf-8
 # mode: perl
 # indent-tabs-mode: nil
-# eval: (add-hook 'before-save-hook 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp nil t)
 # time-stamp-line-limit: 200
 # time-stamp-start: "my $VERSION = '"
 # time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 948269e744d..cebde64d117 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -386,6 +386,7 @@ GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
 GL_GNULIB_DUP = @GL_GNULIB_DUP@
 GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
 GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
+GL_GNULIB_DZPRINTF = @GL_GNULIB_DZPRINTF@
 GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
 GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
 GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
@@ -431,6 +432,7 @@ GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
 GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
 GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
 GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
+GL_GNULIB_FZPRINTF = @GL_GNULIB_FZPRINTF@
 GL_GNULIB_GETC = @GL_GNULIB_GETC@
 GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
 GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
@@ -602,6 +604,7 @@ GL_GNULIB_SIGNAL_H_SIGPIPE = @GL_GNULIB_SIGNAL_H_SIGPIPE@
 GL_GNULIB_SIGPROCMASK = @GL_GNULIB_SIGPROCMASK@
 GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
 GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
+GL_GNULIB_SNZPRINTF = @GL_GNULIB_SNZPRINTF@
 GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
 GL_GNULIB_STAT = @GL_GNULIB_STAT@
 GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
@@ -637,6 +640,7 @@ GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
 GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
 GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
 GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
+GL_GNULIB_SZPRINTF = @GL_GNULIB_SZPRINTF@
 GL_GNULIB_TIME = @GL_GNULIB_TIME@
 GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
 GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
@@ -658,22 +662,24 @@ GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
 GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
 GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
 GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
-GL_GNULIB_VAZSPRINTF = @GL_GNULIB_VAZSPRINTF@
+GL_GNULIB_VASZPRINTF = @GL_GNULIB_VASZPRINTF@
 GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
+GL_GNULIB_VDZPRINTF = @GL_GNULIB_VDZPRINTF@
 GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
 GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
 GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
+GL_GNULIB_VFZPRINTF = @GL_GNULIB_VFZPRINTF@
 GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
 GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
 GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
 GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
+GL_GNULIB_VSNZPRINTF = @GL_GNULIB_VSNZPRINTF@
 GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
-GL_GNULIB_VZSNPRINTF = @GL_GNULIB_VZSNPRINTF@
-GL_GNULIB_VZSPRINTF = @GL_GNULIB_VZSPRINTF@
+GL_GNULIB_VSZPRINTF = @GL_GNULIB_VSZPRINTF@
+GL_GNULIB_VZPRINTF = @GL_GNULIB_VZPRINTF@
 GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
 GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
-GL_GNULIB_ZSNPRINTF = @GL_GNULIB_ZSNPRINTF@
-GL_GNULIB_ZSPRINTF = @GL_GNULIB_ZSPRINTF@
+GL_GNULIB_ZPRINTF = @GL_GNULIB_ZPRINTF@
 GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
 GL_STDC_BIT_CEIL = @GL_STDC_BIT_CEIL@
 GL_STDC_BIT_FLOOR = @GL_STDC_BIT_FLOOR@
@@ -3285,6 +3291,7 @@ stdio.h: stdio.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
              -e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \
+             -e 's/@''GNULIB_DZPRINTF''@/$(GL_GNULIB_DZPRINTF)/g' \
              -e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \
              -e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \
              -e 's/@''GNULIB_FFLUSH''@/$(GL_GNULIB_FFLUSH)/g' \
@@ -3305,6 +3312,7 @@ stdio.h: stdio.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \
              -e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \
              -e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \
+             -e 's/@''GNULIB_FZPRINTF''@/$(GL_GNULIB_FZPRINTF)/g' \
              -e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \
              -e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \
              -e 's/@''GNULIB_GETDELIM''@/$(GL_GNULIB_GETDELIM)/g' \
@@ -3325,25 +3333,29 @@ stdio.h: stdio.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \
              -e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \
              -e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \
+             -e 's/@''GNULIB_SNZPRINTF''@/$(GL_GNULIB_SNZPRINTF)/g' \
              -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \
              -e 
's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \
              -e 
's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_SZPRINTF''@/$(GL_GNULIB_SZPRINTF)/g' \
              -e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \
              -e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \
-             -e 's/@''GNULIB_VAZSPRINTF''@/$(GL_GNULIB_VAZSPRINTF)/g' \
+             -e 's/@''GNULIB_VASZPRINTF''@/$(GL_GNULIB_VASZPRINTF)/g' \
              -e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \
+             -e 's/@''GNULIB_VDZPRINTF''@/$(GL_GNULIB_VDZPRINTF)/g' \
              -e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \
              -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_VFZPRINTF''@/$(GL_GNULIB_VFZPRINTF)/g' \
              -e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \
              -e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \
              -e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \
              -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \
              -e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \
+             -e 's/@''GNULIB_VSNZPRINTF''@/$(GL_GNULIB_VSNZPRINTF)/g' \
              -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_VZSNPRINTF''@/$(GL_GNULIB_VZSNPRINTF)/g' \
-             -e 's/@''GNULIB_VZSPRINTF''@/$(GL_GNULIB_VZSPRINTF)/g' \
-             -e 's/@''GNULIB_ZSNPRINTF''@/$(GL_GNULIB_ZSNPRINTF)/g' \
-             -e 's/@''GNULIB_ZSPRINTF''@/$(GL_GNULIB_ZSPRINTF)/g' \
+             -e 's/@''GNULIB_VSZPRINTF''@/$(GL_GNULIB_VSZPRINTF)/g' \
+             -e 's/@''GNULIB_VZPRINTF''@/$(GL_GNULIB_VZPRINTF)/g' \
+             -e 's/@''GNULIB_ZPRINTF''@/$(GL_GNULIB_ZPRINTF)/g' \
              -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \
              -e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \
              -e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \
diff --git a/lib/qcopy-acl.c b/lib/qcopy-acl.c
index dfc39cead05..877f42588b7 100644
--- a/lib/qcopy-acl.c
+++ b/lib/qcopy-acl.c
@@ -26,6 +26,20 @@
 #if USE_XATTR
 
 # include <attr/libattr.h>
+# include <string.h>
+
+# if HAVE_LINUX_XATTR_H
+#  include <linux/xattr.h>
+# endif
+# ifndef XATTR_NAME_NFSV4_ACL
+#  define XATTR_NAME_NFSV4_ACL "system.nfs4_acl"
+# endif
+# ifndef XATTR_NAME_POSIX_ACL_ACCESS
+#  define XATTR_NAME_POSIX_ACL_ACCESS "system.posix_acl_access"
+# endif
+# ifndef XATTR_NAME_POSIX_ACL_DEFAULT
+#  define XATTR_NAME_POSIX_ACL_DEFAULT "system.posix_acl_default"
+# endif
 
 /* Returns 1 if NAME is the name of an extended attribute that is related
    to permissions, i.e. ACLs.  Returns 0 otherwise.  */
@@ -33,7 +47,12 @@
 static int
 is_attr_permissions (const char *name, struct error_context *ctx)
 {
-  return attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS;
+  /* We need to explicitly test for the known extended attribute names,
+     because at least on CentOS 7, attr_copy_action does not do it.  */
+  return strcmp (name, XATTR_NAME_POSIX_ACL_ACCESS) == 0
+         || strcmp (name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0
+         || strcmp (name, XATTR_NAME_NFSV4_ACL) == 0
+         || attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS;
 }
 
 #endif  /* USE_XATTR */
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index cf2d8c999bc..38572382d46 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -280,7 +280,26 @@
 #endif
 
 
+#if @GNULIB_DZPRINTF@
+/* Prints formatted output to file descriptor FD.
+   Returns the number of bytes written to the file descriptor.  Upon
+   failure, returns -1 with errno set.
+   Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+   Therefore, if the format string is valid and does not use %ls/%lc
+   directives nor widths, the only possible failure codes are ENOMEM
+   and the possible failure codes from write(), excluding EINTR.  */
+_GL_FUNCDECL_SYS (dzprintf, off64_t,
+                  (int fd, const char *restrict format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_SYS (dzprintf, off64_t,
+                  (int fd, const char *restrict format, ...));
+#endif
+
 #if @GNULIB_DPRINTF@
+/* Prints formatted output to file descriptor FD.
+   Returns the number of bytes written to the file descriptor.  Upon
+   failure, returns a negative value.  */
 # if @REPLACE_DPRINTF@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define dprintf rpl_dprintf
@@ -547,7 +566,26 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms 
is not POSIX complian
 # endif
 #endif
 
+#if @GNULIB_FZPRINTF@
+/* Prints formatted output to stream FP.
+   Returns the number of bytes written to the stream.  Upon failure,
+   returns -1 with the stream's error indicator set.
+   Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+   Therefore, if the format string is valid and does not use %ls/%lc
+   directives nor widths, the only possible failure causes are ENOMEM
+   and the possible failure causes from fwrite().  */
+_GL_FUNCDECL_SYS (fzprintf, off64_t,
+                  (FILE *restrict fp, const char *restrict format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (fzprintf, off64_t,
+                  (FILE *restrict fp, const char *restrict format, ...));
+#endif
+
 #if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
+/* Prints formatted output to stream FP.
+   Returns the number of bytes written to the stream.  Upon failure,
+   returns a negative value with the stream's error indicator set.  */
 # if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
      || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && 
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1227,7 +1265,24 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some 
platforms - "
 # endif
 #endif
 
+#if @GNULIB_ZPRINTF@
+/* Prints formatted output to standard output.
+   Returns the number of bytes written to standard output.  Upon failure,
+   returns -1 with stdout's error indicator set.
+   Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+   Therefore, if the format string is valid and does not use %ls/%lc
+   directives nor widths, the only possible failure causes are ENOMEM
+   and the possible failure causes from fwrite().  */
+_GL_FUNCDECL_SYS (zprintf, off64_t, (const char *restrict format, ...)
+                                    _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
+                                    _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (zprintf, off64_t, (const char *restrict format, ...));
+#endif
+
 #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
+/* Prints formatted output to standard output.
+   Returns the number of bytes written to standard output.  Upon failure,
+   returns a negative value with stdout's error indicator set.  */
 # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
      || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && 
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 #  if defined __GNUC__ || defined __clang__
@@ -1459,7 +1514,7 @@ _GL_CXXALIASWARN (scanf);
 # endif
 #endif
 
-#if @GNULIB_ZSNPRINTF@
+#if @GNULIB_SNZPRINTF@
 /* Prints formatted output to string STR.  Similar to sprintf, but the
    additional parameter SIZE limits how much is written into STR.
    STR may be NULL, in which case nothing will be written.
@@ -1468,12 +1523,12 @@ _GL_CXXALIASWARN (scanf);
    Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
    Therefore, if the format string is valid and does not use %ls/%lc
    directives nor widths, the only possible failure code is ENOMEM.  */
-_GL_FUNCDECL_SYS (zsnprintf, ptrdiff_t,
+_GL_FUNCDECL_SYS (snzprintf, ptrdiff_t,
                   (char *restrict str, size_t size,
                    const char *restrict format, ...)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
                   _GL_ARG_NONNULL ((3)));
-_GL_CXXALIAS_SYS (zsnprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (snzprintf, ptrdiff_t,
                   (char *restrict str, size_t size,
                    const char *restrict format, ...));
 #endif
@@ -1520,19 +1575,19 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
 # endif
 #endif
 
-#if @GNULIB_ZSPRINTF@
+#if @GNULIB_SZPRINTF@
 /* Prints formatted output to string STR.
    Returns the string length of the formatted string.  Upon failure,
    returns -1 with errno set.
    Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
    Therefore, if the format string is valid and does not use %ls/%lc
    directives nor widths, the only possible failure code is ENOMEM.  */
-_GL_FUNCDECL_SYS (zsprintf, ptrdiff_t,
+_GL_FUNCDECL_SYS (szprintf, ptrdiff_t,
                   (char *restrict str,
                    const char *restrict format, ...)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_SYS (zsprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (szprintf, ptrdiff_t,
                   (char *restrict str,
                    const char *restrict format, ...));
 #endif
@@ -1629,7 +1684,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw 
- "
 # endif
 #endif
 
-#if @GNULIB_VAZSPRINTF@
+#if @GNULIB_VASZPRINTF@
 /* Prints formatted output to a string dynamically allocated with malloc().
    If the memory allocation succeeds, it stores the address of the string in
    *RESULT and returns the number of resulting bytes, excluding the trailing
@@ -1638,17 +1693,17 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on 
mingw - "
    Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
    Therefore, if the format string is valid and does not use %ls/%lc
    directives nor widths, the only possible failure code is ENOMEM.  */
-_GL_FUNCDECL_SYS (azsprintf, ptrdiff_t,
+_GL_FUNCDECL_SYS (aszprintf, ptrdiff_t,
                   (char **result, const char *format, ...)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_SYS (azsprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (aszprintf, ptrdiff_t,
                   (char **result, const char *format, ...));
-_GL_FUNCDECL_SYS (vazsprintf, ptrdiff_t,
+_GL_FUNCDECL_SYS (vaszprintf, ptrdiff_t,
                   (char **result, const char *format, va_list args)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_SYS (vazsprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (vaszprintf, ptrdiff_t,
                   (char **result, const char *format, va_list args));
 #endif
 
@@ -1703,7 +1758,26 @@ _GL_CXXALIAS_SYS (vasprintf, int,
 _GL_CXXALIASWARN (vasprintf);
 #endif
 
+#if @GNULIB_VDZPRINTF@
+/* Prints formatted output to file descriptor FD.
+   Returns the number of bytes written to the file descriptor.  Upon
+   failure, returns -1 with errno set.
+   Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
+   Therefore, if the format string is valid and does not use %ls/%lc
+   directives nor widths, the only possible failure codes are ENOMEM
+   and the possible failure codes from write(), excluding EINTR.  */
+_GL_FUNCDECL_SYS (vdzprintf, off64_t,
+                  (int fd, const char *restrict format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_SYS (vdzprintf, off64_t,
+                  (int fd, const char *restrict format, va_list args));
+#endif
+
 #if @GNULIB_VDPRINTF@
+/* Prints formatted output to file descriptor FD.
+   Returns the number of bytes written to the file descriptor.  Upon
+   failure, returns a negative value.  */
 # if @REPLACE_VDPRINTF@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define vdprintf rpl_vdprintf
@@ -1737,7 +1811,28 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
 # endif
 #endif
 
+#if @GNULIB_VFZPRINTF@
+/* Prints formatted output to stream FP.
+   Returns the number of bytes written to the stream.  Upon failure,
+   returns -1 with the stream's error indicator set.
+   Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+   Therefore, if the format string is valid and does not use %ls/%lc
+   directives nor widths, the only possible failure causes are ENOMEM
+   and the possible failure causes from fwrite().  */
+_GL_FUNCDECL_SYS (vfzprintf, off64_t,
+                  (FILE *restrict fp,
+                   const char *restrict format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (vfzprintf, off64_t,
+                  (FILE *restrict fp,
+                   const char *restrict format, va_list args));
+#endif
+
 #if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
+/* Prints formatted output to stream FP.
+   Returns the number of bytes written to the stream.  Upon failure,
+   returns a negative value with the stream's error indicator set.  */
 # if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
      || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && 
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1806,7 +1901,25 @@ _GL_CXXALIASWARN (vfscanf);
 # endif
 #endif
 
+#if @GNULIB_VZPRINTF@
+/* Prints formatted output to standard output.
+   Returns the number of bytes written to standard output.  Upon failure,
+   returns -1 with stdout's error indicator set.
+   Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
+   Therefore, if the format string is valid and does not use %ls/%lc
+   directives nor widths, the only possible failure causes are ENOMEM
+   and the possible failure causes from fwrite().  */
+_GL_FUNCDECL_SYS (vzprintf, off64_t, (const char *restrict format, va_list 
args)
+                                     _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 
0)
+                                     _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (vzprintf, off64_t,
+                  (const char *restrict format, va_list args));
+#endif
+
 #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
+/* Prints formatted output to standard output.
+   Returns the number of bytes written to standard output.  Upon failure,
+   returns a negative value with stdout's error indicator set.  */
 # if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
      || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && 
(@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1862,7 +1975,7 @@ _GL_CXXALIASWARN (vscanf);
 # endif
 #endif
 
-#if @GNULIB_VZSNPRINTF@
+#if @GNULIB_VSNZPRINTF@
 /* Prints formatted output to string STR.  Similar to sprintf, but the
    additional parameter SIZE limits how much is written into STR.
    STR may be NULL, in which case nothing will be written.
@@ -1871,12 +1984,12 @@ _GL_CXXALIASWARN (vscanf);
    Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
    Therefore, if the format string is valid and does not use %ls/%lc
    directives nor widths, the only possible failure code is ENOMEM.  */
-_GL_FUNCDECL_SYS (vzsnprintf, ptrdiff_t,
+_GL_FUNCDECL_SYS (vsnzprintf, ptrdiff_t,
                   (char *restrict str, size_t size,
                    const char *restrict format, va_list args)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
                   _GL_ARG_NONNULL ((3)));
-_GL_CXXALIAS_SYS (vzsnprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t,
                   (char *restrict str, size_t size,
                    const char *restrict format, va_list args));
 #endif
@@ -1923,19 +2036,19 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
 # endif
 #endif
 
-#if @GNULIB_VZSPRINTF@
+#if @GNULIB_VSZPRINTF@
 /* Prints formatted output to string STR.
    Returns the string length of the formatted string.  Upon failure,
    returns -1 with errno set.
    Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
    Therefore, if the format string is valid and does not use %ls/%lc
    directives nor widths, the only possible failure code is ENOMEM.  */
-_GL_FUNCDECL_SYS (vzsprintf, ptrdiff_t,
+_GL_FUNCDECL_SYS (vszprintf, ptrdiff_t,
                   (char *restrict str,
                    const char *restrict format, va_list args)
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_SYS (vzsprintf, ptrdiff_t,
+_GL_CXXALIAS_SYS (vszprintf, ptrdiff_t,
                   (char *restrict str,
                    const char *restrict format, va_list args));
 #endif
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index cfc69d0a506..e42368eef27 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -20,9 +20,18 @@
 #endif
 @PRAGMA_COLUMNS@
 
-#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+#if (defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) || defined 
__need_malloc_and_calloc
 /* Special invocation conventions inside some gnulib header files,
-   and inside some glibc header files, respectively.  */
+   and inside some glibc header files, respectively.
+   Do not recognize this special invocation convention when GCC's
+   c++/11/stdlib.h is being included or has been included. This is needed
+   to support the use of clang+llvm binaries on Ubuntu 22.04 with
+   CXX="$clangdir/bin/clang++ -I/usr/include/c++/11 \
+                              -I/usr/include/x86_64-linux-gnu/c++/11
+                              -L/usr/lib/gcc/x86_64-linux-gnu/11
+                              -Wl,-rpath,$clangdir/lib"
+   because in this case /usr/include/c++/11/stdlib.h (which does not support
+   the convention) is seen before the gnulib-generated stdlib.h.  */
 
 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
 
@@ -108,6 +117,17 @@ struct random_data
 # include <unistd.h>
 #endif
 
+#if ((@GNULIB_STRTOL@ && @REPLACE_STRTOL@) || (@GNULIB_STRTOLL@ && 
@REPLACE_STRTOLL@) || (@GNULIB_STRTOUL@ && @REPLACE_STRTOUL@) || 
(@GNULIB_STRTOULL@ && @REPLACE_STRTOULL@)) && defined __cplusplus && !defined 
GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && defined __sun
+/* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro
+   below, this may cause compilation errors later in the libstdc++ header files
+   (that are part of GCC), such as:
+     error: 'rpl_strtol' is not a member of 'std'
+   To avoid this, include the relevant header files here, before these symbols
+   get defined as macros.  But do so only on Solaris 11 (where it is needed),
+   not on mingw (where it would cause other compilation errors).  */
+# include <string>
+#endif
+
 /* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
    that can be freed by passing them as the Ith argument to the
    function F.  */
diff --git a/m4/acl.m4 b/m4/acl.m4
index c7b6ec2b14e..be88f1b8313 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
 # acl.m4
-# serial 30
+# serial 31
 dnl Copyright (C) 2002, 2004-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -178,13 +178,14 @@ AC_DEFUN([gl_ACL_GET_FILE],
   AS_IF([test "$gl_cv_func_working_acl_get_file" != no], [$1], [$2])
 ])
 
-# On GNU/Linux, testing if a file has an acl can be done with the
-# listxattr and getxattr syscalls, which don't require linking
-# against additional libraries.  Assume this works if linux/attr.h
-# and listxattr are present.
+# Prerequisites of module file-has-acl.
 AC_DEFUN([gl_FILE_HAS_ACL],
 [
   AC_REQUIRE([gl_FUNC_ACL_ARG])
+  # On GNU/Linux, testing if a file has an acl can be done with the
+  # listxattr and getxattr syscalls, which don't require linking
+  # against additional libraries.  Assume this works if linux/attr.h
+  # and listxattr are present.
   AC_CHECK_HEADERS_ONCE([linux/xattr.h])
   AC_CHECK_FUNCS_ONCE([listxattr])
   FILE_HAS_ACL_LIB=
@@ -198,3 +199,17 @@ AC_DEFUN([gl_FILE_HAS_ACL],
        FILE_HAS_ACL_LIB=$LIB_ACL])
   AC_SUBST([FILE_HAS_ACL_LIB])
 ])
+
+# Prerequisites of module qcopy-acl.
+AC_DEFUN([gl_QCOPY_ACL],
+[
+  AC_REQUIRE([gl_FUNC_ACL])
+  AC_CHECK_HEADERS_ONCE([linux/xattr.h])
+  gl_FUNC_XATTR
+  if test "$use_xattr" = yes; then
+    QCOPY_ACL_LIB="$LIB_XATTR"
+  else
+    QCOPY_ACL_LIB="$LIB_ACL"
+  fi
+  AC_SUBST([QCOPY_ACL_LIB])
+])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 6c49edac932..79a0f27382a 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -478,14 +478,7 @@ AC_DEFUN([gl_INIT],
     gl_PREREQ_PTHREAD_SIGMASK
   ])
   gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
-  gl_FUNC_XATTR
-  AC_REQUIRE([gl_FUNC_ACL])
-  if test "$use_xattr" = yes; then
-    QCOPY_ACL_LIB="$LIB_XATTR"
-  else
-    QCOPY_ACL_LIB="$LIB_ACL"
-  fi
-  AC_SUBST([QCOPY_ACL_LIB])
+  gl_QCOPY_ACL
   gl_FUNC_READLINK
   gl_CONDITIONAL([GL_COND_OBJ_READLINK],
                  [test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1])
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 14bc5041eaa..5b0baee2057 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,5 +1,5 @@
 # manywarnings.m4
-# serial 26
+# serial 27
 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
     -Wsuggest-final-methods \
     -Wsuggest-final-types \
     -Wsync-nand \
-    -Wsystem-headers \
     -Wtrampolines \
     -Wuninitialized \
     -Wunknown-pragmas \
diff --git a/m4/memmem.m4 b/m4/memmem.m4
index a9bc277813b..e6b1d91cbb1 100644
--- a/m4/memmem.m4
+++ b/m4/memmem.m4
@@ -1,5 +1,5 @@
 # memmem.m4
-# serial 29
+# serial 30
 dnl Copyright (C) 2002-2004, 2007-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -102,7 +102,7 @@ static void quit (int sig) { _exit (sig + 128); }
     char *haystack = (char *) malloc (2 * m + 1);
     char *needle = (char *) malloc (m + 1);
     /* Failure to compile this test due to missing alarm is okay,
-       since all such platforms (mingw) also lack memmem.  */
+       since all such platforms (mingw, MSVC) also lack memmem.  */
     signal (SIGALRM, quit);
     alarm (5);
     /* Check for quadratic performance.  */
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 10e1fbb8aa9..ec52ae92ff4 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,5 +1,5 @@
 # stdio_h.m4
-# serial 69
+# serial 75
 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -133,6 +133,7 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
 [
   m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DZPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH])
@@ -153,6 +154,7 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FZPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM])
@@ -173,25 +175,29 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNZPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SZPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF])
-    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VAZSPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASZPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDZPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFZPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNZPRINTF])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX])
-    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZSNPRINTF])
-    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZSPRINTF])
-    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZSNPRINTF])
-    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZSPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSZPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZPRINTF])
     dnl Support Microsoft deprecated alias function names by default.
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1])
     gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1])
diff --git a/m4/strnlen.m4 b/m4/strnlen.m4
index b4d2778524e..83a75c0c327 100644
--- a/m4/strnlen.m4
+++ b/m4/strnlen.m4
@@ -1,11 +1,60 @@
 # strnlen.m4
-# serial 14
+# serial 15
 dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+m4_version_prereq([2.73], [], [
+# Replace AC_FUNC_STRNLEN from Autoconf 2.72 and earlier,
+# which does not check for Android strnlen bugs.
+
+AC_DEFUN([AC_FUNC_STRNLEN],
+[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl
+AC_CACHE_CHECK([for working strnlen], [ac_cv_func_strnlen_working],
+[AC_RUN_IFELSE(
+   [AC_LANG_PROGRAM(
+      [AC_INCLUDES_DEFAULT
+       [/* Use pstrnlen to test; 'volatile' prevents the compiler
+           from optimizing the strnlen calls away.  */
+        size_t (*volatile pstrnlen) (char const *, size_t) = strnlen;
+        char const s[] = "foobar";
+        int s_len = sizeof s - 1;
+       ]],
+      [[
+        /* AIX 4.3 is buggy: strnlen (S, 1) == 3.  */
+        int i;
+        for (i = 0; i < s_len + 1; ++i)
+          {
+            int expected = i <= s_len ? i : s_len;
+            if (pstrnlen (s, i) != expected)
+              return 1;
+          }
+
+        /* Android 5.0 (API 21) strnlen ("", SIZE_MAX) incorrectly crashes.  */
+        if (pstrnlen ("", -1) != 0)
+          return 1;]])],
+   [ac_cv_func_strnlen_working=yes],
+   [ac_cv_func_strnlen_working=no],
+   [AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+         [[#if defined _AIX && !defined _AIX51
+            #error "AIX pre 5.1 is buggy"
+           #endif
+           #ifdef __ANDROID__
+            #include <android/api-level.h>
+            #if __ANDROID_API__ < 22
+             #error "Android API < 22 is buggy"
+            #endif
+           #endif
+         ]])],
+      [ac_cv_func_strnlen_working=yes],
+      [ac_cv_func_strnlen_working=no])])])
+test $ac_cv_func_strnlen_working = no && AC_LIBOBJ([strnlen])
+])# AC_FUNC_STRNLEN
+])
+
 AC_DEFUN([gl_FUNC_STRNLEN],
 [
   AC_REQUIRE([gl_STRING_H_DEFAULTS])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]