libidn-commit
[Top][All Lists]
Advanced

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

[SCM] GNU libidn branch, master, updated. libidn-1-15-26-ga903f29


From: Simon Josefsson
Subject: [SCM] GNU libidn branch, master, updated. libidn-1-15-26-ga903f29
Date: Tue, 15 Dec 2009 23:59:59 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU libidn".

http://git.savannah.gnu.org/cgit/libidn.git/commit/?id=a903f29a865cb4ba05e30f94bbf61ad495cecff1

The branch, master has been updated
       via  a903f29a865cb4ba05e30f94bbf61ad495cecff1 (commit)
       via  0ec42338d79c818d6645365707aeefef810213d6 (commit)
      from  0b13a4f93ae9a116d6613d16ca4ffb03b902d30f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a903f29a865cb4ba05e30f94bbf61ad495cecff1
Author: Simon Josefsson <address@hidden>
Date:   Wed Dec 16 00:56:31 2009 +0100

    Update gnulib files.

commit 0ec42338d79c818d6645365707aeefef810213d6
Author: Simon Josefsson <address@hidden>
Date:   Wed Dec 16 00:54:25 2009 +0100

    Update gnulib files.

-----------------------------------------------------------------------

Summary of changes:
 build-aux/arg-nonnull.h                 |   26 +
 build-aux/gnupload                      |   48 +-
 build-aux/link-warning.h                |   29 +-
 gl/Makefile.am                          |   45 +-
 gl/error.c                              |  160 +++--
 gl/error.h                              |    6 +-
 gl/getopt.c                             | 1220 +++++++++++++++---------------
 gl/getopt.in.h                          |   32 +-
 gl/getopt1.c                            |  136 ++--
 gl/getopt_int.h                         |   32 +-
 gl/gettext.h                            |   70 --
 gl/intprops.h                           |   12 +-
 gl/m4/error.m4                          |    5 +-
 gl/m4/extensions.m4                     |    4 +-
 gl/m4/getopt.m4                         |   72 ++-
 gl/m4/gnulib-common.m4                  |   10 +-
 gl/m4/gnulib-comp.m4                    |    9 +-
 gl/m4/include_next.m4                   |   78 +-
 gl/m4/longlong.m4                       |   64 +-
 gl/m4/putenv.m4                         |   10 +-
 gl/m4/setenv.m4                         |    4 +-
 gl/m4/stdbool.m4                        |  115 +++
 gl/m4/stdint.m4                         |   12 +-
 gl/m4/string_h.m4                       |   54 +-
 gl/m4/unistd_h.m4                       |    6 +-
 gl/m4/version-etc.m4                    |   10 +-
 gl/m4/warnings.m4                       |    2 +-
 gl/m4/wchar.m4                          |    4 +-
 gl/override/lib/gettext.h.diff          |   98 +++-
 gl/progname.c                           |   30 +-
 gl/progname.h                           |   12 +-
 gl/strerror.c                           |    8 +-
 gl/string.in.h                          |  107 ++--
 gl/unistd.in.h                          |  123 ++--
 gl/version-etc.c                        |   94 ++--
 gl/version-etc.h                        |   20 +-
 gltests/Makefile.am                     |   46 ++-
 gltests/malloca.c                       |   64 +-
 gltests/malloca.h                       |    8 +-
 gltests/putenv.c                        |   22 +-
 gltests/setenv.c                        |  201 +++---
 {lib/gl => gltests}/stdbool.in.h        |    8 +-
 gltests/stdint.in.h                     |    8 +-
 gltests/stdlib.in.h                     |   76 ++-
 gltests/test-environ.c                  |    4 +-
 gltests/test-getopt.c                   |   28 +-
 gltests/test-getopt.h                   |  516 +++++++------
 gltests/test-getopt_long.h              |  284 +++++---
 gltests/test-setenv.c                   |    4 +
 {lib/gltests => gltests}/test-stdbool.c |    0
 gltests/test-strerror.c                 |   16 +-
 gltests/test-unsetenv.c                 |    4 +
 gltests/test-update-copyright.sh        |    2 +-
 gltests/test-version-etc.sh             |    3 +-
 gltests/unsetenv.c                      |   22 +-
 gltests/verify.h                        |    4 +-
 gltests/wchar.in.h                      |   14 +-
 lib/gl/Makefile.am                      |   41 +-
 lib/gl/c-strcasecmp.c                   |    2 +-
 lib/gl/c-strncasecmp.c                  |    2 +-
 lib/gl/gettext.h                        |   70 --
 lib/gl/iconv.in.h                       |   11 +-
 lib/gl/iconv_open.c                     |   84 ++--
 lib/gl/m4/extensions.m4                 |    4 +-
 lib/gl/m4/gnulib-common.m4              |   10 +-
 lib/gl/m4/gnulib-comp.m4                |    5 +-
 lib/gl/m4/iconv_h.m4                    |    7 +-
 lib/gl/m4/iconv_open.m4                 |   20 +-
 lib/gl/m4/include_next.m4               |   78 +-
 lib/gl/m4/ld-version-script.m4          |    2 +-
 lib/gl/m4/lib-ld.m4                     |    6 +-
 lib/gl/m4/longlong.m4                   |   64 +-
 lib/gl/m4/stdbool.m4                    |  138 ++--
 lib/gl/m4/stdint.m4                     |   12 +-
 lib/gl/m4/string_h.m4                   |   54 +-
 lib/gl/m4/wchar.m4                      |    4 +-
 lib/gl/override/lib/gettext.h.diff      |   98 +++-
 lib/gl/stdint.in.h                      |    8 +-
 lib/gl/striconv.c                       |  310 ++++----
 lib/gl/striconv.h                       |    4 +-
 lib/gl/string.in.h                      |  107 ++--
 lib/gl/strverscmp.c                     |    4 +-
 lib/gl/wchar.in.h                       |   14 +-
 lib/gltests/Makefile.am                 |   13 +-
 lib/gltests/intprops.h                  |   12 +-
 lib/gltests/test-c-ctype.c              |  636 ++++++++--------
 lib/gltests/test-c-strcasecmp.c         |   18 +-
 lib/gltests/test-c-strncasecmp.c        |   18 +-
 lib/gltests/test-iconv.c                |   42 +-
 lib/gltests/test-striconv.c             |   24 +-
 lib/gltests/test-strverscmp.c           |   16 +-
 lib/gltests/verify.h                    |    4 +-
 maint.mk                                |   63 ++-
 93 files changed, 3365 insertions(+), 2741 deletions(-)
 create mode 100644 build-aux/arg-nonnull.h
 create mode 100644 gl/m4/stdbool.m4
 copy {lib/gl => gltests}/stdbool.in.h (94%)
 copy {lib/gltests => gltests}/test-stdbool.c (100%)

diff --git a/build-aux/arg-nonnull.h b/build-aux/arg-nonnull.h
new file mode 100644
index 0000000..24ad6b5
--- /dev/null
+++ b/build-aux/arg-nonnull.h
@@ -0,0 +1,26 @@
+/* A C macro for declaring that specific arguments must not be NULL.
+   Copyright (C) 2009 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
+   that the values passed as arguments n, ..., m must be non-NULL pointers.
+   n = 1 stands for the first argument, n = 2 for the second argument etc.  */
+#ifndef _GL_ARG_NONNULL
+# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
+#  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
+# else
+#  define _GL_ARG_NONNULL(params)
+# endif
+#endif
diff --git a/build-aux/gnupload b/build-aux/gnupload
index 002cee3..5ebacdb 100755
--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2009-11-29.20; # UTC
 
 # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation
 #
@@ -73,34 +73,28 @@ actual command line options.  Use this to keep your 
defaults.  Comments
 (#) and empty lines in $conffile are allowed.
 
 Examples:
-1. Upload automake-1.8.2b.tar.gz and automake-1.8.2b.tar.bz2 to two sites:
-  gnupload --to sources.redhat.com:~ftp/pub/automake \\
-           --to alpha.gnu.org:automake \\
-           automake-1.8.2b.tar.gz automake-1.8.2b.tar.bz2
-
-2. Same as above, but also create symbolic links to automake-latest.tar.*:
-  gnupload --to sources.redhat.com:~ftp/pub/automake \\
-           --to alpha.gnu.org:automake \\
-           --symlink-regex \\
-           automake-1.8.2b.tar.gz automake-1.8.2b.tar.bz2
-
-3. Symlink automake-1.8.2b.tar.gz to automake-latest.tar.gz and
-automake-1.8.2b.tar.bz2 to automake-latest.tar.bz2 on both sites:
+1. Upload foobar-1.0.tar.gz to ftp.gnu.org:
+  gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz
 
-  gnupload --to sources.redhat.com:~ftp/pub/automake \\
-           --to alpha.gnu.org:automake \\
-           --symlink automake-1.8.2b.tar.gz automake-latest.tar.gz \\
-                     automake-1.8.2b.tar.bz2 automake-latest.tar.bz2
+2. Upload foobar-1.0.tar.gz and foobar-1.0.tar.xz to ftp.gnu.org:
+  gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz foobar-1.0.tar.xz
 
-4. Delete automake-1.8.2a.tar.gz and .bz2, remove symlink
-automake-latest.tar.gz and upload automake-1.8.2b.tar.gz:
-
-  gnupload --to sources.redhat.com:~ftp/pub/automake \\
-           --to alpha.gnu.org:automake \\
-           --delete automake-1.8.2a.tar.gz automake-1.8.2a.tar.bz2 \\
-           --rmsymlink automake-latest.tar.gz \\
-           -- \\
-           automake-1.8.2b.tar.gz automake-1.8.2b.tar.bz2
+3. Same as above, and also create symbolic links to foobar-latest.tar.*:
+  gnupload --to ftp.gnu.org:foobar \\
+           --symlink-regex \\
+           foobar-1.0.tar.gz foobar-1.0.tar.xz
+
+4. Upload foobar-0.9.90.tar.gz to two sites:
+  gnupload --to alpha.gnu.org:foobar \\
+           --to sources.redhat.com:~ftp/pub/foobar \\
+           foobar-0.9.90.tar.gz
+
+5. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
+   (the -- terminates the list of files to delete):
+  gnupload --to alpha.gnu.org:foobar \\
+           --to sources.redhat.com:~ftp/pub/foobar \\
+           --delete oopsbar-0.9.91.tar.gz \\
+           -- foobar-0.9.91.tar.gz
 
 Report bugs to <address@hidden>.
 Send patches to <address@hidden>."
diff --git a/build-aux/link-warning.h b/build-aux/link-warning.h
index fda0194..7fefab7 100644
--- a/build-aux/link-warning.h
+++ b/build-aux/link-warning.h
@@ -1,3 +1,20 @@
+/* A C macro for emitting link time warnings.
+   Copyright (C) 1995, 1997, 2000, 2002-2003, 2007, 2009 Free Software
+   Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
 /* GL_LINK_WARNING("literal string") arranges to emit the literal string as
    a linker warning on most glibc systems.
    We use a linker warning rather than a preprocessor warning, because
@@ -15,12 +32,12 @@
 #  define GL_LINK_WARNING2(file, line, message) \
      GL_LINK_WARNING3 (file ":" #line ": warning: " message)
 #  define GL_LINK_WARNING3(message) \
-     ({ static const char warning[sizeof (message)]            \
-          __attribute__ ((__unused__,                          \
-                          __section__ (".gnu.warning"),                \
-                          __aligned__ (1)))                    \
-          = message "\n";                                      \
-        (void)0;                                               \
+     ({ static const char warning[sizeof (message)]             \
+          __attribute__ ((__unused__,                           \
+                          __section__ (".gnu.warning"),         \
+                          __aligned__ (1)))                     \
+          = message "\n";                                       \
+        (void)0;                                                \
      })
 # else
 #  define GL_LINK_WARNING(message) ((void) 0)
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 48a2b71..03072ea 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -38,6 +38,25 @@ libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
 EXTRA_libgnu_la_SOURCES =
 libgnu_la_LDFLAGS = $(AM_LDFLAGS)
 
+## begin gnulib module arg-nonnull
+
+BUILT_SOURCES += arg-nonnull.h
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
+arg-nonnull.h: $(top_srcdir)/build-aux/arg-nonnull.h
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/build-aux/arg-nonnull.h \
+         > address@hidden && \
+       mv address@hidden $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/arg-nonnull.h
+
+## end   gnulib module arg-nonnull
+
 ## begin gnulib module csharpcomp-script
 
 
@@ -94,7 +113,7 @@ BUILT_SOURCES += $(GETOPT_H)
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h
+getopt.h: getopt.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
@@ -102,6 +121,7 @@ getopt.h: getopt.in.h
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/getopt.in.h; \
        } > address@hidden && \
        mv -f address@hidden $@
@@ -145,7 +165,18 @@ EXTRA_DIST += intprops.h
 
 ## begin gnulib module link-warning
 
-LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
+BUILT_SOURCES += link-warning.h
+# The link-warning.h that gets inserted into generated .h files is the same as
+# build-aux/link-warning.h, except that it has the copyright header cut off.
+link-warning.h: $(top_srcdir)/build-aux/link-warning.h
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       sed -n -e '/GL_LINK_WARNING/,$$p' \
+         < $(top_srcdir)/build-aux/link-warning.h \
+         > address@hidden && \
+       mv address@hidden $@
+MOSTLYCLEANFILES += link-warning.h link-warning.h-t
+
+LINK_WARNING_H=link-warning.h
 
 EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h
 
@@ -229,7 +260,7 @@ BUILT_SOURCES += string.h
 
 # We need the following in order to create <string.h> when the system
 # doesn't have one that works with the given compiler.
-string.h: string.in.h
+string.h: string.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -296,6 +327,7 @@ string.h: string.in.h
              -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
              -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/string.in.h; \
        } > address@hidden && \
        mv address@hidden $@
@@ -311,7 +343,7 @@ BUILT_SOURCES += unistd.h
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
-unistd.h: unistd.in.h
+unistd.h: unistd.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
@@ -342,6 +374,7 @@ unistd.h: unistd.in.h
              -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
              -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
              -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
+             -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
              -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
              -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
              -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
@@ -372,6 +405,7 @@ unistd.h: unistd.in.h
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
              -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
              -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
+             -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
              -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
@@ -396,8 +430,10 @@ unistd.h: unistd.in.h
              -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
              -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
+             -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
              -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
+             -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
              -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
              -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
              -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
@@ -406,6 +442,7 @@ unistd.h: unistd.in.h
              -e 
's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
              -e 
's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g'
 \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/unistd.in.h; \
        } > address@hidden && \
        mv address@hidden $@
diff --git a/gl/error.c b/gl/error.c
index af2287b..71963ce 100644
--- a/gl/error.c
+++ b/gl/error.c
@@ -70,8 +70,8 @@ unsigned int error_message_count;
 extern void __error (int status, int errnum, const char *message, ...)
      __attribute__ ((__format__ (__printf__, 3, 4)));
 extern void __error_at_line (int status, int errnum, const char *file_name,
-                            unsigned int line_number, const char *message,
-                            ...)
+                             unsigned int line_number, const char *message,
+                             ...)
      __attribute__ ((__format__ (__printf__, 5, 6)));;
 # define error __error
 # define error_at_line __error_at_line
@@ -86,6 +86,7 @@ extern void __error_at_line (int status, int errnum, const 
char *file_name,
 #else /* not _LIBC */
 
 # include <fcntl.h>
+# include <unistd.h>
 
 # if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
 #  ifndef HAVE_DECL_STRERROR_R
@@ -100,8 +101,33 @@ extern char *program_name;
 
 # if HAVE_STRERROR_R || defined strerror_r
 #  define __strerror_r strerror_r
-# endif        /* HAVE_STRERROR_R || defined strerror_r */
-#endif /* not _LIBC */
+# endif /* HAVE_STRERROR_R || defined strerror_r */
+#endif  /* not _LIBC */
+
+static inline void
+flush_stdout (void)
+{
+#if !_LIBC && defined F_GETFL
+  int stdout_fd;
+
+# if GNULIB_FREOPEN_SAFER
+  /* Use of gnulib's freopen-safer module normally ensures that
+       fileno (stdout) == 1
+     whenever stdout is open.  */
+  stdout_fd = STDOUT_FILENO;
+# else
+  /* POSIX states that fileno (stdout) after fclose is unspecified.  But in
+     practice it is not a problem, because stdout is statically allocated and
+     the fd of a FILE stream is stored as a field in its allocated memory.  */
+  stdout_fd = fileno (stdout);
+# endif
+  /* POSIX states that fflush (stdout) after fclose is unspecified; it
+     is safe in glibc, but not on all other platforms.  fflush (NULL)
+     is always defined, but too draconian.  */
+  if (0 <= stdout_fd && 0 <= fcntl (stdout_fd, F_GETFL))
+#endif
+    fflush (stdout);
+}
 
 static void
 print_errno_message (int errnum)
@@ -149,58 +175,58 @@ error_tail (int status, int errnum, const char *message, 
va_list args)
       bool use_malloc = false;
 
       while (1)
-       {
-         if (__libc_use_alloca (len * sizeof (wchar_t)))
-           wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
-         else
-           {
-             if (!use_malloc)
-               wmessage = NULL;
-
-             wchar_t *p = (wchar_t *) realloc (wmessage,
-                                               len * sizeof (wchar_t));
-             if (p == NULL)
-               {
-                 free (wmessage);
-                 fputws_unlocked (L"out of memory\n", stderr);
-                 return;
-               }
-             wmessage = p;
-             use_malloc = true;
-           }
-
-         memset (&st, '\0', sizeof (st));
-         tmp = message;
-
-         res = mbsrtowcs (wmessage, &tmp, len, &st);
-         if (res != len)
-           break;
-
-         if (__builtin_expect (len >= SIZE_MAX / 2, 0))
-           {
-             /* This really should not happen if everything is fine.  */
-             res = (size_t) -1;
-             break;
-           }
-
-         len *= 2;
-       }
+        {
+          if (__libc_use_alloca (len * sizeof (wchar_t)))
+            wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
+          else
+            {
+              if (!use_malloc)
+                wmessage = NULL;
+
+              wchar_t *p = (wchar_t *) realloc (wmessage,
+                                                len * sizeof (wchar_t));
+              if (p == NULL)
+                {
+                  free (wmessage);
+                  fputws_unlocked (L"out of memory\n", stderr);
+                  return;
+                }
+              wmessage = p;
+              use_malloc = true;
+            }
+
+          memset (&st, '\0', sizeof (st));
+          tmp = message;
+
+          res = mbsrtowcs (wmessage, &tmp, len, &st);
+          if (res != len)
+            break;
+
+          if (__builtin_expect (len >= SIZE_MAX / 2, 0))
+            {
+              /* This really should not happen if everything is fine.  */
+              res = (size_t) -1;
+              break;
+            }
+
+          len *= 2;
+        }
 
       if (res == (size_t) -1)
-       {
-         /* The string cannot be converted.  */
-         if (use_malloc)
-           {
-             free (wmessage);
-             use_malloc = false;
-           }
-         wmessage = (wchar_t *) L"???";
-       }
+        {
+          /* The string cannot be converted.  */
+          if (use_malloc)
+            {
+              free (wmessage);
+              use_malloc = false;
+            }
+          wmessage = (wchar_t *) L"???";
+        }
 
       __vfwprintf (stderr, wmessage, args);
 
       if (use_malloc)
-       free (wmessage);
+        free (wmessage);
     }
   else
 #endif
@@ -235,16 +261,10 @@ error (int status, int errnum, const char *message, ...)
      cancellation.  Therefore disable cancellation for now.  */
   int state = PTHREAD_CANCEL_ENABLE;
   __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
-                  0);
+                   0);
 #endif
 
-#if !_LIBC && defined F_GETFL
-  /* POSIX states that fflush (stdout) after fclose is unspecified; it
-     is safe in glibc, but not on all other platforms.  fflush (NULL)
-     is always defined, but too draconian.  */
-  if (0 <= fcntl (1, F_GETFL))
-#endif
-  fflush (stdout);
+  flush_stdout ();
 #ifdef _LIBC
   _IO_flockfile (stderr);
 #endif
@@ -276,7 +296,7 @@ int error_one_per_line;
 
 void
 error_at_line (int status, int errnum, const char *file_name,
-              unsigned int line_number, const char *message, ...)
+               unsigned int line_number, const char *message, ...)
 {
   va_list args;
 
@@ -286,10 +306,10 @@ error_at_line (int status, int errnum, const char 
*file_name,
       static unsigned int old_line_number;
 
       if (old_line_number == line_number
-         && (file_name == old_file_name
-             || strcmp (old_file_name, file_name) == 0))
-       /* Simply return and print nothing.  */
-       return;
+          && (file_name == old_file_name
+              || strcmp (old_file_name, file_name) == 0))
+        /* Simply return and print nothing.  */
+        return;
 
       old_file_name = file_name;
       old_line_number = line_number;
@@ -300,16 +320,10 @@ error_at_line (int status, int errnum, const char 
*file_name,
      cancellation.  Therefore disable cancellation for now.  */
   int state = PTHREAD_CANCEL_ENABLE;
   __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
-                  0);
+                   0);
 #endif
 
-#if !_LIBC && defined F_GETFL
-  /* POSIX states that fflush (stdout) after fclose is unspecified; it
-     is safe in glibc, but not on all other platforms.  fflush (NULL)
-     is always defined, but too draconian.  */
-  if (0 <= fcntl (1, F_GETFL))
-#endif
-  fflush (stdout);
+  flush_stdout ();
 #ifdef _LIBC
   _IO_flockfile (stderr);
 #endif
@@ -326,10 +340,10 @@ error_at_line (int status, int errnum, const char 
*file_name,
 
 #if _LIBC
   __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ",
-             file_name, line_number);
+              file_name, line_number);
 #else
   fprintf (stderr, file_name != NULL ? "%s:%d: " : " ",
-          file_name, line_number);
+           file_name, line_number);
 #endif
 
   va_start (args, message);
diff --git a/gl/error.h b/gl/error.h
index 6d49681..1c7da3a 100644
--- a/gl/error.h
+++ b/gl/error.h
@@ -31,7 +31,7 @@
 # endif
 #endif
 
-#ifdef __cplusplus
+#ifdef __cplusplus
 extern "C" {
 #endif
 
@@ -43,7 +43,7 @@ extern void error (int __status, int __errnum, const char 
*__format, ...)
      __attribute__ ((__format__ (__printf__, 3, 4)));
 
 extern void error_at_line (int __status, int __errnum, const char *__fname,
-                          unsigned int __lineno, const char *__format, ...)
+                           unsigned int __lineno, const char *__format, ...)
      __attribute__ ((__format__ (__printf__, 5, 6)));
 
 /* If NULL, error will flush stdout, then print on stderr the program
@@ -58,7 +58,7 @@ extern unsigned int error_message_count;
    variable controls whether this mode is selected or not.  */
 extern int error_one_per_line;
 
-#ifdef __cplusplus
+#ifdef __cplusplus
 }
 #endif
 
diff --git a/gl/getopt.c b/gl/getopt.c
index 797d166..fbe7b5b 100644
--- a/gl/getopt.c
+++ b/gl/getopt.c
@@ -3,7 +3,7 @@
    "Keep this file name-space clean" means, talk to address@hidden
    before changing it!
    Copyright (C) 
1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006,2008,2009
-       Free Software Foundation, Inc.
+        Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -121,18 +121,18 @@ extern char *__getopt_nonoption_flags;
 
 # ifdef USE_NONOPTION_FLAGS
 #  define SWAP_FLAGS(ch1, ch2) \
-  if (d->__nonoption_flags_len > 0)                                          \
-    {                                                                        \
-      char __tmp = __getopt_nonoption_flags[ch1];                            \
-      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];         \
-      __getopt_nonoption_flags[ch2] = __tmp;                                 \
+  if (d->__nonoption_flags_len > 0)                                           \
+    {                                                                         \
+      char __tmp = __getopt_nonoption_flags[ch1];                             \
+      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];          \
+      __getopt_nonoption_flags[ch2] = __tmp;                                  \
     }
 # else
 #  define SWAP_FLAGS(ch1, ch2)
 # endif
-#else  /* !_LIBC */
+#else   /* !_LIBC */
 # define SWAP_FLAGS(ch1, ch2)
-#endif /* _LIBC */
+#endif  /* _LIBC */
 
 /* Exchange two adjacent subsequences of ARGV.
    One subsequence is elements [first_nonopt,last_nonopt)
@@ -163,57 +163,57 @@ exchange (char **argv, struct _getopt_data *d)
   if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len)
     {
       /* We must extend the array.  The user plays games with us and
-        presents new arguments.  */
+         presents new arguments.  */
       char *new_str = malloc (top + 1);
       if (new_str == NULL)
-       d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0;
+        d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0;
       else
-       {
-         memset (__mempcpy (new_str, __getopt_nonoption_flags,
-                            d->__nonoption_flags_max_len),
-                 '\0', top + 1 - d->__nonoption_flags_max_len);
-         d->__nonoption_flags_max_len = top + 1;
-         __getopt_nonoption_flags = new_str;
-       }
+        {
+          memset (__mempcpy (new_str, __getopt_nonoption_flags,
+                             d->__nonoption_flags_max_len),
+                  '\0', top + 1 - d->__nonoption_flags_max_len);
+          d->__nonoption_flags_max_len = top + 1;
+          __getopt_nonoption_flags = new_str;
+        }
     }
 #endif
 
   while (top > middle && middle > bottom)
     {
       if (top - middle > middle - bottom)
-       {
-         /* Bottom segment is the short one.  */
-         int len = middle - bottom;
-         register int i;
-
-         /* Swap it with the top part of the top segment.  */
-         for (i = 0; i < len; i++)
-           {
-             tem = argv[bottom + i];
-             argv[bottom + i] = argv[top - (middle - bottom) + i];
-             argv[top - (middle - bottom) + i] = tem;
-             SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
-           }
-         /* Exclude the moved bottom segment from further swapping.  */
-         top -= len;
-       }
+        {
+          /* Bottom segment is the short one.  */
+          int len = middle - bottom;
+          register int i;
+
+          /* Swap it with the top part of the top segment.  */
+          for (i = 0; i < len; i++)
+            {
+              tem = argv[bottom + i];
+              argv[bottom + i] = argv[top - (middle - bottom) + i];
+              argv[top - (middle - bottom) + i] = tem;
+              SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
+            }
+          /* Exclude the moved bottom segment from further swapping.  */
+          top -= len;
+        }
       else
-       {
-         /* Top segment is the short one.  */
-         int len = top - middle;
-         register int i;
-
-         /* Swap it with the bottom part of the bottom segment.  */
-         for (i = 0; i < len; i++)
-           {
-             tem = argv[bottom + i];
-             argv[bottom + i] = argv[middle + i];
-             argv[middle + i] = tem;
-             SWAP_FLAGS (bottom + i, middle + i);
-           }
-         /* Exclude the moved top segment from further swapping.  */
-         bottom += len;
-       }
+        {
+          /* Top segment is the short one.  */
+          int len = top - middle;
+          register int i;
+
+          /* Swap it with the bottom part of the bottom segment.  */
+          for (i = 0; i < len; i++)
+            {
+              tem = argv[bottom + i];
+              argv[bottom + i] = argv[middle + i];
+              argv[middle + i] = tem;
+              SWAP_FLAGS (bottom + i, middle + i);
+            }
+          /* Exclude the moved top segment from further swapping.  */
+          bottom += len;
+        }
     }
 
   /* Update records for the slots the non-options now occupy.  */
@@ -226,8 +226,8 @@ exchange (char **argv, struct _getopt_data *d)
 
 static const char *
 _getopt_initialize (int argc _UNUSED_PARAMETER_,
-                   char **argv _UNUSED_PARAMETER_, const char *optstring,
-                   int posixly_correct, struct _getopt_data *d)
+                    char **argv _UNUSED_PARAMETER_, const char *optstring,
+                    int posixly_correct, struct _getopt_data *d)
 {
   /* Start processing options with ARGV-element 1 (since ARGV-element 0
      is the program name); the sequence of previously skipped
@@ -261,25 +261,25 @@ _getopt_initialize (int argc _UNUSED_PARAMETER_,
       && argc == __libc_argc && argv == __libc_argv)
     {
       if (d->__nonoption_flags_max_len == 0)
-       {
-         if (__getopt_nonoption_flags == NULL
-             || __getopt_nonoption_flags[0] == '\0')
-           d->__nonoption_flags_max_len = -1;
-         else
-           {
-             const char *orig_str = __getopt_nonoption_flags;
-             int len = d->__nonoption_flags_max_len = strlen (orig_str);
-             if (d->__nonoption_flags_max_len < argc)
-               d->__nonoption_flags_max_len = argc;
-             __getopt_nonoption_flags =
-               (char *) malloc (d->__nonoption_flags_max_len);
-             if (__getopt_nonoption_flags == NULL)
-               d->__nonoption_flags_max_len = -1;
-             else
-               memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
-                       '\0', d->__nonoption_flags_max_len - len);
-           }
-       }
+        {
+          if (__getopt_nonoption_flags == NULL
+              || __getopt_nonoption_flags[0] == '\0')
+            d->__nonoption_flags_max_len = -1;
+          else
+            {
+              const char *orig_str = __getopt_nonoption_flags;
+              int len = d->__nonoption_flags_max_len = strlen (orig_str);
+              if (d->__nonoption_flags_max_len < argc)
+                d->__nonoption_flags_max_len = argc;
+              __getopt_nonoption_flags =
+                (char *) malloc (d->__nonoption_flags_max_len);
+              if (__getopt_nonoption_flags == NULL)
+                d->__nonoption_flags_max_len = -1;
+              else
+                memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
+                        '\0', d->__nonoption_flags_max_len - len);
+            }
+        }
       d->__nonoption_flags_len = d->__nonoption_flags_max_len;
     }
   else
@@ -346,8 +346,8 @@ _getopt_initialize (int argc _UNUSED_PARAMETER_,
 
 int
 _getopt_internal_r (int argc, char **argv, const char *optstring,
-                   const struct option *longopts, int *longind,
-                   int long_only, int posixly_correct, struct _getopt_data *d)
+                    const struct option *longopts, int *longind,
+                    int long_only, int posixly_correct, struct _getopt_data *d)
 {
   int print_errors = d->opterr;
   if (optstring[0] == ':')
@@ -361,9 +361,9 @@ _getopt_internal_r (int argc, char **argv, const char 
*optstring,
   if (d->optind == 0 || !d->__initialized)
     {
       if (d->optind == 0)
-       d->optind = 1;  /* Don't scan ARGV[0], the program name.  */
+        d->optind = 1;  /* Don't scan ARGV[0], the program name.  */
       optstring = _getopt_initialize (argc, argv, optstring,
-                                     posixly_correct, d);
+                                      posixly_correct, d);
       d->__initialized = 1;
     }
 
@@ -373,8 +373,8 @@ _getopt_internal_r (int argc, char **argv, const char 
*optstring,
      is only used when the used in the GNU libc.  */
 #if defined _LIBC && defined USE_NONOPTION_FLAGS
 # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \
-                     || (d->optind < d->__nonoption_flags_len                \
-                         && __getopt_nonoption_flags[d->optind] == '1'))
+                      || (d->optind < d->__nonoption_flags_len                \
+                          && __getopt_nonoption_flags[d->optind] == '1'))
 #else
 # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
 #endif
@@ -384,78 +384,78 @@ _getopt_internal_r (int argc, char **argv, const char 
*optstring,
       /* Advance to the next ARGV-element.  */
 
       /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
-        moved back by the user (who may also have changed the arguments).  */
+         moved back by the user (who may also have changed the arguments).  */
       if (d->__last_nonopt > d->optind)
-       d->__last_nonopt = d->optind;
+        d->__last_nonopt = d->optind;
       if (d->__first_nonopt > d->optind)
-       d->__first_nonopt = d->optind;
+        d->__first_nonopt = d->optind;
 
       if (d->__ordering == PERMUTE)
-       {
-         /* If we have just processed some options following some non-options,
-            exchange them so that the options come first.  */
+        {
+          /* If we have just processed some options following some non-options,
+             exchange them so that the options come first.  */
 
-         if (d->__first_nonopt != d->__last_nonopt
-             && d->__last_nonopt != d->optind)
-           exchange ((char **) argv, d);
-         else if (d->__last_nonopt != d->optind)
-           d->__first_nonopt = d->optind;
+          if (d->__first_nonopt != d->__last_nonopt
+              && d->__last_nonopt != d->optind)
+            exchange ((char **) argv, d);
+          else if (d->__last_nonopt != d->optind)
+            d->__first_nonopt = d->optind;
 
-         /* Skip any additional non-options
-            and extend the range of non-options previously skipped.  */
+          /* Skip any additional non-options
+             and extend the range of non-options previously skipped.  */
 
-         while (d->optind < argc && NONOPTION_P)
-           d->optind++;
-         d->__last_nonopt = d->optind;
-       }
+          while (d->optind < argc && NONOPTION_P)
+            d->optind++;
+          d->__last_nonopt = d->optind;
+        }
 
       /* The special ARGV-element `--' means premature end of options.
-        Skip it like a null option,
-        then exchange with previous non-options as if it were an option,
-        then skip everything else like a non-option.  */
+         Skip it like a null option,
+         then exchange with previous non-options as if it were an option,
+         then skip everything else like a non-option.  */
 
       if (d->optind != argc && !strcmp (argv[d->optind], "--"))
-       {
-         d->optind++;
+        {
+          d->optind++;
 
-         if (d->__first_nonopt != d->__last_nonopt
-             && d->__last_nonopt != d->optind)
-           exchange ((char **) argv, d);
-         else if (d->__first_nonopt == d->__last_nonopt)
-           d->__first_nonopt = d->optind;
-         d->__last_nonopt = argc;
+          if (d->__first_nonopt != d->__last_nonopt
+              && d->__last_nonopt != d->optind)
+            exchange ((char **) argv, d);
+          else if (d->__first_nonopt == d->__last_nonopt)
+            d->__first_nonopt = d->optind;
+          d->__last_nonopt = argc;
 
-         d->optind = argc;
-       }
+          d->optind = argc;
+        }
 
       /* If we have done all the ARGV-elements, stop the scan
-        and back over any non-options that we skipped and permuted.  */
+         and back over any non-options that we skipped and permuted.  */
 
       if (d->optind == argc)
-       {
-         /* Set the next-arg-index to point at the non-options
-            that we previously skipped, so the caller will digest them.  */
-         if (d->__first_nonopt != d->__last_nonopt)
-           d->optind = d->__first_nonopt;
-         return -1;
-       }
+        {
+          /* Set the next-arg-index to point at the non-options
+             that we previously skipped, so the caller will digest them.  */
+          if (d->__first_nonopt != d->__last_nonopt)
+            d->optind = d->__first_nonopt;
+          return -1;
+        }
 
       /* If we have come to a non-option and did not permute it,
-        either stop the scan or describe it to the caller and pass it by.  */
+         either stop the scan or describe it to the caller and pass it by.  */
 
       if (NONOPTION_P)
-       {
-         if (d->__ordering == REQUIRE_ORDER)
-           return -1;
-         d->optarg = argv[d->optind++];
-         return 1;
-       }
+        {
+          if (d->__ordering == REQUIRE_ORDER)
+            return -1;
+          d->optarg = argv[d->optind++];
+          return 1;
+        }
 
       /* We have found another option-ARGV-element.
-        Skip the initial punctuation.  */
+         Skip the initial punctuation.  */
 
       d->__nextchar = (argv[d->optind] + 1
-                 + (longopts != NULL && argv[d->optind][1] == '-'));
+                  + (longopts != NULL && argv[d->optind][1] == '-'));
     }
 
   /* Decode the current option-ARGV-element.  */
@@ -475,8 +475,8 @@ _getopt_internal_r (int argc, char **argv, const char 
*optstring,
 
   if (longopts != NULL
       && (argv[d->optind][1] == '-'
-         || (long_only && (argv[d->optind][2]
-                           || !strchr (optstring, argv[d->optind][1])))))
+          || (long_only && (argv[d->optind][2]
+                            || !strchr (optstring, argv[d->optind][1])))))
     {
       char *nameend;
       const struct option *p;
@@ -487,251 +487,251 @@ _getopt_internal_r (int argc, char **argv, const char 
*optstring,
       int option_index;
 
       for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
-       /* Do nothing.  */ ;
+        /* Do nothing.  */ ;
 
       /* Test all long options for either exact match
-        or abbreviated matches.  */
+         or abbreviated matches.  */
       for (p = longopts, option_index = 0; p->name; p++, option_index++)
-       if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
-         {
-           if ((unsigned int) (nameend - d->__nextchar)
-               == (unsigned int) strlen (p->name))
-             {
-               /* Exact match found.  */
-               pfound = p;
-               indfound = option_index;
-               exact = 1;
-               break;
-             }
-           else if (pfound == NULL)
-             {
-               /* First nonexact match found.  */
-               pfound = p;
-               indfound = option_index;
-             }
-           else if (long_only
-                    || pfound->has_arg != p->has_arg
-                    || pfound->flag != p->flag
-                    || pfound->val != p->val)
-             /* Second or later nonexact match found.  */
-             ambig = 1;
-         }
+        if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
+          {
+            if ((unsigned int) (nameend - d->__nextchar)
+                == (unsigned int) strlen (p->name))
+              {
+                /* Exact match found.  */
+                pfound = p;
+                indfound = option_index;
+                exact = 1;
+                break;
+              }
+            else if (pfound == NULL)
+              {
+                /* First nonexact match found.  */
+                pfound = p;
+                indfound = option_index;
+              }
+            else if (long_only
+                     || pfound->has_arg != p->has_arg
+                     || pfound->flag != p->flag
+                     || pfound->val != p->val)
+              /* Second or later nonexact match found.  */
+              ambig = 1;
+          }
 
       if (ambig && !exact)
-       {
-         if (print_errors)
-           {
+        {
+          if (print_errors)
+            {
 #if defined _LIBC && defined USE_IN_LIBIO
-             char *buf;
+              char *buf;
 
-             if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"),
-                             argv[0], argv[d->optind]) >= 0)
-               {
-                 _IO_flockfile (stderr);
+              if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"),
+                              argv[0], argv[d->optind]) >= 0)
+                {
+                  _IO_flockfile (stderr);
 
-                 int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                 ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                 __fxprintf (NULL, "%s", buf);
+                  __fxprintf (NULL, "%s", buf);
 
-                 ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                 _IO_funlockfile (stderr);
+                  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                  _IO_funlockfile (stderr);
 
-                 free (buf);
-               }
+                  free (buf);
+                }
 #else
-             fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
-                      argv[0], argv[d->optind]);
+              fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
+                       argv[0], argv[d->optind]);
 #endif
-           }
-         d->__nextchar += strlen (d->__nextchar);
-         d->optind++;
-         d->optopt = 0;
-         return '?';
-       }
+            }
+          d->__nextchar += strlen (d->__nextchar);
+          d->optind++;
+          d->optopt = 0;
+          return '?';
+        }
 
       if (pfound != NULL)
-       {
-         option_index = indfound;
-         d->optind++;
-         if (*nameend)
-           {
-             /* Don't test has_arg with >, because some C compilers don't
-                allow it to be used on enums.  */
-             if (pfound->has_arg)
-               d->optarg = nameend + 1;
-             else
-               {
-                 if (print_errors)
-                   {
+        {
+          option_index = indfound;
+          d->optind++;
+          if (*nameend)
+            {
+              /* Don't test has_arg with >, because some C compilers don't
+                 allow it to be used on enums.  */
+              if (pfound->has_arg)
+                d->optarg = nameend + 1;
+              else
+                {
+                  if (print_errors)
+                    {
 #if defined _LIBC && defined USE_IN_LIBIO
-                     char *buf;
-                     int n;
+                      char *buf;
+                      int n;
 #endif
 
-                     if (argv[d->optind - 1][1] == '-')
-                       {
-                         /* --option */
+                      if (argv[d->optind - 1][1] == '-')
+                        {
+                          /* --option */
 #if defined _LIBC && defined USE_IN_LIBIO
-                         n = __asprintf (&buf, _("\
+                          n = __asprintf (&buf, _("\
 %s: option `--%s' doesn't allow an argument\n"),
-                                         argv[0], pfound->name);
+                                          argv[0], pfound->name);
 #else
-                         fprintf (stderr, _("\
+                          fprintf (stderr, _("\
 %s: option `--%s' doesn't allow an argument\n"),
-                                  argv[0], pfound->name);
+                                   argv[0], pfound->name);
 #endif
-                       }
-                     else
-                       {
-                         /* +option or -option */
+                        }
+                      else
+                        {
+                          /* +option or -option */
 #if defined _LIBC && defined USE_IN_LIBIO
-                         n = __asprintf (&buf, _("\
+                          n = __asprintf (&buf, _("\
 %s: option `%c%s' doesn't allow an argument\n"),
-                                         argv[0], argv[d->optind - 1][0],
-                                         pfound->name);
+                                          argv[0], argv[d->optind - 1][0],
+                                          pfound->name);
 #else
-                         fprintf (stderr, _("\
+                          fprintf (stderr, _("\
 %s: option `%c%s' doesn't allow an argument\n"),
-                                  argv[0], argv[d->optind - 1][0],
-                                  pfound->name);
+                                   argv[0], argv[d->optind - 1][0],
+                                   pfound->name);
 #endif
-                       }
+                        }
 
 #if defined _LIBC && defined USE_IN_LIBIO
-                     if (n >= 0)
-                       {
-                         _IO_flockfile (stderr);
+                      if (n >= 0)
+                        {
+                          _IO_flockfile (stderr);
 
-                         int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                         ((_IO_FILE *) stderr)->_flags2
-                           |= _IO_FLAGS2_NOTCANCEL;
+                          int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                          ((_IO_FILE *) stderr)->_flags2
+                            |= _IO_FLAGS2_NOTCANCEL;
 
-                         __fxprintf (NULL, "%s", buf);
+                          __fxprintf (NULL, "%s", buf);
 
-                         ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                         _IO_funlockfile (stderr);
+                          ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                          _IO_funlockfile (stderr);
 
-                         free (buf);
-                       }
+                          free (buf);
+                        }
 #endif
-                   }
-
-                 d->__nextchar += strlen (d->__nextchar);
-
-                 d->optopt = pfound->val;
-                 return '?';
-               }
-           }
-         else if (pfound->has_arg == 1)
-           {
-             if (d->optind < argc)
-               d->optarg = argv[d->optind++];
-             else
-               {
-                 if (print_errors)
-                   {
+                    }
+
+                  d->__nextchar += strlen (d->__nextchar);
+
+                  d->optopt = pfound->val;
+                  return '?';
+                }
+            }
+          else if (pfound->has_arg == 1)
+            {
+              if (d->optind < argc)
+                d->optarg = argv[d->optind++];
+              else
+                {
+                  if (print_errors)
+                    {
 #if defined _LIBC && defined USE_IN_LIBIO
-                     char *buf;
+                      char *buf;
 
-                     if (__asprintf (&buf, _("\
+                      if (__asprintf (&buf, _("\
 %s: option `%s' requires an argument\n"),
-                                     argv[0], argv[d->optind - 1]) >= 0)
-                       {
-                         _IO_flockfile (stderr);
+                                      argv[0], argv[d->optind - 1]) >= 0)
+                        {
+                          _IO_flockfile (stderr);
 
-                         int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                         ((_IO_FILE *) stderr)->_flags2
-                           |= _IO_FLAGS2_NOTCANCEL;
+                          int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                          ((_IO_FILE *) stderr)->_flags2
+                            |= _IO_FLAGS2_NOTCANCEL;
 
-                         __fxprintf (NULL, "%s", buf);
+                          __fxprintf (NULL, "%s", buf);
 
-                         ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                         _IO_funlockfile (stderr);
+                          ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                          _IO_funlockfile (stderr);
 
-                         free (buf);
-                       }
+                          free (buf);
+                        }
 #else
-                     fprintf (stderr,
-                              _("%s: option `%s' requires an argument\n"),
-                              argv[0], argv[d->optind - 1]);
+                      fprintf (stderr,
+                               _("%s: option `%s' requires an argument\n"),
+                               argv[0], argv[d->optind - 1]);
 #endif
-                   }
-                 d->__nextchar += strlen (d->__nextchar);
-                 d->optopt = pfound->val;
-                 return optstring[0] == ':' ? ':' : '?';
-               }
-           }
-         d->__nextchar += strlen (d->__nextchar);
-         if (longind != NULL)
-           *longind = option_index;
-         if (pfound->flag)
-           {
-             *(pfound->flag) = pfound->val;
-             return 0;
-           }
-         return pfound->val;
-       }
+                    }
+                  d->__nextchar += strlen (d->__nextchar);
+                  d->optopt = pfound->val;
+                  return optstring[0] == ':' ? ':' : '?';
+                }
+            }
+          d->__nextchar += strlen (d->__nextchar);
+          if (longind != NULL)
+            *longind = option_index;
+          if (pfound->flag)
+            {
+              *(pfound->flag) = pfound->val;
+              return 0;
+            }
+          return pfound->val;
+        }
 
       /* Can't find it as a long option.  If this is not getopt_long_only,
-        or the option starts with '--' or is not a valid short
-        option, then it's an error.
-        Otherwise interpret it as a short option.  */
+         or the option starts with '--' or is not a valid short
+         option, then it's an error.
+         Otherwise interpret it as a short option.  */
       if (!long_only || argv[d->optind][1] == '-'
-         || strchr (optstring, *d->__nextchar) == NULL)
-       {
-         if (print_errors)
-           {
+          || strchr (optstring, *d->__nextchar) == NULL)
+        {
+          if (print_errors)
+            {
 #if defined _LIBC && defined USE_IN_LIBIO
-             char *buf;
-             int n;
+              char *buf;
+              int n;
 #endif
 
-             if (argv[d->optind][1] == '-')
-               {
-                 /* --option */
+              if (argv[d->optind][1] == '-')
+                {
+                  /* --option */
 #if defined _LIBC && defined USE_IN_LIBIO
-                 n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"),
-                                 argv[0], d->__nextchar);
+                  n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"),
+                                  argv[0], d->__nextchar);
 #else
-                 fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
-                          argv[0], d->__nextchar);
+                  fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
+                           argv[0], d->__nextchar);
 #endif
-               }
-             else
-               {
-                 /* +option or -option */
+                }
+              else
+                {
+                  /* +option or -option */
 #if defined _LIBC && defined USE_IN_LIBIO
-                 n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"),
-                                 argv[0], argv[d->optind][0], d->__nextchar);
+                  n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"),
+                                  argv[0], argv[d->optind][0], d->__nextchar);
 #else
-                 fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
-                          argv[0], argv[d->optind][0], d->__nextchar);
+                  fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
+                           argv[0], argv[d->optind][0], d->__nextchar);
 #endif
-               }
+                }
 
 #if defined _LIBC && defined USE_IN_LIBIO
-             if (n >= 0)
-               {
-                 _IO_flockfile (stderr);
+              if (n >= 0)
+                {
+                  _IO_flockfile (stderr);
 
-                 int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                 ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                 __fxprintf (NULL, "%s", buf);
+                  __fxprintf (NULL, "%s", buf);
 
-                 ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                 _IO_funlockfile (stderr);
+                  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                  _IO_funlockfile (stderr);
 
-                 free (buf);
-               }
+                  free (buf);
+                }
 #endif
-           }
-         d->__nextchar = (char *) "";
-         d->optind++;
-         d->optopt = 0;
-         return '?';
-       }
+            }
+          d->__nextchar = (char *) "";
+          d->optind++;
+          d->optopt = 0;
+          return '?';
+        }
     }
 
   /* Look at and handle the next short option-character.  */
@@ -746,335 +746,335 @@ _getopt_internal_r (int argc, char **argv, const char 
*optstring,
 
     if (temp == NULL || c == ':')
       {
-       if (print_errors)
-         {
+        if (print_errors)
+          {
 #if defined _LIBC && defined USE_IN_LIBIO
-             char *buf;
-             int n;
+              char *buf;
+              int n;
 #endif
 
-           if (d->__posixly_correct)
-             {
-               /* 1003.2 specifies the format of this message.  */
+            if (d->__posixly_correct)
+              {
+                /* 1003.2 specifies the format of this message.  */
 #if defined _LIBC && defined USE_IN_LIBIO
-               n = __asprintf (&buf, _("%s: illegal option -- %c\n"),
-                               argv[0], c);
+                n = __asprintf (&buf, _("%s: illegal option -- %c\n"),
+                                argv[0], c);
 #else
-               fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
+                fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c);
 #endif
-             }
-           else
-             {
+              }
+            else
+              {
 #if defined _LIBC && defined USE_IN_LIBIO
-               n = __asprintf (&buf, _("%s: invalid option -- %c\n"),
-                               argv[0], c);
+                n = __asprintf (&buf, _("%s: invalid option -- %c\n"),
+                                argv[0], c);
 #else
-               fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
+                fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c);
 #endif
-             }
+              }
 
 #if defined _LIBC && defined USE_IN_LIBIO
-           if (n >= 0)
-             {
-               _IO_flockfile (stderr);
+            if (n >= 0)
+              {
+                _IO_flockfile (stderr);
 
-               int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-               ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-               __fxprintf (NULL, "%s", buf);
+                __fxprintf (NULL, "%s", buf);
 
-               ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-               _IO_funlockfile (stderr);
+                ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                _IO_funlockfile (stderr);
 
-               free (buf);
-             }
+                free (buf);
+              }
 #endif
-         }
-       d->optopt = c;
-       return '?';
+          }
+        d->optopt = c;
+        return '?';
       }
     /* Convenience. Treat POSIX -W foo same as long option --foo */
     if (temp[0] == 'W' && temp[1] == ';')
       {
-       char *nameend;
-       const struct option *p;
-       const struct option *pfound = NULL;
-       int exact = 0;
-       int ambig = 0;
-       int indfound = 0;
-       int option_index;
-
-       /* This is an option that requires an argument.  */
-       if (*d->__nextchar != '\0')
-         {
-           d->optarg = d->__nextchar;
-           /* If we end this ARGV-element by taking the rest as an arg,
-              we must advance to the next element now.  */
-           d->optind++;
-         }
-       else if (d->optind == argc)
-         {
-           if (print_errors)
-             {
-               /* 1003.2 specifies the format of this message.  */
+        char *nameend;
+        const struct option *p;
+        const struct option *pfound = NULL;
+        int exact = 0;
+        int ambig = 0;
+        int indfound = 0;
+        int option_index;
+
+        /* This is an option that requires an argument.  */
+        if (*d->__nextchar != '\0')
+          {
+            d->optarg = d->__nextchar;
+            /* If we end this ARGV-element by taking the rest as an arg,
+               we must advance to the next element now.  */
+            d->optind++;
+          }
+        else if (d->optind == argc)
+          {
+            if (print_errors)
+              {
+                /* 1003.2 specifies the format of this message.  */
 #if defined _LIBC && defined USE_IN_LIBIO
-               char *buf;
+                char *buf;
 
-               if (__asprintf (&buf,
-                               _("%s: option requires an argument -- %c\n"),
-                               argv[0], c) >= 0)
-                 {
-                   _IO_flockfile (stderr);
+                if (__asprintf (&buf,
+                                _("%s: option requires an argument -- %c\n"),
+                                argv[0], c) >= 0)
+                  {
+                    _IO_flockfile (stderr);
 
-                   int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                   ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                   __fxprintf (NULL, "%s", buf);
+                    __fxprintf (NULL, "%s", buf);
 
-                   ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                   _IO_funlockfile (stderr);
+                    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                    _IO_funlockfile (stderr);
 
-                   free (buf);
-                 }
+                    free (buf);
+                  }
 #else
-               fprintf (stderr, _("%s: option requires an argument -- %c\n"),
-                        argv[0], c);
+                fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+                         argv[0], c);
 #endif
-             }
-           d->optopt = c;
-           if (optstring[0] == ':')
-             c = ':';
-           else
-             c = '?';
-           return c;
-         }
-       else
-         /* We already incremented `d->optind' once;
-            increment it again when taking next ARGV-elt as argument.  */
-         d->optarg = argv[d->optind++];
-
-       /* optarg is now the argument, see if it's in the
-          table of longopts.  */
-
-       for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '=';
-            nameend++)
-         /* Do nothing.  */ ;
-
-       /* Test all long options for either exact match
-          or abbreviated matches.  */
-       for (p = longopts, option_index = 0; p->name; p++, option_index++)
-         if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
-           {
-             if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name))
-               {
-                 /* Exact match found.  */
-                 pfound = p;
-                 indfound = option_index;
-                 exact = 1;
-                 break;
-               }
-             else if (pfound == NULL)
-               {
-                 /* First nonexact match found.  */
-                 pfound = p;
-                 indfound = option_index;
-               }
-             else
-               /* Second or later nonexact match found.  */
-               ambig = 1;
-           }
-       if (ambig && !exact)
-         {
-           if (print_errors)
-             {
+              }
+            d->optopt = c;
+            if (optstring[0] == ':')
+              c = ':';
+            else
+              c = '?';
+            return c;
+          }
+        else
+          /* We already incremented `d->optind' once;
+             increment it again when taking next ARGV-elt as argument.  */
+          d->optarg = argv[d->optind++];
+
+        /* optarg is now the argument, see if it's in the
+           table of longopts.  */
+
+        for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '=';
+             nameend++)
+          /* Do nothing.  */ ;
+
+        /* Test all long options for either exact match
+           or abbreviated matches.  */
+        for (p = longopts, option_index = 0; p->name; p++, option_index++)
+          if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
+            {
+              if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name))
+                {
+                  /* Exact match found.  */
+                  pfound = p;
+                  indfound = option_index;
+                  exact = 1;
+                  break;
+                }
+              else if (pfound == NULL)
+                {
+                  /* First nonexact match found.  */
+                  pfound = p;
+                  indfound = option_index;
+                }
+              else
+                /* Second or later nonexact match found.  */
+                ambig = 1;
+            }
+        if (ambig && !exact)
+          {
+            if (print_errors)
+              {
 #if defined _LIBC && defined USE_IN_LIBIO
-               char *buf;
+                char *buf;
 
-               if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"),
-                               argv[0], argv[d->optind]) >= 0)
-                 {
-                   _IO_flockfile (stderr);
+                if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"),
+                                argv[0], argv[d->optind]) >= 0)
+                  {
+                    _IO_flockfile (stderr);
 
-                   int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                   ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                   __fxprintf (NULL, "%s", buf);
+                    __fxprintf (NULL, "%s", buf);
 
-                   ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                   _IO_funlockfile (stderr);
+                    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                    _IO_funlockfile (stderr);
 
-                   free (buf);
-                 }
+                    free (buf);
+                  }
 #else
-               fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
-                        argv[0], argv[d->optind]);
+                fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
+                         argv[0], argv[d->optind]);
 #endif
-             }
-           d->__nextchar += strlen (d->__nextchar);
-           d->optind++;
-           return '?';
-         }
-       if (pfound != NULL)
-         {
-           option_index = indfound;
-           if (*nameend)
-             {
-               /* Don't test has_arg with >, because some C compilers don't
-                  allow it to be used on enums.  */
-               if (pfound->has_arg)
-                 d->optarg = nameend + 1;
-               else
-                 {
-                   if (print_errors)
-                     {
+              }
+            d->__nextchar += strlen (d->__nextchar);
+            d->optind++;
+            return '?';
+          }
+        if (pfound != NULL)
+          {
+            option_index = indfound;
+            if (*nameend)
+              {
+                /* Don't test has_arg with >, because some C compilers don't
+                   allow it to be used on enums.  */
+                if (pfound->has_arg)
+                  d->optarg = nameend + 1;
+                else
+                  {
+                    if (print_errors)
+                      {
 #if defined _LIBC && defined USE_IN_LIBIO
-                       char *buf;
+                        char *buf;
 
-                       if (__asprintf (&buf, _("\
+                        if (__asprintf (&buf, _("\
 %s: option `-W %s' doesn't allow an argument\n"),
-                                       argv[0], pfound->name) >= 0)
-                         {
-                           _IO_flockfile (stderr);
+                                        argv[0], pfound->name) >= 0)
+                          {
+                            _IO_flockfile (stderr);
 
-                           int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                           ((_IO_FILE *) stderr)->_flags2
-                             |= _IO_FLAGS2_NOTCANCEL;
+                            int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                            ((_IO_FILE *) stderr)->_flags2
+                              |= _IO_FLAGS2_NOTCANCEL;
 
-                           __fxprintf (NULL, "%s", buf);
+                            __fxprintf (NULL, "%s", buf);
 
-                           ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                           _IO_funlockfile (stderr);
+                            ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                            _IO_funlockfile (stderr);
 
-                           free (buf);
-                         }
+                            free (buf);
+                          }
 #else
-                       fprintf (stderr, _("\
+                        fprintf (stderr, _("\
 %s: option `-W %s' doesn't allow an argument\n"),
-                                argv[0], pfound->name);
+                                 argv[0], pfound->name);
 #endif
-                     }
-
-                   d->__nextchar += strlen (d->__nextchar);
-                   return '?';
-                 }
-             }
-           else if (pfound->has_arg == 1)
-             {
-               if (d->optind < argc)
-                 d->optarg = argv[d->optind++];
-               else
-                 {
-                   if (print_errors)
-                     {
+                      }
+
+                    d->__nextchar += strlen (d->__nextchar);
+                    return '?';
+                  }
+              }
+            else if (pfound->has_arg == 1)
+              {
+                if (d->optind < argc)
+                  d->optarg = argv[d->optind++];
+                else
+                  {
+                    if (print_errors)
+                      {
 #if defined _LIBC && defined USE_IN_LIBIO
-                       char *buf;
+                        char *buf;
 
-                       if (__asprintf (&buf, _("\
+                        if (__asprintf (&buf, _("\
 %s: option `%s' requires an argument\n"),
-                                       argv[0], argv[d->optind - 1]) >= 0)
-                         {
-                           _IO_flockfile (stderr);
+                                        argv[0], argv[d->optind - 1]) >= 0)
+                          {
+                            _IO_flockfile (stderr);
 
-                           int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                           ((_IO_FILE *) stderr)->_flags2
-                             |= _IO_FLAGS2_NOTCANCEL;
+                            int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                            ((_IO_FILE *) stderr)->_flags2
+                              |= _IO_FLAGS2_NOTCANCEL;
 
-                           __fxprintf (NULL, "%s", buf);
+                            __fxprintf (NULL, "%s", buf);
 
-                           ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                           _IO_funlockfile (stderr);
+                            ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                            _IO_funlockfile (stderr);
 
-                           free (buf);
-                         }
+                            free (buf);
+                          }
 #else
-                       fprintf (stderr,
-                                _("%s: option `%s' requires an argument\n"),
-                                argv[0], argv[d->optind - 1]);
+                        fprintf (stderr,
+                                 _("%s: option `%s' requires an argument\n"),
+                                 argv[0], argv[d->optind - 1]);
 #endif
-                     }
-                   d->__nextchar += strlen (d->__nextchar);
-                   return optstring[0] == ':' ? ':' : '?';
-                 }
-             }
-           d->__nextchar += strlen (d->__nextchar);
-           if (longind != NULL)
-             *longind = option_index;
-           if (pfound->flag)
-             {
-               *(pfound->flag) = pfound->val;
-               return 0;
-             }
-           return pfound->val;
-         }
-         d->__nextchar = NULL;
-         return 'W';   /* Let the application handle it.   */
+                      }
+                    d->__nextchar += strlen (d->__nextchar);
+                    return optstring[0] == ':' ? ':' : '?';
+                  }
+              }
+            d->__nextchar += strlen (d->__nextchar);
+            if (longind != NULL)
+              *longind = option_index;
+            if (pfound->flag)
+              {
+                *(pfound->flag) = pfound->val;
+                return 0;
+              }
+            return pfound->val;
+          }
+          d->__nextchar = NULL;
+          return 'W';   /* Let the application handle it.   */
       }
     if (temp[1] == ':')
       {
-       if (temp[2] == ':')
-         {
-           /* This is an option that accepts an argument optionally.  */
-           if (*d->__nextchar != '\0')
-             {
-               d->optarg = d->__nextchar;
-               d->optind++;
-             }
-           else
-             d->optarg = NULL;
-           d->__nextchar = NULL;
-         }
-       else
-         {
-           /* This is an option that requires an argument.  */
-           if (*d->__nextchar != '\0')
-             {
-               d->optarg = d->__nextchar;
-               /* If we end this ARGV-element by taking the rest as an arg,
-                  we must advance to the next element now.  */
-               d->optind++;
-             }
-           else if (d->optind == argc)
-             {
-               if (print_errors)
-                 {
-                   /* 1003.2 specifies the format of this message.  */
+        if (temp[2] == ':')
+          {
+            /* This is an option that accepts an argument optionally.  */
+            if (*d->__nextchar != '\0')
+              {
+                d->optarg = d->__nextchar;
+                d->optind++;
+              }
+            else
+              d->optarg = NULL;
+            d->__nextchar = NULL;
+          }
+        else
+          {
+            /* This is an option that requires an argument.  */
+            if (*d->__nextchar != '\0')
+              {
+                d->optarg = d->__nextchar;
+                /* If we end this ARGV-element by taking the rest as an arg,
+                   we must advance to the next element now.  */
+                d->optind++;
+              }
+            else if (d->optind == argc)
+              {
+                if (print_errors)
+                  {
+                    /* 1003.2 specifies the format of this message.  */
 #if defined _LIBC && defined USE_IN_LIBIO
-                   char *buf;
+                    char *buf;
 
-                   if (__asprintf (&buf, _("\
+                    if (__asprintf (&buf, _("\
 %s: option requires an argument -- %c\n"),
-                                   argv[0], c) >= 0)
-                     {
-                       _IO_flockfile (stderr);
+                                    argv[0], c) >= 0)
+                      {
+                        _IO_flockfile (stderr);
 
-                       int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                       ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                        int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                        ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
 
-                       __fxprintf (NULL, "%s", buf);
+                        __fxprintf (NULL, "%s", buf);
 
-                       ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                       _IO_funlockfile (stderr);
+                        ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                        _IO_funlockfile (stderr);
 
-                       free (buf);
-                     }
+                        free (buf);
+                      }
 #else
-                   fprintf (stderr,
-                            _("%s: option requires an argument -- %c\n"),
-                            argv[0], c);
+                    fprintf (stderr,
+                             _("%s: option requires an argument -- %c\n"),
+                             argv[0], c);
 #endif
-                 }
-               d->optopt = c;
-               if (optstring[0] == ':')
-                 c = ':';
-               else
-                 c = '?';
-             }
-           else
-             /* We already incremented `optind' once;
-                increment it again when taking next ARGV-elt as argument.  */
-             d->optarg = argv[d->optind++];
-           d->__nextchar = NULL;
-         }
+                  }
+                d->optopt = c;
+                if (optstring[0] == ':')
+                  c = ':';
+                else
+                  c = '?';
+              }
+            else
+              /* We already incremented `optind' once;
+                 increment it again when taking next ARGV-elt as argument.  */
+              d->optarg = argv[d->optind++];
+            d->__nextchar = NULL;
+          }
       }
     return c;
   }
@@ -1082,8 +1082,8 @@ _getopt_internal_r (int argc, char **argv, const char 
*optstring,
 
 int
 _getopt_internal (int argc, char **argv, const char *optstring,
-                 const struct option *longopts, int *longind,
-                 int long_only, int posixly_correct)
+                  const struct option *longopts, int *longind,
+                  int long_only, int posixly_correct)
 {
   int result;
 
@@ -1091,7 +1091,7 @@ _getopt_internal (int argc, char **argv, const char 
*optstring,
   getopt_data.opterr = opterr;
 
   result = _getopt_internal_r (argc, argv, optstring, longopts, longind,
-                              long_only, posixly_correct, &getopt_data);
+                               long_only, posixly_correct, &getopt_data);
 
   optind = getopt_data.optind;
   optarg = getopt_data.optarg;
@@ -1112,7 +1112,7 @@ int
 getopt (int argc, char *const *argv, const char *optstring)
 {
   return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0,
-                          POSIXLY_CORRECT);
+                           POSIXLY_CORRECT);
 }
 
 
@@ -1133,51 +1133,51 @@ main (int argc, char **argv)
 
       c = getopt (argc, argv, "abc:d:0123456789");
       if (c == -1)
-       break;
+        break;
 
       switch (c)
-       {
-       case '0':
-       case '1':
-       case '2':
-       case '3':
-       case '4':
-       case '5':
-       case '6':
-       case '7':
-       case '8':
-       case '9':
-         if (digit_optind != 0 && digit_optind != this_option_optind)
-           printf ("digits occur in two different argv-elements.\n");
-         digit_optind = this_option_optind;
-         printf ("option %c\n", c);
-         break;
-
-       case 'a':
-         printf ("option a\n");
-         break;
-
-       case 'b':
-         printf ("option b\n");
-         break;
-
-       case 'c':
-         printf ("option c with value `%s'\n", optarg);
-         break;
-
-       case '?':
-         break;
-
-       default:
-         printf ("?? getopt returned character code 0%o ??\n", c);
-       }
+        {
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+          if (digit_optind != 0 && digit_optind != this_option_optind)
+            printf ("digits occur in two different argv-elements.\n");
+          digit_optind = this_option_optind;
+          printf ("option %c\n", c);
+          break;
+
+        case 'a':
+          printf ("option a\n");
+          break;
+
+        case 'b':
+          printf ("option b\n");
+          break;
+
+        case 'c':
+          printf ("option c with value `%s'\n", optarg);
+          break;
+
+        case '?':
+          break;
+
+        default:
+          printf ("?? getopt returned character code 0%o ??\n", c);
+        }
     }
 
   if (optind < argc)
     {
       printf ("non-option ARGV-elements: ");
       while (optind < argc)
-       printf ("%s ", argv[optind++]);
+        printf ("%s ", argv[optind++]);
       printf ("\n");
     }
 
diff --git a/gl/getopt.in.h b/gl/getopt.in.h
index 7377f3c..7d74e36 100644
--- a/gl/getopt.in.h
+++ b/gl/getopt.in.h
@@ -115,12 +115,14 @@
 #  define __GNUC_PREREQ(maj, min) (0)
 # endif
 # if defined __cplusplus && __GNUC_PREREQ (2,8)
-#  define __THROW      throw ()
+#  define __THROW       throw ()
 # else
 #  define __THROW
 # endif
 #endif
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -163,9 +165,9 @@ extern int optopt;
    zero.
 
    The field `has_arg' is:
-   no_argument         (or 0) if the option does not take an argument,
-   required_argument   (or 1) if the option requires an argument,
-   optional_argument   (or 2) if the option takes an optional argument.
+   no_argument          (or 0) if the option does not take an argument,
+   required_argument    (or 1) if the option requires an argument,
+   optional_argument    (or 2) if the option takes an optional argument.
 
    If the field `flag' is not NULL, it points to a variable that is set
    to the value given in the field `val' when the option is found, but
@@ -190,10 +192,10 @@ struct option
 
 /* Names for the values of the `has_arg' field of `struct option'.  */
 
-# define no_argument           0
-# define required_argument     1
-# define optional_argument     2
-#endif /* need getopt */
+# define no_argument            0
+# define required_argument      1
+# define optional_argument      2
+#endif  /* need getopt */
 
 
 /* Get definitions and prototypes for functions to process the
@@ -222,17 +224,17 @@ struct option
    the environment, then do not permute arguments.  */
 
 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
-       __THROW;
+       __THROW _GL_ARG_NONNULL ((2, 3));
 
 #ifndef __need_getopt
 extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
-                       const char *__shortopts,
-                       const struct option *__longopts, int *__longind)
-       __THROW;
+                        const char *__shortopts,
+                        const struct option *__longopts, int *__longind)
+       __THROW _GL_ARG_NONNULL ((2, 3));
 extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
-                            const char *__shortopts,
-                            const struct option *__longopts, int *__longind)
-       __THROW;
+                             const char *__shortopts,
+                             const struct option *__longopts, int *__longind)
+       __THROW _GL_ARG_NONNULL ((2, 3));
 
 #endif
 
diff --git a/gl/getopt1.c b/gl/getopt1.c
index ba115c4..c3179c5 100644
--- a/gl/getopt1.c
+++ b/gl/getopt1.c
@@ -32,25 +32,25 @@
 #include <stdlib.h>
 #endif
 
-#ifndef        NULL
+#ifndef NULL
 #define NULL 0
 #endif
 
 int
 getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
-            const struct option *long_options, int *opt_index)
+             const struct option *long_options, int *opt_index)
 {
   return _getopt_internal (argc, (char **) argv, options, long_options,
-                          opt_index, 0, 0);
+                           opt_index, 0, 0);
 }
 
 int
 _getopt_long_r (int argc, char **argv, const char *options,
-               const struct option *long_options, int *opt_index,
-               struct _getopt_data *d)
+                const struct option *long_options, int *opt_index,
+                struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                            0, 0, d);
+                             0, 0, d);
 }
 
 /* Like getopt_long, but '-' as well as '--' can indicate a long option.
@@ -60,20 +60,20 @@ _getopt_long_r (int argc, char **argv, const char *options,
 
 int
 getopt_long_only (int argc, char *__getopt_argv_const *argv,
-                 const char *options,
-                 const struct option *long_options, int *opt_index)
+                  const char *options,
+                  const struct option *long_options, int *opt_index)
 {
   return _getopt_internal (argc, (char **) argv, options, long_options,
-                          opt_index, 1, 0);
+                           opt_index, 1, 0);
 }
 
 int
 _getopt_long_only_r (int argc, char **argv, const char *options,
-                    const struct option *long_options, int *opt_index,
-                    struct _getopt_data *d)
+                     const struct option *long_options, int *opt_index,
+                     struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                            1, 0, d);
+                             1, 0, d);
 }
 
 
@@ -93,74 +93,74 @@ main (int argc, char **argv)
       int option_index = 0;
       static const struct option long_options[] =
       {
-       {"add", 1, 0, 0},
-       {"append", 0, 0, 0},
-       {"delete", 1, 0, 0},
-       {"verbose", 0, 0, 0},
-       {"create", 0, 0, 0},
-       {"file", 1, 0, 0},
-       {0, 0, 0, 0}
+        {"add", 1, 0, 0},
+        {"append", 0, 0, 0},
+        {"delete", 1, 0, 0},
+        {"verbose", 0, 0, 0},
+        {"create", 0, 0, 0},
+        {"file", 1, 0, 0},
+        {0, 0, 0, 0}
       };
 
       c = getopt_long (argc, argv, "abc:d:0123456789",
-                      long_options, &option_index);
+                       long_options, &option_index);
       if (c == -1)
-       break;
+        break;
 
       switch (c)
-       {
-       case 0:
-         printf ("option %s", long_options[option_index].name);
-         if (optarg)
-           printf (" with arg %s", optarg);
-         printf ("\n");
-         break;
-
-       case '0':
-       case '1':
-       case '2':
-       case '3':
-       case '4':
-       case '5':
-       case '6':
-       case '7':
-       case '8':
-       case '9':
-         if (digit_optind != 0 && digit_optind != this_option_optind)
-           printf ("digits occur in two different argv-elements.\n");
-         digit_optind = this_option_optind;
-         printf ("option %c\n", c);
-         break;
-
-       case 'a':
-         printf ("option a\n");
-         break;
-
-       case 'b':
-         printf ("option b\n");
-         break;
-
-       case 'c':
-         printf ("option c with value `%s'\n", optarg);
-         break;
-
-       case 'd':
-         printf ("option d with value `%s'\n", optarg);
-         break;
-
-       case '?':
-         break;
-
-       default:
-         printf ("?? getopt returned character code 0%o ??\n", c);
-       }
+        {
+        case 0:
+          printf ("option %s", long_options[option_index].name);
+          if (optarg)
+            printf (" with arg %s", optarg);
+          printf ("\n");
+          break;
+
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+          if (digit_optind != 0 && digit_optind != this_option_optind)
+            printf ("digits occur in two different argv-elements.\n");
+          digit_optind = this_option_optind;
+          printf ("option %c\n", c);
+          break;
+
+        case 'a':
+          printf ("option a\n");
+          break;
+
+        case 'b':
+          printf ("option b\n");
+          break;
+
+        case 'c':
+          printf ("option c with value `%s'\n", optarg);
+          break;
+
+        case 'd':
+          printf ("option d with value `%s'\n", optarg);
+          break;
+
+        case '?':
+          break;
+
+        default:
+          printf ("?? getopt returned character code 0%o ??\n", c);
+        }
     }
 
   if (optind < argc)
     {
       printf ("non-option ARGV-elements: ");
       while (optind < argc)
-       printf ("%s ", argv[optind++]);
+        printf ("%s ", argv[optind++]);
       printf ("\n");
     }
 
diff --git a/gl/getopt_int.h b/gl/getopt_int.h
index 69cdf0d..18465bc 100644
--- a/gl/getopt_int.h
+++ b/gl/getopt_int.h
@@ -17,14 +17,14 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _GETOPT_INT_H
-#define _GETOPT_INT_H  1
+#define _GETOPT_INT_H   1
 
 #include <getopt.h>
 
 extern int _getopt_internal (int ___argc, char **___argv,
-                            const char *__shortopts,
-                            const struct option *__longopts, int *__longind,
-                            int __long_only, int __posixly_correct);
+                             const char *__shortopts,
+                             const struct option *__longopts, int *__longind,
+                             int __long_only, int __posixly_correct);
 
 
 /* Reentrant versions which can handle parsing multiple argument
@@ -110,23 +110,23 @@ struct _getopt_data
 
 /* The initializer is necessary to set OPTIND and OPTERR to their
    default values and to clear the initialization flag.  */
-#define _GETOPT_DATA_INITIALIZER       { 1, 1 }
+#define _GETOPT_DATA_INITIALIZER        { 1, 1 }
 
 extern int _getopt_internal_r (int ___argc, char **___argv,
-                              const char *__shortopts,
-                              const struct option *__longopts, int *__longind,
-                              int __long_only, int __posixly_correct,
-                              struct _getopt_data *__data);
+                               const char *__shortopts,
+                               const struct option *__longopts, int *__longind,
+                               int __long_only, int __posixly_correct,
+                               struct _getopt_data *__data);
 
 extern int _getopt_long_r (int ___argc, char **___argv,
-                          const char *__shortopts,
-                          const struct option *__longopts, int *__longind,
-                          struct _getopt_data *__data);
+                           const char *__shortopts,
+                           const struct option *__longopts, int *__longind,
+                           struct _getopt_data *__data);
 
 extern int _getopt_long_only_r (int ___argc, char **___argv,
-                               const char *__shortopts,
-                               const struct option *__longopts,
-                               int *__longind,
-                               struct _getopt_data *__data);
+                                const char *__shortopts,
+                                const struct option *__longopts,
+                                int *__longind,
+                                struct _getopt_data *__data);
 
 #endif /* getopt_int.h */
diff --git a/gl/gettext.h b/gl/gettext.h
index 41c0ae1..b96b063 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -101,74 +101,4 @@
    initializer for static 'char[]' or 'const char[]' variables.  */
 #define gettext_noop(String) String
 
-/* The separator between msgctxt and msgid in a .mo file.  */
-#define GETTEXT_CONTEXT_GLUE "\004"
-
-/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
-   MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
-   short and rarely need to change.
-   The letter 'p' stands for 'particular' or 'special'.  */
-#ifdef DEFAULT_TEXT_DOMAIN
-# define pgettext(Msgctxt, Msgid) \
-   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, LC_MESSAGES)
-#else
-# define pgettext(Msgctxt, Msgid) \
-   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
-#endif
-#define dpgettext(Domainname, Msgctxt, Msgid) \
-  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
-#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
-  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
Category)
-#ifdef DEFAULT_TEXT_DOMAIN
-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
-   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, MsgidPlural, N, LC_MESSAGES)
-#else
-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
-   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
-#endif
-#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
-  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
-#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
-  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, Category)
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static const char *
-pgettext_aux (const char *domain,
-             const char *msg_ctxt_id, const char *msgid,
-             int category)
-{
-  const char *translation = dcgettext (domain, msg_ctxt_id, category);
-  if (translation == msg_ctxt_id)
-    return msgid;
-  else
-    return translation;
-}
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static const char *
-npgettext_aux (const char *domain,
-              const char *msg_ctxt_id, const char *msgid,
-              const char *msgid_plural, unsigned long int n,
-              int category)
-{
-  const char *translation =
-    dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
-  if (translation == msg_ctxt_id || translation == msgid_plural)
-    return (n == 1 ? msgid : msgid_plural);
-  else
-    return translation;
-}
-
 #endif /* _LIBGETTEXT_H */
diff --git a/gl/intprops.h b/gl/intprops.h
index 325c397..a0f4669 100644
--- a/gl/intprops.h
+++ b/gl/intprops.h
@@ -47,14 +47,14 @@
    your host.  */
 # define TYPE_MINIMUM(t) \
   ((t) (! TYPE_SIGNED (t) \
-       ? (t) 0 \
-       : TYPE_SIGNED_MAGNITUDE (t) \
-       ? ~ (t) 0 \
-       : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+        ? (t) 0 \
+        : TYPE_SIGNED_MAGNITUDE (t) \
+        ? ~ (t) 0 \
+        : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
 # define TYPE_MAXIMUM(t) \
   ((t) (! TYPE_SIGNED (t) \
-       ? (t) -1 \
-       : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+        ? (t) -1 \
+        : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
 
 /* Return zero if T can be determined to be an unsigned type.
    Otherwise, return 1.
diff --git a/gl/m4/error.m4 b/gl/m4/error.m4
index 7c7746e..243dbda 100644
--- a/gl/m4/error.m4
+++ b/gl/m4/error.m4
@@ -1,6 +1,6 @@
-#serial 11
+#serial 12
 
-# Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004 Free Software
+# Copyright (C) 1996-1998, 2001-2004, 2009 Free Software
 # Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -18,5 +18,6 @@ AC_DEFUN([gl_ERROR],
 AC_DEFUN([gl_PREREQ_ERROR],
 [
   AC_REQUIRE([AC_FUNC_STRERROR_R])
+  AC_REQUIRE([AC_C_INLINE])
   :
 ])
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index ba6d5e1..99fba9f 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -74,8 +74,8 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
     [ac_cv_safe_to_define___extensions__],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[
-#        define __EXTENSIONS__ 1
-         ]AC_INCLUDES_DEFAULT])],
+#         define __EXTENSIONS__ 1
+          ]AC_INCLUDES_DEFAULT])],
        [ac_cv_safe_to_define___extensions__=yes],
        [ac_cv_safe_to_define___extensions__=no])])
   test $ac_cv_safe_to_define___extensions__ = yes &&
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index 8f0c36c..5809816 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 23
+# getopt.m4 serial 24
 dnl Copyright (C) 2002-2006, 2008-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -75,11 +75,13 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
     AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
   fi
 
-  dnl BSD getopt_long uses an incompatible method to reset option processing,
-  dnl but the testsuite does not show a need to use this 'optreset' variable.
-  if false && test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; 
then
-    AC_CHECK_DECL([optreset], [gl_replace_getopt=yes], [],
-      [#include <getopt.h>])
+  dnl BSD getopt_long uses an incompatible method to reset option processing.
+  dnl Existence of the variable, in and of itself, is not a reason to replace
+  dnl getopt, but knowledge of the variable is needed to determine how to
+  dnl reset and whether a reset reparses the environment.
+  if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+    AC_CHECK_DECLS([optreset], [], [],
+      [[#include <getopt.h>]])
   fi
 
   dnl mingw's getopt (in libmingwex.a) does weird things when the options
@@ -96,9 +98,7 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 #include <stdlib.h>
 #include <string.h>
 
-/* The glibc implementation of getopt supports setting optind = 0 as a means
-   of clearing the internal state, but other implementations don't.  */
-#if (__GLIBC__ >= 2)
+#if !HAVE_DECL_OPTRESET
 # define OPTIND_MIN 0
 #else
 # define OPTIND_MIN 1
@@ -116,6 +116,7 @@ main ()
     argv[argc++] = "-a";
     argv[argc++] = "foo";
     argv[argc++] = "bar";
+    argv[argc] = NULL;
     optind = OPTIND_MIN;
     opterr = 0;
 
@@ -141,6 +142,7 @@ main ()
     argv[argc++] = "duck";
     argv[argc++] = "-a";
     argv[argc++] = "bar";
+    argv[argc] = NULL;
     optind = OPTIND_MIN;
     opterr = 0;
 
@@ -182,11 +184,22 @@ main ()
 
   if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
     AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu],
-      [AC_RUN_IFELSE(
-       [AC_LANG_PROGRAM([[#include <getopt.h>
-                          #include <stddef.h>
-                          #include <string.h>]],
-          [[
+      [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
+       # optstring is necessary for programs like m4 that have POSIX-mandated
+       # semantics for supporting options interspersed with files.
+       gl_had_POSIXLY_CORRECT=${POSIXLY_CORRECT:+yes}
+       POSIXLY_CORRECT=1
+       export POSIXLY_CORRECT
+       AC_RUN_IFELSE(
+        [AC_LANG_PROGRAM([[#include <getopt.h>
+                           #include <stddef.h>
+                           #include <string.h>
+#if !HAVE_DECL_OPTRESET
+# define OPTIND_MIN 0
+#else
+# define OPTIND_MIN (optreset = 1)
+#endif
+           ]], [[
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
                 and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
                 OSF/1 5.1, Solaris 10.  */
@@ -201,9 +214,9 @@ main ()
              }
              /* This code succeeds on glibc 2.8, mingw,
                 and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
-                IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin.  */
+                IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
              {
-               char *argv[] = { "program", "-p", "foo", "bar" };
+               char *argv[] = { "program", "-p", "foo", "bar", NULL };
 
                optind = 1;
                if (getopt (4, argv, "p::") != 'p')
@@ -215,16 +228,29 @@ main ()
                if (optind != 2)
                  return 5;
              }
+             /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
+             {
+               char *argv[] = { "program", "foo", "-p", NULL };
+               optind = OPTIND_MIN;
+               if (getopt (3, argv, "-p") != 1)
+                 return 6;
+               if (getopt (3, argv, "-p") != 'p')
+                 return 7;
+             }
              return 0;
-          ]])],
-       [gl_cv_func_getopt_gnu=yes],
-       [gl_cv_func_getopt_gnu=no],
-       [dnl Cross compiling. Guess based on host and declarations.
-         case "$host_os" in
-           *-gnu* | mingw*) gl_cv_func_getopt_gnu=no;;
-           *)               gl_cv_func_getopt_gnu=yes;;
+           ]])],
+        [gl_cv_func_getopt_gnu=yes],
+        [gl_cv_func_getopt_gnu=no],
+        [dnl Cross compiling. Guess based on host and declarations.
+         case $host_os:$ac_cv_have_decl_optreset in
+           *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
+           *:yes)               gl_cv_func_getopt_gnu=no;;
+           *)                   gl_cv_func_getopt_gnu=yes;;
          esac
         ])
+       if test "$gl_had_POSIXLY_CORRECT" != yes; then
+         AS_UNSET([POSIXLY_CORRECT])
+       fi
       ])
     if test "$gl_cv_func_getopt_gnu" = "no"; then
       gl_replace_getopt=yes
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index c8fda20..75da53d 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -70,13 +70,13 @@ AC_DEFUN([AC_C_RESTRICT],
    for ac_kw in __restrict __restrict__ _Restrict restrict; do
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
       [[typedef int * int_ptr;
-       int foo (int_ptr $ac_kw ip) {
-       return ip[0];
+        int foo (int_ptr $ac_kw ip) {
+        return ip[0];
        }]],
       [[int s[1];
-       int * $ac_kw t = s;
-       t[0] = 0;
-       return foo(t)]])],
+        int * $ac_kw t = s;
+        t[0] = 0;
+        return foo(t)]])],
       [ac_cv_c_restrict=$ac_kw])
      test "$ac_cv_c_restrict" != no && break
    done
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 75f4813..fdd0b84 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -102,7 +102,7 @@ AC_DEFUN([gl_INIT],
     if test -n "$gl_LIBOBJS"; then
       # Remove the extension.
       sed_drop_objext='s/\.o$//;s/\.obj$//'
-      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed 
"$sed_drop_objext" | sort | uniq`; do
+      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e 
"$sed_drop_objext" | sort | uniq`; do
         gl_libobjs="$gl_libobjs $i.$ac_objext"
         gl_ltlibobjs="$gl_ltlibobjs $i.lo"
       done
@@ -130,6 +130,7 @@ AC_DEFUN([gl_INIT],
   gl_STDLIB_MODULE_INDICATOR([putenv])
   gl_FUNC_SETENV
   gl_STDLIB_MODULE_INDICATOR([setenv])
+  AM_STDBOOL_H
   gl_STDINT_H
   gt_TYPE_WCHAR_T
   gt_TYPE_WINT_T
@@ -163,7 +164,7 @@ AC_DEFUN([gl_INIT],
     if test -n "$gltests_LIBOBJS"; then
       # Remove the extension.
       sed_drop_objext='s/\.o$//;s/\.obj$//'
-      for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed 
"$sed_drop_objext" | sort | uniq`; do
+      for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e 
"$sed_drop_objext" | sort | uniq`; do
         gltests_libobjs="$gltests_libobjs $i.$ac_objext"
         gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
       done
@@ -232,6 +233,7 @@ AC_DEFUN([gltests_LIBSOURCES], [
 # This macro records the list of files which have been installed by
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
+  build-aux/arg-nonnull.h
   build-aux/csharpcomp.sh.in
   build-aux/gendocs.sh
   build-aux/gnupload
@@ -284,6 +286,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/putenv.m4
   m4/setenv.m4
   m4/stdarg.m4
+  m4/stdbool.m4
   m4/stddef_h.m4
   m4/stdint.m4
   m4/stdlib_h.m4
@@ -303,6 +306,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-getopt_long.h
   tests/test-malloca.c
   tests/test-setenv.c
+  tests/test-stdbool.c
   tests/test-stddef.c
   tests/test-stdint.c
   tests/test-stdlib.c
@@ -323,6 +327,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests=lib/malloca.valgrind
   tests=lib/putenv.c
   tests=lib/setenv.c
+  tests=lib/stdbool.in.h
   tests=lib/stdint.in.h
   tests=lib/stdlib.in.h
   tests=lib/unsetenv.c
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index 5e22ded..2e6273f 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -109,11 +109,11 @@ EOF
 # be
 # '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
 # That way, a header file with the following line:
-#      address@hidden@ @NEXT_FOO_H@
+#       address@hidden@ @NEXT_FOO_H@
 # or
-#      address@hidden@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
+#       address@hidden@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
 # behaves (after sed substitution) as if it contained
-#      #include_next <foo.h>
+#       #include_next <foo.h>
 # even if the compiler does not support include_next.
 # The three "///" are to pacify Sun C 5.8, which otherwise would say
 # "warning: #include of /usr/include/... may be non-portable".
@@ -129,46 +129,46 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
 
   m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
-                   [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
+                    [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
      if test $gl_cv_have_include_next = yes; then
        AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
      else
        AC_CACHE_CHECK(
-        [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
-        m4_defn([gl_next_header]),
-        [AS_VAR_PUSHDEF([gl_header_exists],
-                        [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
-         if test AS_VAR_GET(gl_header_exists) = yes; then
-           AC_LANG_CONFTEST(
-             [AC_LANG_SOURCE(
-                [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
-              )])
-           dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
-           dnl that contain only a #include of other header files and no
-           dnl non-comment tokens of their own. This leads to a failure to
-           dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
-           dnl and others. The workaround is to force preservation of comments
-           dnl through option -C. This ensures all necessary #line directives
-           dnl are present. GCC supports option -C as well.
-           case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-           dnl eval is necessary to expand gl_absname_cpp.
-           dnl Ultrix and Pyramid sh refuse to redirect output of eval,
-           dnl so use subshell.
-           AS_VAR_SET([gl_next_header],
-             ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 
2>&AS_MESSAGE_LOG_FD |
-              sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
-                s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'])
-         else
-           AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
-         fi
-         AS_VAR_POPDEF([gl_header_exists])])
+         [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+         m4_defn([gl_next_header]),
+         [AS_VAR_PUSHDEF([gl_header_exists],
+                         [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+          if test AS_VAR_GET(gl_header_exists) = yes; then
+            AC_LANG_CONFTEST(
+              [AC_LANG_SOURCE(
+                 [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
+               )])
+            dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
+            dnl that contain only a #include of other header files and no
+            dnl non-comment tokens of their own. This leads to a failure to
+            dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
+            dnl and others. The workaround is to force preservation of comments
+            dnl through option -C. This ensures all necessary #line directives
+            dnl are present. GCC supports option -C as well.
+            case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+            dnl eval is necessary to expand gl_absname_cpp.
+            dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+            dnl so use subshell.
+            AS_VAR_SET([gl_next_header],
+              ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 
2>&AS_MESSAGE_LOG_FD |
+               sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+                 s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'])
+          else
+            AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+          fi
+          AS_VAR_POPDEF([gl_header_exists])])
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
diff --git a/gl/m4/longlong.m4 b/gl/m4/longlong.m4
index eedc8d5..6d17ea3 100644
--- a/gl/m4/longlong.m4
+++ b/gl/m4/longlong.m4
@@ -20,30 +20,30 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
     [AC_LINK_IFELSE(
        [_AC_TYPE_LONG_LONG_SNIPPET],
        [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
-       dnl If cross compiling, assume the bug isn't important, since
-       dnl nobody cross compiles for this platform as far as we know.
-       AC_RUN_IFELSE(
-         [AC_LANG_PROGRAM(
-            address@hidden:@include <limits.h>
-              @%:@ifndef LLONG_MAX
-              @%:@ define HALF \
-                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-              @%:@ define LLONG_MAX (HALF - 1 + HALF)
-              @%:@endif]],
-            [[long long int n = 1;
-              int i;
-              for (i = 0; ; i++)
-                {
-                  long long int m = n << i;
-                  if (m >> i != n)
-                    return 1;
-                  if (LLONG_MAX / 2 < m)
-                    break;
-                }
-              return 0;]])],
-         [ac_cv_type_long_long_int=yes],
-         [ac_cv_type_long_long_int=no],
-         [ac_cv_type_long_long_int=yes])],
+        dnl If cross compiling, assume the bug isn't important, since
+        dnl nobody cross compiles for this platform as far as we know.
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+             address@hidden:@include <limits.h>
+               @%:@ifndef LLONG_MAX
+               @%:@ define HALF \
+                        (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+               @%:@ define LLONG_MAX (HALF - 1 + HALF)
+               @%:@endif]],
+             [[long long int n = 1;
+               int i;
+               for (i = 0; ; i++)
+                 {
+                   long long int m = n << i;
+                   if (m >> i != n)
+                     return 1;
+                   if (LLONG_MAX / 2 < m)
+                     break;
+                 }
+               return 0;]])],
+          [ac_cv_type_long_long_int=yes],
+          [ac_cv_type_long_long_int=no],
+          [ac_cv_type_long_long_int=yes])],
        [ac_cv_type_long_long_int=no])])
   if test $ac_cv_type_long_long_int = yes; then
     AC_DEFINE([HAVE_LONG_LONG_INT], [1],
@@ -83,24 +83,24 @@ AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
 [
   AC_LANG_PROGRAM(
     [[/* For now, do not test the preprocessor; as of 2007 there are too many
-        implementations with broken preprocessors.  Perhaps this can
-        be revisited in 2012.  In the meantime, code should not expect
-        #if to work with literals wider than 32 bits.  */
+         implementations with broken preprocessors.  Perhaps this can
+         be revisited in 2012.  In the meantime, code should not expect
+         #if to work with literals wider than 32 bits.  */
       /* Test literals.  */
       long long int ll = 9223372036854775807ll;
       long long int nll = -9223372036854775807LL;
       unsigned long long int ull = 18446744073709551615ULL;
       /* Test constant expressions.   */
       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       int i = 63;]],
     [[/* Test availability of runtime routines for shift and division.  */
       long long int llmax = 9223372036854775807ll;
       unsigned long long int ullmax = 18446744073709551615ull;
       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-             | (llmax / ll) | (llmax % ll)
-             | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-             | (ullmax / ull) | (ullmax % ull));]])
+              | (llmax / ll) | (llmax % ll)
+              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+              | (ullmax / ull) | (ullmax % ull));]])
 ])
diff --git a/gl/m4/putenv.m4 b/gl/m4/putenv.m4
index 120f5a4..e04f864 100644
--- a/gl/m4/putenv.m4
+++ b/gl/m4/putenv.m4
@@ -28,11 +28,11 @@ AC_DEFUN([gl_FUNC_PUTENV],
       return 1;
 
     return 0;
-             ]])],
-            gl_cv_func_svid_putenv=yes,
-            gl_cv_func_svid_putenv=no,
-            dnl When crosscompiling, assume putenv is broken.
-            gl_cv_func_svid_putenv=no)
+              ]])],
+             gl_cv_func_svid_putenv=yes,
+             gl_cv_func_svid_putenv=no,
+             dnl When crosscompiling, assume putenv is broken.
+             gl_cv_func_svid_putenv=no)
    ])
   if test $gl_cv_func_svid_putenv = no; then
     REPLACE_PUTENV=1
diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4
index a5df034..29e6866 100644
--- a/gl/m4/setenv.m4
+++ b/gl/m4/setenv.m4
@@ -1,4 +1,4 @@
-# setenv.m4 serial 13
+# setenv.m4 serial 14
 dnl Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
        #include <stdlib.h>
        #include <errno.h>
       ]], [[
-       if (setenv (NULL, "", 0) != -1) return 1;
+       if (setenv ("", "", 0) != -1) return 1;
        if (errno != EINVAL) return 2;
        if (setenv ("a", "=", 1) != 0) return 3;
        if (strcmp (getenv ("a"), "=") != 0) return 4;
diff --git a/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4
new file mode 100644
index 0000000..5e22d7a
--- /dev/null
+++ b/gl/m4/stdbool.m4
@@ -0,0 +1,115 @@
+# Check for stdbool.h that conforms to C99.
+
+dnl Copyright (C) 2002-2006, 2009 Free Software Foundation, 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.
+
+# Prepare for substituting <stdbool.h> if it is not supported.
+
+AC_DEFUN([AM_STDBOOL_H],
+[
+  AC_REQUIRE([AC_HEADER_STDBOOL])
+
+  # Define two additional variables used in the Makefile substitution.
+
+  if test "$ac_cv_header_stdbool_h" = yes; then
+    STDBOOL_H=''
+  else
+    STDBOOL_H='stdbool.h'
+  fi
+  AC_SUBST([STDBOOL_H])
+
+  if test "$ac_cv_type__Bool" = yes; then
+    HAVE__BOOL=1
+  else
+    HAVE__BOOL=0
+  fi
+  AC_SUBST([HAVE__BOOL])
+])
+
+# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
+AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
+
+# This macro is only needed in autoconf <= 2.59.  Newer versions of autoconf
+# have this macro built-in.
+
+AC_DEFUN([AC_HEADER_STDBOOL],
+  [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
+     [ac_cv_header_stdbool_h],
+     [AC_TRY_COMPILE(
+        [
+          #include <stdbool.h>
+          #ifndef bool
+           "error: bool is not defined"
+          #endif
+          #ifndef false
+           "error: false is not defined"
+          #endif
+          #if false
+           "error: false is not 0"
+          #endif
+          #ifndef true
+           "error: true is not defined"
+          #endif
+          #if true != 1
+           "error: true is not 1"
+          #endif
+          #ifndef __bool_true_false_are_defined
+           "error: __bool_true_false_are_defined is not defined"
+          #endif
+
+          struct s { _Bool s: 1; _Bool t; } s;
+
+          char a[true == 1 ? 1 : -1];
+          char b[false == 0 ? 1 : -1];
+          char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+          char d[(bool) 0.5 == true ? 1 : -1];
+          bool e = &s;
+          char f[(_Bool) 0.0 == false ? 1 : -1];
+          char g[true];
+          char h[sizeof (_Bool)];
+          char i[sizeof s.t];
+          enum { j = false, k = true, l = false * true, m = true * 256 };
+          _Bool n[m];
+          char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+          char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+          #if defined __xlc__ || defined __GNUC__
+           /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+              reported by James Lemley on 2005-10-05; see
+              
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+              This test is not quite right, since xlc is allowed to
+              reject this program, as the initializer for xlcbug is
+              not one of the forms that C requires support for.
+              However, doing the test right would require a run-time
+              test, and that would make cross-compilation harder.
+              Let us hope that IBM fixes the xlc bug, and also adds
+              support for this kind of constant expression.  In the
+              meantime, this test will reject xlc, which is OK, since
+              our stdbool.h substitute should suffice.  We also test
+              this with GCC, where it should work, to detect more
+              quickly whether someone messes up the test in the
+              future.  */
+           char digs[] = "0123456789";
+           int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+          #endif
+          /* Catch a bug in an HP-UX C compiler.  See
+             http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+             
http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+           */
+          _Bool q = true;
+          _Bool *pq = &q;
+        ],
+        [
+          *pq |= q;
+          *pq |= ! q;
+          /* Refer to every declared value, to avoid compiler optimizations.  
*/
+          return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                  + !m + !n + !o + !p + !q + !pq);
+        ],
+        [ac_cv_header_stdbool_h=yes],
+        [ac_cv_header_stdbool_h=no])])
+   AC_CHECK_TYPES([_Bool])
+   if test $ac_cv_header_stdbool_h = yes; then
+     AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to 
C99.])
+   fi])
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index a2e8bdd..819d629 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -396,12 +396,12 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
        for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
          case $glsuf in
            '')  gltype1='int';;
-           l)  gltype1='long int';;
-           ll) gltype1='long long int';;
-           i64)        gltype1='__int64';;
-           u)  gltype1='unsigned int';;
-           ul) gltype1='unsigned long int';;
-           ull)        gltype1='unsigned long long int';;
+           l)   gltype1='long int';;
+           ll)  gltype1='long long int';;
+           i64) gltype1='__int64';;
+           u)   gltype1='unsigned int';;
+           ul)  gltype1='unsigned long int';;
+           ull) gltype1='unsigned long long int';;
            ui64)gltype1='unsigned __int64';;
          esac
          AC_COMPILE_IFELSE(
diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4
index edc5c6e..e870534 100644
--- a/gl/m4/string_h.m4
+++ b/gl/m4/string_h.m4
@@ -66,31 +66,31 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_STRSIGNAL=0;   AC_SUBST([GNULIB_STRSIGNAL])
   GNULIB_STRVERSCMP=0;   AC_SUBST([GNULIB_STRVERSCMP])
   dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_DECL_MEMMEM=1;          AC_SUBST([HAVE_DECL_MEMMEM])
-  HAVE_MEMPCPY=1;              AC_SUBST([HAVE_MEMPCPY])
-  HAVE_DECL_MEMRCHR=1;         AC_SUBST([HAVE_DECL_MEMRCHR])
-  HAVE_RAWMEMCHR=1;            AC_SUBST([HAVE_RAWMEMCHR])
-  HAVE_STPCPY=1;               AC_SUBST([HAVE_STPCPY])
-  HAVE_STPNCPY=1;              AC_SUBST([HAVE_STPNCPY])
-  HAVE_STRCHRNUL=1;            AC_SUBST([HAVE_STRCHRNUL])
-  HAVE_DECL_STRDUP=1;          AC_SUBST([HAVE_DECL_STRDUP])
-  HAVE_DECL_STRNDUP=1;         AC_SUBST([HAVE_DECL_STRNDUP])
-  HAVE_DECL_STRNLEN=1;         AC_SUBST([HAVE_DECL_STRNLEN])
-  HAVE_STRPBRK=1;              AC_SUBST([HAVE_STRPBRK])
-  HAVE_STRSEP=1;               AC_SUBST([HAVE_STRSEP])
-  HAVE_STRCASESTR=1;           AC_SUBST([HAVE_STRCASESTR])
-  HAVE_DECL_STRTOK_R=1;                AC_SUBST([HAVE_DECL_STRTOK_R])
-  HAVE_DECL_STRERROR=1;                AC_SUBST([HAVE_DECL_STRERROR])
-  HAVE_DECL_STRSIGNAL=1;       AC_SUBST([HAVE_DECL_STRSIGNAL])
-  HAVE_STRVERSCMP=1;           AC_SUBST([HAVE_STRVERSCMP])
-  REPLACE_MEMCHR=0;            AC_SUBST([REPLACE_MEMCHR])
-  REPLACE_MEMMEM=0;            AC_SUBST([REPLACE_MEMMEM])
-  REPLACE_STRDUP=0;            AC_SUBST([REPLACE_STRDUP])
-  REPLACE_STRSTR=0;            AC_SUBST([REPLACE_STRSTR])
-  REPLACE_STRCASESTR=0;                AC_SUBST([REPLACE_STRCASESTR])
-  REPLACE_STRERROR=0;          AC_SUBST([REPLACE_STRERROR])
-  REPLACE_STRNDUP=0;           AC_SUBST([REPLACE_STRNDUP])
-  REPLACE_STRSIGNAL=0;         AC_SUBST([REPLACE_STRSIGNAL])
-  REPLACE_STRTOK_R=0;          AC_SUBST([REPLACE_STRTOK_R])
-  UNDEFINE_STRTOK_R=0;         AC_SUBST([UNDEFINE_STRTOK_R])
+  HAVE_DECL_MEMMEM=1;           AC_SUBST([HAVE_DECL_MEMMEM])
+  HAVE_MEMPCPY=1;               AC_SUBST([HAVE_MEMPCPY])
+  HAVE_DECL_MEMRCHR=1;          AC_SUBST([HAVE_DECL_MEMRCHR])
+  HAVE_RAWMEMCHR=1;             AC_SUBST([HAVE_RAWMEMCHR])
+  HAVE_STPCPY=1;                AC_SUBST([HAVE_STPCPY])
+  HAVE_STPNCPY=1;               AC_SUBST([HAVE_STPNCPY])
+  HAVE_STRCHRNUL=1;             AC_SUBST([HAVE_STRCHRNUL])
+  HAVE_DECL_STRDUP=1;           AC_SUBST([HAVE_DECL_STRDUP])
+  HAVE_DECL_STRNDUP=1;          AC_SUBST([HAVE_DECL_STRNDUP])
+  HAVE_DECL_STRNLEN=1;          AC_SUBST([HAVE_DECL_STRNLEN])
+  HAVE_STRPBRK=1;               AC_SUBST([HAVE_STRPBRK])
+  HAVE_STRSEP=1;                AC_SUBST([HAVE_STRSEP])
+  HAVE_STRCASESTR=1;            AC_SUBST([HAVE_STRCASESTR])
+  HAVE_DECL_STRTOK_R=1;         AC_SUBST([HAVE_DECL_STRTOK_R])
+  HAVE_DECL_STRERROR=1;         AC_SUBST([HAVE_DECL_STRERROR])
+  HAVE_DECL_STRSIGNAL=1;        AC_SUBST([HAVE_DECL_STRSIGNAL])
+  HAVE_STRVERSCMP=1;            AC_SUBST([HAVE_STRVERSCMP])
+  REPLACE_MEMCHR=0;             AC_SUBST([REPLACE_MEMCHR])
+  REPLACE_MEMMEM=0;             AC_SUBST([REPLACE_MEMMEM])
+  REPLACE_STRDUP=0;             AC_SUBST([REPLACE_STRDUP])
+  REPLACE_STRSTR=0;             AC_SUBST([REPLACE_STRSTR])
+  REPLACE_STRCASESTR=0;         AC_SUBST([REPLACE_STRCASESTR])
+  REPLACE_STRERROR=0;           AC_SUBST([REPLACE_STRERROR])
+  REPLACE_STRNDUP=0;            AC_SUBST([REPLACE_STRNDUP])
+  REPLACE_STRSIGNAL=0;          AC_SUBST([REPLACE_STRSIGNAL])
+  REPLACE_STRTOK_R=0;           AC_SUBST([REPLACE_STRTOK_R])
+  UNDEFINE_STRTOK_R=0;          AC_SUBST([UNDEFINE_STRTOK_R])
 ])
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 25bdb59..cb50d50 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 35
+# unistd_h.m4 serial 36
 dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -56,6 +56,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_LINKAT=0;           AC_SUBST([GNULIB_LINKAT])
   GNULIB_LSEEK=0;            AC_SUBST([GNULIB_LSEEK])
   GNULIB_PIPE2=0;            AC_SUBST([GNULIB_PIPE2])
+  GNULIB_PREAD=0;            AC_SUBST([GNULIB_PREAD])
   GNULIB_READLINK=0;         AC_SUBST([GNULIB_READLINK])
   GNULIB_READLINKAT=0;       AC_SUBST([GNULIB_READLINKAT])
   GNULIB_RMDIR=0;            AC_SUBST([GNULIB_RMDIR])
@@ -87,6 +88,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_LINK=1;            AC_SUBST([HAVE_LINK])
   HAVE_LINKAT=1;          AC_SUBST([HAVE_LINKAT])
   HAVE_PIPE2=1;           AC_SUBST([HAVE_PIPE2])
+  HAVE_PREAD=1;           AC_SUBST([HAVE_PREAD])
   HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
   HAVE_READLINKAT=1;      AC_SUBST([HAVE_READLINKAT])
   HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
@@ -111,8 +113,10 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_LINK=0;         AC_SUBST([REPLACE_LINK])
   REPLACE_LINKAT=0;       AC_SUBST([REPLACE_LINKAT])
   REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
+  REPLACE_PREAD=0;        AC_SUBST([REPLACE_PREAD])
   REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
   REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
+  REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
   REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
   REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
   REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])
diff --git a/gl/m4/version-etc.m4 b/gl/m4/version-etc.m4
index 14d6eb6..87389de 100644
--- a/gl/m4/version-etc.m4
+++ b/gl/m4/version-etc.m4
@@ -11,8 +11,8 @@ m4_define([gl_VERSION_ETC_FLAG],
   AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1], [$2])],
     [dnl
       case $withval in
-       yes|no) ;;
-       *) AC_DEFINE_UNQUOTED(AS_TR_CPP([PACKAGE_$1]), ["$withval"], [$2]) ;;
+        yes|no) ;;
+        *) AC_DEFINE_UNQUOTED(AS_TR_CPP([PACKAGE_$1]), ["$withval"], [$2]) ;;
       esac
     ])
 ])
@@ -20,11 +20,11 @@ m4_define([gl_VERSION_ETC_FLAG],
 AC_DEFUN([gl_VERSION_ETC],
 [dnl
   gl_VERSION_ETC_FLAG([packager],
-                     [String identifying the packager of this software])
+                      [String identifying the packager of this software])
   gl_VERSION_ETC_FLAG([packager-version],
-                     [Packager-specific version information])
+                      [Packager-specific version information])
   gl_VERSION_ETC_FLAG([packager-bug-reports],
-                     [Packager info for bug reports (URL/e-mail/...)])
+                      [Packager info for bug reports (URL/e-mail/...)])
   if test "X$with_packager" = "X" && \
      test "X$with_packager_version$with_packager_bug_reports" != "X"
   then
diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4
index c32cf4e..1639c03 100644
--- a/gl/m4/warnings.m4
+++ b/gl/m4/warnings.m4
@@ -33,7 +33,7 @@ AC_CACHE_CHECK([whether compiler handles $1], [gl_Warn], [
   CPPFLAGS="${CPPFLAGS} $1"
   AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
                     [AS_VAR_SET([gl_Warn], [yes])],
-                   [AS_VAR_SET([gl_Warn], [no])])
+                    [AS_VAR_SET([gl_Warn], [no])])
   CPPFLAGS="$save_CPPFLAGS"
 ])
 AS_VAR_PUSHDEF([gl_Flags], m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]))dnl
diff --git a/gl/m4/wchar.m4 b/gl/m4/wchar.m4
index ce53a45..9f22e33 100644
--- a/gl/m4/wchar.m4
+++ b/gl/m4/wchar.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 dnl Written by Eric Blake.
 
-# wchar.m4 serial 25
+# wchar.m4 serial 26
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -45,6 +45,8 @@ wchar_t w;]],
     HAVE_WCHAR_H=0
   fi
   AC_SUBST([HAVE_WCHAR_H])
+  dnl Execute this unconditionally, because WCHAR_H may be set by other
+  dnl modules, after this code is executed.
   gl_CHECK_NEXT_HEADERS([wchar.h])
 ])
 
diff --git a/gl/override/lib/gettext.h.diff b/gl/override/lib/gettext.h.diff
index fcd13cb..354100e 100644
--- a/gl/override/lib/gettext.h.diff
+++ b/gl/override/lib/gettext.h.diff
@@ -1,9 +1,79 @@
---- gl/gettext.h.orig  2008-11-17 17:12:20.000000000 +0100
-+++ gl/gettext.h       2008-11-17 17:12:29.000000000 +0100
-@@ -162,109 +162,4 @@
-     return translation;
- }
+--- gl/gettext.h.orig  2009-12-16 00:49:54.000000000 +0100
++++ gl/gettext.h       2009-12-16 00:51:20.000000000 +0100
+@@ -101,179 +101,4 @@
+    initializer for static 'char[]' or 'const char[]' variables.  */
+ #define gettext_noop(String) String
  
+-/* The separator between msgctxt and msgid in a .mo file.  */
+-#define GETTEXT_CONTEXT_GLUE "\004"
+-
+-/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+-   MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
+-   short and rarely need to change.
+-   The letter 'p' stands for 'particular' or 'special'.  */
+-#ifdef DEFAULT_TEXT_DOMAIN
+-# define pgettext(Msgctxt, Msgid) \
+-   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, LC_MESSAGES)
+-#else
+-# define pgettext(Msgctxt, Msgid) \
+-   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+-#endif
+-#define dpgettext(Domainname, Msgctxt, Msgid) \
+-  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
+-#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+-  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
Category)
+-#ifdef DEFAULT_TEXT_DOMAIN
+-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+-   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, MsgidPlural, N, LC_MESSAGES)
+-#else
+-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+-   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
+-#endif
+-#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+-  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
+-#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+-  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, Category)
+-
+-#ifdef __GNUC__
+-__inline
+-#else
+-#ifdef __cplusplus
+-inline
+-#endif
+-#endif
+-static const char *
+-pgettext_aux (const char *domain,
+-              const char *msg_ctxt_id, const char *msgid,
+-              int category)
+-{
+-  const char *translation = dcgettext (domain, msg_ctxt_id, category);
+-  if (translation == msg_ctxt_id)
+-    return msgid;
+-  else
+-    return translation;
+-}
+-
+-#ifdef __GNUC__
+-__inline
+-#else
+-#ifdef __cplusplus
+-inline
+-#endif
+-#endif
+-static const char *
+-npgettext_aux (const char *domain,
+-               const char *msg_ctxt_id, const char *msgid,
+-               const char *msgid_plural, unsigned long int n,
+-               int category)
+-{
+-  const char *translation =
+-    dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+-  if (translation == msg_ctxt_id || translation == msgid_plural)
+-    return (n == 1 ? msgid : msgid_plural);
+-  else
+-    return translation;
+-}
+-
 -/* The same thing extended for non-constant arguments.  Here MSGCTXT and MSGID
 -   can be arbitrary expressions.  But for string literals these macros are
 -   less efficient than those above.  */
@@ -32,8 +102,8 @@
 -#endif
 -static const char *
 -dcpgettext_expr (const char *domain,
--               const char *msgctxt, const char *msgid,
--               int category)
+-                 const char *msgctxt, const char *msgid,
+-                 int category)
 -{
 -  size_t msgctxt_len = strlen (msgctxt) + 1;
 -  size_t msgid_len = strlen (msgid) + 1;
@@ -55,10 +125,10 @@
 -      translation = dcgettext (domain, msg_ctxt_id, category);
 -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 -      if (msg_ctxt_id != buf)
--      free (msg_ctxt_id);
+-        free (msg_ctxt_id);
 -#endif
 -      if (translation != msg_ctxt_id)
--      return translation;
+-        return translation;
 -    }
 -  return msgid;
 -}
@@ -77,9 +147,9 @@
 -#endif
 -static const char *
 -dcnpgettext_expr (const char *domain,
--                const char *msgctxt, const char *msgid,
--                const char *msgid_plural, unsigned long int n,
--                int category)
+-                  const char *msgctxt, const char *msgid,
+-                  const char *msgid_plural, unsigned long int n,
+-                  int category)
 -{
 -  size_t msgctxt_len = strlen (msgctxt) + 1;
 -  size_t msgid_len = strlen (msgid) + 1;
@@ -101,10 +171,10 @@
 -      translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, 
category);
 -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 -      if (msg_ctxt_id != buf)
--      free (msg_ctxt_id);
+-        free (msg_ctxt_id);
 -#endif
 -      if (!(translation == msg_ctxt_id || translation == msgid_plural))
--      return translation;
+-        return translation;
 -    }
 -  return (n == 1 ? msgid : msgid_plural);
 -}
diff --git a/gl/progname.c b/gl/progname.c
index bfa374a..a5e5eaf 100644
--- a/gl/progname.c
+++ b/gl/progname.c
@@ -1,6 +1,6 @@
 /* Program name management.
    Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc.
-   Written by Bruno Haible <address@hidden>, 2001.
+   Written by Bruno Haible <address@hidden>, 2001.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -23,6 +23,8 @@
 #include "progname.h"
 
 #include <errno.h> /* get program_invocation_name declaration */
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 
@@ -30,7 +32,9 @@
    To be initialized by main().  */
 const char *program_name = NULL;
 
-/* Set program_name, based on argv[0].  */
+/* Set program_name, based on argv[0].
+   argv0 must be a string allocated with indefinite extent, and must not be
+   modified after this call.  */
 void
 set_program_name (const char *argv0)
 {
@@ -42,20 +46,30 @@ set_program_name (const char *argv0)
   const char *slash;
   const char *base;
 
+  /* Sanity check.  POSIX requires the invoking process to pass a non-NULL
+     argv[0].  */
+  if (argv0 == NULL)
+    {
+      /* It's a bug in the invoking program.  Help diagnosing it.  */
+      fputs ("A NULL argv[0] was passed through an exec system call.\n",
+             stderr);
+      abort ();
+    }
+
   slash = strrchr (argv0, '/');
   base = (slash != NULL ? slash + 1 : argv0);
   if (base - argv0 >= 7 && strncmp (base - 7, "/.libs/", 7) == 0)
     {
       argv0 = base;
       if (strncmp (base, "lt-", 3) == 0)
-       {
-         argv0 = base + 3;
-         /* On glibc systems, remove the "lt-" prefix from the variable
-            program_invocation_short_name.  */
+        {
+          argv0 = base + 3;
+          /* On glibc systems, remove the "lt-" prefix from the variable
+             program_invocation_short_name.  */
 #if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
-         program_invocation_short_name = (char *) argv0;
+          program_invocation_short_name = (char *) argv0;
 #endif
-       }
+        }
     }
 
   /* But don't strip off a leading <dirname>/ in general, because when the user
diff --git a/gl/progname.h b/gl/progname.h
index c5983f6..0d9a891 100644
--- a/gl/progname.h
+++ b/gl/progname.h
@@ -1,6 +1,6 @@
 /* Program name management.
-   Copyright (C) 2001-2004, 2006 Free Software Foundation, Inc.
-   Written by Bruno Haible <address@hidden>, 2001.
+   Copyright (C) 2001-2004, 2006, 2009 Free Software Foundation, Inc.
+   Written by Bruno Haible <address@hidden>, 2001.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -31,7 +31,9 @@ extern "C" {
 /* String containing name the program is called with.  */
 extern const char *program_name;
 
-/* Set program_name, based on argv[0].  */
+/* Set program_name, based on argv[0].
+   argv0 must be a string allocated with indefinite extent, and must not be
+   modified after this call.  */
 extern void set_program_name (const char *argv0);
 
 #if defined(ENABLE_RELOCATABLE) && ENABLE_RELOCATABLE
@@ -39,8 +41,8 @@ extern void set_program_name (const char *argv0);
 /* Set program_name, based on argv[0], and original installation prefix and
    directory, for relocatability.  */
 extern void set_program_name_and_installdir (const char *argv0,
-                                            const char *orig_installprefix,
-                                            const char *orig_installdir);
+                                             const char *orig_installprefix,
+                                             const char *orig_installdir);
 #undef set_program_name
 #define set_program_name(ARG0) \
   set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR)
diff --git a/gl/strerror.c b/gl/strerror.c
index dfe6c25..fa0ed14 100644
--- a/gl/strerror.c
+++ b/gl/strerror.c
@@ -334,10 +334,10 @@ rpl_strerror (int n)
 
     if (result == NULL || result[0] == '\0')
       {
-       static char const fmt[] = "Unknown error (%d)";
-       static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)];
-       sprintf (msg_buf, fmt, n);
-       return msg_buf;
+        static char const fmt[] = "Unknown error (%d)";
+        static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)];
+        sprintf (msg_buf, fmt, n);
+        return msg_buf;
       }
 
     return result;
diff --git a/gl/string.in.h b/gl/string.in.h
index 3d0c7d1..f7d8475 100644
--- a/gl/string.in.h
+++ b/gl/string.in.h
@@ -45,6 +45,8 @@
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 
 #ifdef __cplusplus
 extern "C" {
@@ -56,7 +58,7 @@ extern "C" {
 # if @REPLACE_MEMCHR@
 #  define memchr rpl_memchr
 extern void *memchr (void const *__s, int __c, size_t __n)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memchr
@@ -73,8 +75,8 @@ extern void *memchr (void const *__s, int __c, size_t __n)
 # endif
 # if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@
 extern void *memmem (void const *__haystack, size_t __haystack_len,
-                    void const *__needle, size_t __needle_len)
-  __attribute__ ((__pure__));
+                     void const *__needle, size_t __needle_len)
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memmem
@@ -90,7 +92,8 @@ extern void *memmem (void const *__haystack, size_t 
__haystack_len,
 #if @GNULIB_MEMPCPY@
 # if ! @HAVE_MEMPCPY@
 extern void *mempcpy (void *restrict __dest, void const *restrict __src,
-                     size_t __n);
+                      size_t __n)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mempcpy
@@ -104,7 +107,7 @@ extern void *mempcpy (void *restrict __dest, void const 
*restrict __src,
 #if @GNULIB_MEMRCHR@
 # if ! @HAVE_DECL_MEMRCHR@
 extern void *memrchr (void const *, int, size_t)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memrchr
@@ -120,7 +123,7 @@ extern void *memrchr (void const *, int, size_t)
 #if @GNULIB_RAWMEMCHR@
 # if ! @HAVE_RAWMEMCHR@
 extern void *rawmemchr (void const *__s, int __c_in)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef rawmemchr
@@ -133,7 +136,8 @@ extern void *rawmemchr (void const *__s, int __c_in)
 /* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
 #if @GNULIB_STPCPY@
 # if ! @HAVE_STPCPY@
-extern char *stpcpy (char *restrict __dst, char const *restrict __src);
+extern char *stpcpy (char *restrict __dst, char const *restrict __src)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef stpcpy
@@ -149,7 +153,8 @@ extern char *stpcpy (char *restrict __dst, char const 
*restrict __src);
 # if ! @HAVE_STPNCPY@
 #  define stpncpy gnu_stpncpy
 extern char *stpncpy (char *restrict __dst, char const *restrict __src,
-                     size_t __n);
+                      size_t __n)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef stpncpy
@@ -174,7 +179,7 @@ extern char *stpncpy (char *restrict __dst, char const 
*restrict __src,
 #if @GNULIB_STRCHRNUL@
 # if ! @HAVE_STRCHRNUL@
 extern char *strchrnul (char const *__s, int __c_in)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strchrnul
@@ -191,7 +196,7 @@ extern char *strchrnul (char const *__s, int __c_in)
 #  define strdup rpl_strdup
 # endif
 # if !(@HAVE_DECL_STRDUP@ || defined strdup) || @REPLACE_STRDUP@
-extern char *strdup (char const *__s);
+extern char *strdup (char const *__s) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strdup
@@ -208,7 +213,7 @@ extern char *strdup (char const *__s);
 #  define strndup rpl_strndup
 # endif
 # if @REPLACE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
-extern char *strndup (char const *__string, size_t __n);
+extern char *strndup (char const *__string, size_t __n) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strndup
@@ -224,7 +229,7 @@ extern char *strndup (char const *__string, size_t __n);
 #if @GNULIB_STRNLEN@
 # if ! @HAVE_DECL_STRNLEN@
 extern size_t strnlen (char const *__string, size_t __maxlen)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strnlen
@@ -251,7 +256,7 @@ extern size_t strnlen (char const *__string, size_t 
__maxlen)
 #if @GNULIB_STRPBRK@
 # if ! @HAVE_STRPBRK@
 extern char *strpbrk (char const *__s, char const *__accept)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
 # endif
 # if defined GNULIB_POSIXCHECK
 /* strpbrk() assumes the second argument is a list of single-byte characters.
@@ -313,7 +318,8 @@ extern char *strpbrk (char const *__s, char const *__accept)
    See also strtok_r().  */
 #if @GNULIB_STRSEP@
 # if ! @HAVE_STRSEP@
-extern char *strsep (char **restrict __stringp, char const *restrict __delim);
+extern char *strsep (char **restrict __stringp, char const *restrict __delim)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef strsep
@@ -334,8 +340,8 @@ extern char *strsep (char **restrict __stringp, char const 
*restrict __delim);
 #if @GNULIB_STRSTR@
 # if @REPLACE_STRSTR@
 #  define strstr rpl_strstr
-char *strstr (const char *haystack, const char *needle)
-  __attribute__ ((__pure__));
+extern char *strstr (const char *haystack, const char *needle)
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 /* strstr() does not work with multibyte strings if the locale encoding is
@@ -360,7 +366,7 @@ char *strstr (const char *haystack, const char *needle)
 # endif
 # if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@
 extern char *strcasestr (const char *haystack, const char *needle)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 /* strcasestr() does not work with multibyte strings:
@@ -379,12 +385,12 @@ extern char *strcasestr (const char *haystack, const char 
*needle)
 /* Parse S into tokens separated by characters in DELIM.
    If S is NULL, the saved pointer in SAVE_PTR is used as
    the next starting point.  For example:
-       char s[] = "-abc-=-def";
-       char *sp;
-       x = strtok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
-       x = strtok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
-       x = strtok_r(NULL, "=", &sp);   // x = NULL
-               // s = "abc\0-def\0"
+        char s[] = "-abc-=-def";
+        char *sp;
+        x = strtok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
+        x = strtok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
+        x = strtok_r(NULL, "=", &sp);   // x = NULL
+                // s = "abc\0-def\0"
 
    This is a variant of strtok() that is multithread-safe.
 
@@ -407,7 +413,8 @@ extern char *strcasestr (const char *haystack, const char 
*needle)
 # endif
 # if ! @HAVE_DECL_STRTOK_R@ || @REPLACE_STRTOK_R@
 extern char *strtok_r (char *restrict s, char const *restrict delim,
-                      char **restrict save_ptr);
+                       char **restrict save_ptr)
+     _GL_ARG_NONNULL ((2, 3));
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef strtok_r
@@ -432,13 +439,13 @@ extern char *strtok_r (char *restrict s, char const 
*restrict delim,
 #if @GNULIB_MBSLEN@
 /* Return the number of multibyte characters in the character string STRING.
    This considers multibyte characters, unlike strlen, which counts bytes.  */
-extern size_t mbslen (const char *string);
+extern size_t mbslen (const char *string) _GL_ARG_NONNULL ((1));
 #endif
 
 #if @GNULIB_MBSNLEN@
 /* Return the number of multibyte characters in the character string starting
    at STRING and ending at STRING + LEN.  */
-extern size_t mbsnlen (const char *string, size_t len);
+extern size_t mbsnlen (const char *string, size_t len) _GL_ARG_NONNULL ((1));
 #endif
 
 #if @GNULIB_MBSCHR@
@@ -447,7 +454,7 @@ extern size_t mbsnlen (const char *string, size_t len);
    Unlike strchr(), this function works correctly in multibyte locales with
    encodings such as GB18030.  */
 # define mbschr rpl_mbschr /* avoid collision with HP-UX function */
-extern char * mbschr (const char *string, int c);
+extern char * mbschr (const char *string, int c) _GL_ARG_NONNULL ((1));
 #endif
 
 #if @GNULIB_MBSRCHR@
@@ -456,7 +463,7 @@ extern char * mbschr (const char *string, int c);
    Unlike strrchr(), this function works correctly in multibyte locales with
    encodings such as GB18030.  */
 # define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
-extern char * mbsrchr (const char *string, int c);
+extern char * mbsrchr (const char *string, int c) _GL_ARG_NONNULL ((1));
 #endif
 
 #if @GNULIB_MBSSTR@
@@ -464,7 +471,8 @@ extern char * mbsrchr (const char *string, int c);
    string HAYSTACK.  Return NULL if NEEDLE is not found in HAYSTACK.
    Unlike strstr(), this function works correctly in multibyte locales with
    encodings different from UTF-8.  */
-extern char * mbsstr (const char *haystack, const char *needle);
+extern char * mbsstr (const char *haystack, const char *needle)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSCASECMP@
@@ -474,7 +482,8 @@ extern char * mbsstr (const char *haystack, const char 
*needle);
    Note: This function may, in multibyte locales, return 0 for strings of
    different lengths!
    Unlike strcasecmp(), this function works correctly in multibyte locales.  */
-extern int mbscasecmp (const char *s1, const char *s2);
+extern int mbscasecmp (const char *s1, const char *s2)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSNCASECMP@
@@ -487,7 +496,8 @@ extern int mbscasecmp (const char *s1, const char *s2);
    of different lengths!
    Unlike strncasecmp(), this function works correctly in multibyte locales.
    But beware that N is not a byte count but a character count!  */
-extern int mbsncasecmp (const char *s1, const char *s2, size_t n);
+extern int mbsncasecmp (const char *s1, const char *s2, size_t n)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSPCASECMP@
@@ -500,7 +510,8 @@ extern int mbsncasecmp (const char *s1, const char *s2, 
size_t n);
    smaller length than PREFIX!
    Unlike strncasecmp(), this function works correctly in multibyte
    locales.  */
-extern char * mbspcasecmp (const char *string, const char *prefix);
+extern char * mbspcasecmp (const char *string, const char *prefix)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSCASESTR@
@@ -509,7 +520,8 @@ extern char * mbspcasecmp (const char *string, const char 
*prefix);
    Note: This function may, in multibyte locales, return success even if
    strlen (haystack) < strlen (needle) !
    Unlike strcasestr(), this function works correctly in multibyte locales.  */
-extern char * mbscasestr (const char *haystack, const char *needle);
+extern char * mbscasestr (const char *haystack, const char *needle)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSCSPN@
@@ -518,7 +530,8 @@ extern char * mbscasestr (const char *haystack, const char 
*needle);
    beginning of the string to this occurrence, or to the end of the string
    if none exists.
    Unlike strcspn(), this function works correctly in multibyte locales.  */
-extern size_t mbscspn (const char *string, const char *accept);
+extern size_t mbscspn (const char *string, const char *accept)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSPBRK@
@@ -527,7 +540,8 @@ extern size_t mbscspn (const char *string, const char 
*accept);
    exists.
    Unlike strpbrk(), this function works correctly in multibyte locales.  */
 # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
-extern char * mbspbrk (const char *string, const char *accept);
+extern char * mbspbrk (const char *string, const char *accept)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSSPN@
@@ -536,7 +550,8 @@ extern char * mbspbrk (const char *string, const char 
*accept);
    beginning of the string to this occurrence, or to the end of the string
    if none exists.
    Unlike strspn(), this function works correctly in multibyte locales.  */
-extern size_t mbsspn (const char *string, const char *reject);
+extern size_t mbsspn (const char *string, const char *reject)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSSEP@
@@ -554,7 +569,8 @@ extern size_t mbsspn (const char *string, const char 
*reject);
    Caveat: The identity of the delimiting character is lost.
 
    See also mbstok_r().  */
-extern char * mbssep (char **stringp, const char *delim);
+extern char * mbssep (char **stringp, const char *delim)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSTOK_R@
@@ -562,19 +578,20 @@ extern char * mbssep (char **stringp, const char *delim);
    the character string DELIM.
    If STRING is NULL, the saved pointer in SAVE_PTR is used as
    the next starting point.  For example:
-       char s[] = "-abc-=-def";
-       char *sp;
-       x = mbstok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
-       x = mbstok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
-       x = mbstok_r(NULL, "=", &sp);   // x = NULL
-               // s = "abc\0-def\0"
+        char s[] = "-abc-=-def";
+        char *sp;
+        x = mbstok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
+        x = mbstok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
+        x = mbstok_r(NULL, "=", &sp);   // x = NULL
+                // s = "abc\0-def\0"
 
    Caveat: It modifies the original string.
    Caveat: These functions cannot be used on constant strings.
    Caveat: The identity of the delimiting character is lost.
 
    See also mbssep().  */
-extern char * mbstok_r (char *string, const char *delim, char **save_ptr);
+extern char * mbstok_r (char *string, const char *delim, char **save_ptr)
+     _GL_ARG_NONNULL ((2, 3));
 #endif
 
 /* Map any int, typically from errno, into an error message.  */
@@ -609,7 +626,7 @@ extern char *strsignal (int __sig);
 
 #if @GNULIB_STRVERSCMP@
 # if address@hidden@
-extern int strverscmp (const char *, const char *);
+extern int strverscmp (const char *, const char *) _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strverscmp
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 1bf5633..48e05d3 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -59,43 +59,45 @@
 #  include <winsock2.h>
 #  if !defined _GL_SYS_SOCKET_H
 #   undef socket
-#   define socket              socket_used_without_including_sys_socket_h
+#   define socket               socket_used_without_including_sys_socket_h
 #   undef connect
-#   define connect             connect_used_without_including_sys_socket_h
+#   define connect              connect_used_without_including_sys_socket_h
 #   undef accept
-#   define accept              accept_used_without_including_sys_socket_h
+#   define accept               accept_used_without_including_sys_socket_h
 #   undef bind
-#   define bind                        bind_used_without_including_sys_socket_h
+#   define bind                 bind_used_without_including_sys_socket_h
 #   undef getpeername
-#   define getpeername         getpeername_used_without_including_sys_socket_h
+#   define getpeername          getpeername_used_without_including_sys_socket_h
 #   undef getsockname
-#   define getsockname         getsockname_used_without_including_sys_socket_h
+#   define getsockname          getsockname_used_without_including_sys_socket_h
 #   undef getsockopt
-#   define getsockopt          getsockopt_used_without_including_sys_socket_h
+#   define getsockopt           getsockopt_used_without_including_sys_socket_h
 #   undef listen
-#   define listen              listen_used_without_including_sys_socket_h
+#   define listen               listen_used_without_including_sys_socket_h
 #   undef recv
-#   define recv                        recv_used_without_including_sys_socket_h
+#   define recv                 recv_used_without_including_sys_socket_h
 #   undef send
-#   define send                        send_used_without_including_sys_socket_h
+#   define send                 send_used_without_including_sys_socket_h
 #   undef recvfrom
-#   define recvfrom            recvfrom_used_without_including_sys_socket_h
+#   define recvfrom             recvfrom_used_without_including_sys_socket_h
 #   undef sendto
-#   define sendto              sendto_used_without_including_sys_socket_h
+#   define sendto               sendto_used_without_including_sys_socket_h
 #   undef setsockopt
-#   define setsockopt          setsockopt_used_without_including_sys_socket_h
+#   define setsockopt           setsockopt_used_without_including_sys_socket_h
 #   undef shutdown
-#   define shutdown            shutdown_used_without_including_sys_socket_h
+#   define shutdown             shutdown_used_without_including_sys_socket_h
 #  endif
 #  if !defined _GL_SYS_SELECT_H
 #   undef select
-#   define select              select_used_without_including_sys_select_h
+#   define select               select_used_without_including_sys_select_h
 #  endif
 # endif
 #endif
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 
 /* OS/2 EMX lacks these macros.  */
 #ifndef STDIN_FILENO
@@ -135,7 +137,8 @@ extern "C" {
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/chown.html>.  */
-extern int chown (const char *file, uid_t uid, gid_t gid);
+extern int chown (const char *file, uid_t uid, gid_t gid)
+     _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef chown
@@ -239,7 +242,7 @@ extern char **environ;
 # if address@hidden@
 /* Like access(), except that it uses the effective user id and group id of
    the current process.  */
-extern int euidaccess (const char *filename, int mode);
+extern int euidaccess (const char *filename, int mode) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef euidaccess
@@ -252,11 +255,12 @@ extern int euidaccess (const char *filename, int mode);
 
 #if @GNULIB_FACCESSAT@
 # if address@hidden@
-int faccessat (int fd, char const *file, int mode, int flag);
+extern int faccessat (int fd, char const *file, int mode, int flag)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef faccessat
-# define faccessat(d,n,m,f)                        \
+# define faccessat(d,n,m,f)                         \
     (GL_LINK_WARNING ("faccessat is not portable - " \
                       "use gnulib module faccessat for portability"), \
      faccessat (d, n, m, f))
@@ -273,7 +277,8 @@ int faccessat (int fd, char const *file, int mode, int 
flag);
 extern int fchdir (int /*fd*/);
 
 /* Gnulib internal hooks needed to maintain the fchdir metadata.  */
-extern int _gl_register_fd (int fd, const char *filename);
+extern int _gl_register_fd (int fd, const char *filename)
+     _GL_ARG_NONNULL ((2));
 extern void _gl_unregister_fd (int fd);
 extern int _gl_register_dup (int oldfd, int newfd);
 extern const char *_gl_directory_name (int fd);
@@ -294,11 +299,12 @@ extern const char *_gl_directory_name (int fd);
 #  define fchownat rpl_fchownat
 # endif
 # if address@hidden@ || @REPLACE_FCHOWNAT@
-extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int 
flag);
+extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int 
flag)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef fchownat
-# define fchownat(d,n,o,g,f)                       \
+# define fchownat(d,n,o,g,f)                        \
     (GL_LINK_WARNING ("fchownat is not portable - " \
                       "use gnulib module openat for portability"), \
      fchownat (d, n, o, g, f))
@@ -378,7 +384,7 @@ extern char * getcwd (char *buf, size_t size);
    If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
    Return 0 if successful, otherwise set errno and return -1.  */
 # if address@hidden@
-extern int getdomainname(char *name, size_t len);
+extern int getdomainname(char *name, size_t len) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getdomainname
@@ -439,7 +445,7 @@ int getgroups (int n, gid_t *groups);
 #  define gethostname rpl_gethostname
 # endif
 # if @UNISTD_H_HAVE_WINSOCK2_H@ || address@hidden@
-extern int gethostname(char *name, size_t len);
+extern int gethostname(char *name, size_t len) _GL_ARG_NONNULL ((1));
 # endif
 #elif @UNISTD_H_HAVE_WINSOCK2_H@
 # undef gethostname
@@ -464,7 +470,7 @@ extern int gethostname(char *name, size_t len);
    See <http://www.opengroup.org/susv3xsh/getlogin.html>.
  */
 # if address@hidden@
-extern int getlogin_r (char *name, size_t size);
+extern int getlogin_r (char *name, size_t size) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getlogin_r
@@ -574,7 +580,8 @@ extern void endusershell (void);
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/lchown.html>.  */
-extern int lchown (char const *file, uid_t owner, gid_t group);
+extern int lchown (char const *file, uid_t owner, gid_t group)
+     _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef lchown
@@ -594,7 +601,8 @@ extern int lchown (char const *file, uid_t owner, gid_t 
group);
    See POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/link.html>.  */
 # if address@hidden@ || @REPLACE_LINK@
-extern int link (const char *path1, const char *path2);
+extern int link (const char *path1, const char *path2)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef link
@@ -614,11 +622,12 @@ extern int link (const char *path1, const char *path2);
    Return 0 if successful, otherwise -1 and errno set.  */
 # if address@hidden@ || @REPLACE_LINKAT@
 extern int linkat (int fd1, const char *path1, int fd2, const char *path2,
-                  int flag);
+                   int flag)
+     _GL_ARG_NONNULL ((2, 4));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef linkat
-# define link(f1,path1,f2,path2,f)             \
+# define link(f1,path1,f2,path2,f)              \
     (GL_LINK_WARNING ("linkat is unportable - " \
                       "use gnulib module linkat for portability"), \
      linkat (f1, path1, f2, path2,f))
@@ -654,7 +663,7 @@ extern int linkat (int fd1, const char *path1, int fd2, 
const char *path2,
 # if @HAVE_PIPE2@
 #  define pipe2 rpl_pipe2
 # endif
-extern int pipe2 (int fd[2], int flags);
+extern int pipe2 (int fd[2], int flags) _GL_ARG_NONNULL ((1));
 #elif defined GNULIB_POSIXCHECK
 # undef pipe2
 # define pipe2(f,o) \
@@ -664,6 +673,27 @@ extern int pipe2 (int fd[2], int flags);
 #endif
 
 
+#if @GNULIB_PREAD@
+# if @REPLACE_PREAD@
+#  define pread rpl_pread
+# endif
+/* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
+   Return the number of bytes placed into BUF if successful, otherwise
+   set errno and return -1.  0 indicates EOF.  See the POSIX:2001
+   specification <http://www.opengroup.org/susv3xsh/pread.html>.  */
+# if address@hidden@ || @REPLACE_PREAD@
+  extern ssize_t pread (int fd, void *buf, size_t bufsize, off_t offset)
+       _GL_ARG_NONNULL ((2));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pread
+# define pread(f,b,s,o)                        \
+    (GL_LINK_WARNING ("pread is unportable - " \
+                      "use gnulib module pread for portability"), \
+     pread (f, b, s, o))
+#endif
+
+
 #if @GNULIB_READLINK@
 # if @REPLACE_READLINK@
 #  define readlink rpl_readlink
@@ -674,7 +704,8 @@ extern int pipe2 (int fd[2], int flags);
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/readlink.html>.  */
 # if address@hidden@ || @REPLACE_READLINK@
-extern ssize_t readlink (const char *file, char *buf, size_t bufsize);
+extern ssize_t readlink (const char *file, char *buf, size_t bufsize)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef readlink
@@ -687,11 +718,12 @@ extern ssize_t readlink (const char *file, char *buf, 
size_t bufsize);
 
 #if @GNULIB_READLINKAT@
 # if address@hidden@
-ssize_t readlinkat (int fd, char const *file, char *buf, size_t len);
+extern ssize_t readlinkat (int fd, char const *file, char *buf, size_t len)
+     _GL_ARG_NONNULL ((2, 3));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef readlinkat
-# define readlinkat(d,n,b,l)                        \
+# define readlinkat(d,n,b,l)                         \
     (GL_LINK_WARNING ("readlinkat is not portable - " \
                       "use gnulib module symlinkat for portability"), \
      readlinkat (d, n, b, l))
@@ -702,7 +734,7 @@ ssize_t readlinkat (int fd, char const *file, char *buf, 
size_t len);
 # if @REPLACE_RMDIR@
 #  define rmdir rpl_rmdir
 /* Remove the directory DIR.  */
-extern int rmdir (char const *name);
+extern int rmdir (char const *name) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef rmdir
@@ -714,11 +746,15 @@ extern int rmdir (char const *name);
 
 
 #if @GNULIB_SLEEP@
+# if @REPLACE_SLEEP@
+#  undef sleep
+#  define sleep rpl_sleep
+# endif
 /* Pause the execution of the current thread for N seconds.
    Returns the number of seconds left to sleep.
    See the POSIX:2001 specification
    <http://www.opengroup.org/susv3xsh/sleep.html>.  */
-# if address@hidden@
+# if address@hidden@ || @REPLACE_SLEEP@
 extern unsigned int sleep (unsigned int n);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -736,11 +772,12 @@ extern unsigned int sleep (unsigned int n);
 #  define symlink rpl_symlink
 # endif
 # if address@hidden@ || @REPLACE_SYMLINK@
-int symlink (char const *contents, char const *file);
+extern int symlink (char const *contents, char const *file)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef symlink
-# define symlink(c,n)                       \
+# define symlink(c,n)                        \
     (GL_LINK_WARNING ("symlink is not portable - " \
                       "use gnulib module symlink for portability"), \
      symlink (c, n))
@@ -749,11 +786,12 @@ int symlink (char const *contents, char const *file);
 
 #if @GNULIB_SYMLINKAT@
 # if address@hidden@
-int symlinkat (char const *contents, int fd, char const *file);
+extern int symlinkat (char const *contents, int fd, char const *file)
+     _GL_ARG_NONNULL ((1, 3));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef symlinkat
-# define symlinkat(c,d,n)                           \
+# define symlinkat(c,d,n)                            \
     (GL_LINK_WARNING ("symlinkat is not portable - " \
                       "use gnulib module symlinkat for portability"), \
      symlinkat (c, d, n))
@@ -764,7 +802,7 @@ int symlinkat (char const *contents, int fd, char const 
*file);
 # if @REPLACE_UNLINK@
 #  undef unlink
 #  define unlink rpl_unlink
-extern int unlink (char const *file);
+extern int unlink (char const *file) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef unlink
@@ -781,7 +819,7 @@ extern int unlink (char const *file);
 #  define unlinkat rpl_unlinkat
 # endif
 # if address@hidden@ || @REPLACE_UNLINKAT@
-extern int unlinkat (int fd, char const *file, int flag);
+extern int unlinkat (int fd, char const *file, int flag) _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef unlinkat
@@ -819,7 +857,8 @@ extern int usleep (useconds_t n);
    <http://www.opengroup.org/susv3xsh/write.html>.  */
 # undef write
 # define write rpl_write
-extern ssize_t write (int fd, const void *buf, size_t count);
+extern ssize_t write (int fd, const void *buf, size_t count)
+     _GL_ARG_NONNULL ((2));
 #endif
 
 
diff --git a/gl/version-etc.c b/gl/version-etc.c
index bf67c37..abd5dbd 100644
--- a/gl/version-etc.c
+++ b/gl/version-etc.c
@@ -32,6 +32,12 @@
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
+/* If you use AM_INIT_AUTOMAKE's no-define option,
+   PACKAGE is not defined.  Use PACKAGE_TARNAME instead.  */
+#if ! defined PACKAGE && defined PACKAGE_TARNAME
+# define PACKAGE PACKAGE_TARNAME
+#endif
+
 enum { COPYRIGHT_YEAR = 2009 };
 
 /* The three functions below display the --version information the
@@ -54,9 +60,9 @@ enum { COPYRIGHT_YEAR = 2009 };
    number of elements in the array. */
 void
 version_etc_arn (FILE *stream,
-                const char *command_name, const char *package,
-                const char *version,
-                const char * const * authors, size_t n_authors)
+                 const char *command_name, const char *package,
+                 const char *version,
+                 const char * const * authors, size_t n_authors)
 {
   if (command_name)
     fprintf (stream, "%s (%s) %s\n", command_name, package, version);
@@ -66,7 +72,7 @@ version_etc_arn (FILE *stream,
 #ifdef PACKAGE_PACKAGER
 # ifdef PACKAGE_PACKAGER_VERSION
   fprintf (stream, _("Packaged by %s (%s)\n"), PACKAGE_PACKAGER,
-          PACKAGE_PACKAGER_VERSION);
+           PACKAGE_PACKAGER_VERSION);
 # else
   fprintf (stream, _("Packaged by %s\n"), PACKAGE_PACKAGER);
 # endif
@@ -84,7 +90,7 @@ This is free software: you are free to change and 
redistribute it.\n\
 There is NO WARRANTY, to the extent permitted by law.\n\
 \n\
 "),
-        stream);
+         stream);
 
   switch (n_authors)
     {
@@ -102,66 +108,66 @@ There is NO WARRANTY, to the extent permitted by law.\n\
     case 3:
       /* TRANSLATORS: Each %s denotes an author name.  */
       fprintf (stream, _("Written by %s, %s, and %s.\n"),
-              authors[0], authors[1], authors[2]);
+               authors[0], authors[1], authors[2]);
       break;
     case 4:
       /* TRANSLATORS: Each %s denotes an author name.
-        You can use line breaks, estimating that each author name occupies
-        ca. 16 screen columns and that a screen line has ca. 80 columns.  */
+         You can use line breaks, estimating that each author name occupies
+         ca. 16 screen columns and that a screen line has ca. 80 columns.  */
       fprintf (stream, _("Written by %s, %s, %s,\nand %s.\n"),
-              authors[0], authors[1], authors[2], authors[3]);
+               authors[0], authors[1], authors[2], authors[3]);
       break;
     case 5:
       /* TRANSLATORS: Each %s denotes an author name.
-        You can use line breaks, estimating that each author name occupies
-        ca. 16 screen columns and that a screen line has ca. 80 columns.  */
+         You can use line breaks, estimating that each author name occupies
+         ca. 16 screen columns and that a screen line has ca. 80 columns.  */
       fprintf (stream, _("Written by %s, %s, %s,\n%s, and %s.\n"),
-              authors[0], authors[1], authors[2], authors[3], authors[4]);
+               authors[0], authors[1], authors[2], authors[3], authors[4]);
       break;
     case 6:
       /* TRANSLATORS: Each %s denotes an author name.
-        You can use line breaks, estimating that each author name occupies
-        ca. 16 screen columns and that a screen line has ca. 80 columns.  */
+         You can use line breaks, estimating that each author name occupies
+         ca. 16 screen columns and that a screen line has ca. 80 columns.  */
       fprintf (stream, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"),
-              authors[0], authors[1], authors[2], authors[3], authors[4],
-              authors[5]);
+               authors[0], authors[1], authors[2], authors[3], authors[4],
+               authors[5]);
       break;
     case 7:
       /* TRANSLATORS: Each %s denotes an author name.
-        You can use line breaks, estimating that each author name occupies
-        ca. 16 screen columns and that a screen line has ca. 80 columns.  */
+         You can use line breaks, estimating that each author name occupies
+         ca. 16 screen columns and that a screen line has ca. 80 columns.  */
       fprintf (stream, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"),
-              authors[0], authors[1], authors[2], authors[3], authors[4],
-              authors[5], authors[6]);
+               authors[0], authors[1], authors[2], authors[3], authors[4],
+               authors[5], authors[6]);
       break;
     case 8:
       /* TRANSLATORS: Each %s denotes an author name.
-        You can use line breaks, estimating that each author name occupies
-        ca. 16 screen columns and that a screen line has ca. 80 columns.  */
+         You can use line breaks, estimating that each author name occupies
+         ca. 16 screen columns and that a screen line has ca. 80 columns.  */
       fprintf (stream, _("\
 Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"),
-               authors[0], authors[1], authors[2], authors[3], authors[4],
-               authors[5], authors[6], authors[7]);
+                authors[0], authors[1], authors[2], authors[3], authors[4],
+                authors[5], authors[6], authors[7]);
       break;
     case 9:
       /* TRANSLATORS: Each %s denotes an author name.
-        You can use line breaks, estimating that each author name occupies
-        ca. 16 screen columns and that a screen line has ca. 80 columns.  */
+         You can use line breaks, estimating that each author name occupies
+         ca. 16 screen columns and that a screen line has ca. 80 columns.  */
       fprintf (stream, _("\
 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"),
-              authors[0], authors[1], authors[2], authors[3], authors[4],
-              authors[5], authors[6], authors[7], authors[8]);
+               authors[0], authors[1], authors[2], authors[3], authors[4],
+               authors[5], authors[6], authors[7], authors[8]);
       break;
     default:
       /* 10 or more authors.  Use an abbreviation, since the human reader
-        will probably not want to read the entire list anyway.  */
+         will probably not want to read the entire list anyway.  */
       /* TRANSLATORS: Each %s denotes an author name.
-        You can use line breaks, estimating that each author name occupies
-        ca. 16 screen columns and that a screen line has ca. 80 columns.  */
+         You can use line breaks, estimating that each author name occupies
+         ca. 16 screen columns and that a screen line has ca. 80 columns.  */
       fprintf (stream, _("\
 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"),
-               authors[0], authors[1], authors[2], authors[3], authors[4],
-               authors[5], authors[6], authors[7], authors[8]);
+                authors[0], authors[1], authors[2], authors[3], authors[4],
+                authors[5], authors[6], authors[7], authors[8]);
       break;
     }
 }
@@ -172,8 +178,8 @@ Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and 
others.\n"),
    Author names are given in the NULL-terminated array AUTHORS. */
 void
 version_etc_ar (FILE *stream,
-               const char *command_name, const char *package,
-               const char *version, const char * const * authors)
+                const char *command_name, const char *package,
+                const char *version, const char * const * authors)
 {
   size_t n_authors;
 
@@ -188,19 +194,19 @@ version_etc_ar (FILE *stream,
    Author names are given in the NULL-terminated va_list AUTHORS. */
 void
 version_etc_va (FILE *stream,
-               const char *command_name, const char *package,
-               const char *version, va_list authors)
+                const char *command_name, const char *package,
+                const char *version, va_list authors)
 {
   size_t n_authors;
   const char *authtab[10];
 
   for (n_authors = 0;
        n_authors < 10
-        && (authtab[n_authors] = va_arg (authors, const char *)) != NULL;
+         && (authtab[n_authors] = va_arg (authors, const char *)) != NULL;
        n_authors++)
     ;
   version_etc_arn (stream, command_name, package, version,
-                  authtab, n_authors);
+                   authtab, n_authors);
 }
 
 
@@ -219,8 +225,8 @@ version_etc_va (FILE *stream,
    NULL argument at the end.  */
 void
 version_etc (FILE *stream,
-            const char *command_name, const char *package,
-            const char *version, /* const char *author1, ...*/ ...)
+             const char *command_name, const char *package,
+             const char *version, /* const char *author1, ...*/ ...)
 {
   va_list authors;
 
@@ -239,14 +245,14 @@ emit_bug_reporting_address (void)
   printf (_("\nReport bugs to: %s\n"), PACKAGE_BUGREPORT);
 #ifdef PACKAGE_PACKAGER_BUG_REPORTS
   printf (_("Report %s bugs to: %s\n"), PACKAGE_PACKAGER,
-         PACKAGE_PACKAGER_BUG_REPORTS);
+          PACKAGE_PACKAGER_BUG_REPORTS);
 #endif
 #ifdef PACKAGE_URL
   printf (_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
 #else
   printf (_("%s home page: <http://www.gnu.org/software/%s/>\n"),
-         PACKAGE_NAME, PACKAGE);
+          PACKAGE_NAME, PACKAGE);
 #endif
   fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>\n"),
-        stdout);
+         stdout);
 }
diff --git a/gl/version-etc.h b/gl/version-etc.h
index 8ce02fe..75cd4b8 100644
--- a/gl/version-etc.h
+++ b/gl/version-etc.h
@@ -50,26 +50,26 @@ extern const char version_etc_copyright[];
 
 /* N_AUTHORS names are supplied in array AUTHORS.  */
 extern void version_etc_arn (FILE *stream,
-                            const char *command_name, const char *package,
-                            const char *version,
-                            const char * const * authors, size_t n_authors);
+                             const char *command_name, const char *package,
+                             const char *version,
+                             const char * const * authors, size_t n_authors);
 
 /* Names are passed in the NULL-terminated array AUTHORS.  */
 extern void version_etc_ar (FILE *stream,
-                           const char *command_name, const char *package,
-                           const char *version, const char * const * authors);
+                            const char *command_name, const char *package,
+                            const char *version, const char * const * authors);
 
 /* Names are passed in the NULL-terminated va_list.  */
 extern void version_etc_va (FILE *stream,
-                           const char *command_name, const char *package,
-                           const char *version, va_list authors);
+                            const char *command_name, const char *package,
+                            const char *version, va_list authors);
 
 /* Names are passed as separate arguments, with an additional
    NULL argument at the end.  */
 extern void version_etc (FILE *stream,
-                        const char *command_name, const char *package,
-                        const char *version,
-                        /* const char *author1, ..., NULL */ ...)
+                         const char *command_name, const char *package,
+                         const char *version,
+                         /* const char *author1, ..., NULL */ ...)
   ATTRIBUTE_SENTINEL;
 
 /* Display the usual `Report bugs to' stanza */
diff --git a/gltests/Makefile.am b/gltests/Makefile.am
index a4a4611..21537f6 100644
--- a/gltests/Makefile.am
+++ b/gltests/Makefile.am
@@ -99,7 +99,18 @@ EXTRA_DIST += test-getopt.c test-getopt.h test-getopt_long.h
 
 ## begin gnulib module link-warning
 
-LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
+BUILT_SOURCES += link-warning.h
+# The link-warning.h that gets inserted into generated .h files is the same as
+# build-aux/link-warning.h, except that it has the copyright header cut off.
+link-warning.h: $(top_srcdir)/build-aux/link-warning.h
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       sed -n -e '/GL_LINK_WARNING/,$$p' \
+         < $(top_srcdir)/build-aux/link-warning.h \
+         > address@hidden && \
+       mv address@hidden $@
+MOSTLYCLEANFILES += link-warning.h link-warning.h-t
+
+LINK_WARNING_H=link-warning.h
 
 EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h
 
@@ -157,6 +168,33 @@ EXTRA_DIST += test-setenv.c
 
 ## end   gnulib module setenv-tests
 
+## begin gnulib module stdbool
+
+BUILT_SOURCES += $(STDBOOL_H)
+
+# We need the following in order to create <stdbool.h> when the system
+# doesn't have one that works.
+stdbool.h: stdbool.in.h
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; 
\
+       } > address@hidden && \
+       mv address@hidden $@
+MOSTLYCLEANFILES += stdbool.h stdbool.h-t
+
+EXTRA_DIST += stdbool.in.h
+
+## end   gnulib module stdbool
+
+## begin gnulib module stdbool-tests
+
+TESTS += test-stdbool
+check_PROGRAMS += test-stdbool
+
+EXTRA_DIST += test-stdbool.c
+
+## end   gnulib module stdbool-tests
+
 ## begin gnulib module stddef-tests
 
 TESTS += test-stddef
@@ -223,7 +261,7 @@ BUILT_SOURCES += stdlib.h
 
 # We need the following in order to create <stdlib.h> when the system
 # doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h
+stdlib.h: stdlib.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -280,6 +318,7 @@ stdlib.h: stdlib.in.h
              -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/stdlib.in.h; \
        } > address@hidden && \
        mv address@hidden $@
@@ -386,7 +425,7 @@ BUILT_SOURCES += $(WCHAR_H)
 
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
-wchar.h: wchar.in.h
+wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -429,6 +468,7 @@ wchar.h: wchar.in.h
              -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
            < $(srcdir)/wchar.in.h; \
        } > address@hidden && \
        mv address@hidden $@
diff --git a/gltests/malloca.c b/gltests/malloca.c
index 1f41078..c7d38a9 100644
--- a/gltests/malloca.c
+++ b/gltests/malloca.c
@@ -74,21 +74,21 @@ mmalloca (size_t n)
       char *p = (char *) malloc (nplus);
 
       if (p != NULL)
-       {
-         size_t slot;
+        {
+          size_t slot;
 
-         p += HEADER_SIZE;
+          p += HEADER_SIZE;
 
-         /* Put a magic number into the indicator word.  */
-         ((int *) p)[-1] = MAGIC_NUMBER;
+          /* Put a magic number into the indicator word.  */
+          ((int *) p)[-1] = MAGIC_NUMBER;
 
-         /* Enter p into the hash table.  */
-         slot = (unsigned long) p % HASH_TABLE_SIZE;
-         ((struct header *) (p - HEADER_SIZE))->next = mmalloca_results[slot];
-         mmalloca_results[slot] = p;
+          /* Enter p into the hash table.  */
+          slot = (unsigned long) p % HASH_TABLE_SIZE;
+          ((struct header *) (p - HEADER_SIZE))->next = mmalloca_results[slot];
+          mmalloca_results[slot] = p;
 
-         return p;
-       }
+          return p;
+        }
     }
   /* Out of memory.  */
   return NULL;
@@ -109,28 +109,28 @@ freea (void *p)
   if (p != NULL)
     {
       /* Attempt to quickly distinguish the mmalloca() result - which has
-        a magic indicator word - and the alloca() result - which has an
-        uninitialized indicator word.  It is for this test that sa_increment
-        additional bytes are allocated in the alloca() case.  */
+         a magic indicator word - and the alloca() result - which has an
+         uninitialized indicator word.  It is for this test that sa_increment
+         additional bytes are allocated in the alloca() case.  */
       if (((int *) p)[-1] == MAGIC_NUMBER)
-       {
-         /* Looks like a mmalloca() result.  To see whether it really is one,
-            perform a lookup in the hash table.  */
-         size_t slot = (unsigned long) p % HASH_TABLE_SIZE;
-         void **chain = &mmalloca_results[slot];
-         for (; *chain != NULL;)
-           {
-             if (*chain == p)
-               {
-                 /* Found it.  Remove it from the hash table and free it.  */
-                 char *p_begin = (char *) p - HEADER_SIZE;
-                 *chain = ((struct header *) p_begin)->next;
-                 free (p_begin);
-                 return;
-               }
-             chain = &((struct header *) ((char *) *chain - 
HEADER_SIZE))->next;
-           }
-       }
+        {
+          /* Looks like a mmalloca() result.  To see whether it really is one,
+             perform a lookup in the hash table.  */
+          size_t slot = (unsigned long) p % HASH_TABLE_SIZE;
+          void **chain = &mmalloca_results[slot];
+          for (; *chain != NULL;)
+            {
+              if (*chain == p)
+                {
+                  /* Found it.  Remove it from the hash table and free it.  */
+                  char *p_begin = (char *) p - HEADER_SIZE;
+                  *chain = ((struct header *) p_begin)->next;
+                  free (p_begin);
+                  return;
+                }
+              chain = &((struct header *) ((char *) *chain - 
HEADER_SIZE))->next;
+            }
+        }
       /* At this point, we know it was not a mmalloca() result.  */
     }
 }
diff --git a/gltests/malloca.h b/gltests/malloca.h
index 3be0a38..9c3c1a3 100644
--- a/gltests/malloca.h
+++ b/gltests/malloca.h
@@ -54,7 +54,7 @@ extern "C" {
    the function returns.  Upon failure, it returns NULL.  */
 #if HAVE_ALLOCA
 # define malloca(N) \
-  ((N) < 4032 - sa_increment                                       \
+  ((N) < 4032 - sa_increment                                        \
    ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \
    : mmalloca (N))
 #else
@@ -122,10 +122,10 @@ enum
   sa_alignment_longdouble = sa_alignof (long double),
   sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
 #if HAVE_LONG_LONG_INT
-                     | (sa_alignment_longlong - 1)
+                      | (sa_alignment_longlong - 1)
 #endif
-                     | (sa_alignment_longdouble - 1)
-                    ) + 1,
+                      | (sa_alignment_longdouble - 1)
+                     ) + 1,
 /* The increment that guarantees room for a magic word must be >= sizeof (int)
    and a multiple of sa_alignment_max.  */
   sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * 
sa_alignment_max
diff --git a/gltests/putenv.c b/gltests/putenv.c
index cc14b93..d6dcdab 100644
--- a/gltests/putenv.c
+++ b/gltests/putenv.c
@@ -44,8 +44,8 @@ extern char **environ;
 /* This lock protects against simultaneous modifications of `environ'.  */
 # include <bits/libc-lock.h>
 __libc_lock_define_initialized (static, envlock)
-# define LOCK  __libc_lock_lock (envlock)
-# define UNLOCK        __libc_lock_unlock (envlock)
+# define LOCK   __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
 #else
 # define LOCK
 # define UNLOCK
@@ -71,13 +71,13 @@ _unsetenv (const char *name)
   while (*ep != NULL)
     if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
       {
-       /* Found it.  Remove this pointer by moving later ones back.  */
-       char **dp = ep;
+        /* Found it.  Remove this pointer by moving later ones back.  */
+        char **dp = ep;
 
-       do
-         dp[0] = dp[1];
-       while (*dp++);
-       /* Continue the loop in case NAME appears again.  */
+        do
+          dp[0] = dp[1];
+        while (*dp++);
+        /* Continue the loop in case NAME appears again.  */
       }
     else
       ++ep;
@@ -106,7 +106,7 @@ putenv (char *string)
   size = 0;
   for (ep = environ; *ep != NULL; ++ep)
     if (!strncmp (*ep, string, name_end - string) &&
-       (*ep)[name_end - string] == '=')
+        (*ep)[name_end - string] == '=')
       break;
     else
       ++size;
@@ -116,9 +116,9 @@ putenv (char *string)
       static char **last_environ = NULL;
       char **new_environ = (char **) malloc ((size + 2) * sizeof (char *));
       if (new_environ == NULL)
-       return -1;
+        return -1;
       (void) memcpy ((void *) new_environ, (void *) environ,
-                    size * sizeof (char *));
+                     size * sizeof (char *));
       new_environ[size] = (char *) string;
       new_environ[size + 1] = NULL;
       free (last_environ);
diff --git a/gltests/setenv.c b/gltests/setenv.c
index 0df5b21..93a5ef9 100644
--- a/gltests/setenv.c
+++ b/gltests/setenv.c
@@ -17,6 +17,11 @@
 #if !_LIBC
 # include <config.h>
 #endif
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   optimizes away the name == NULL test below.  */
+#define _GL_ARG_NONNULL(params)
+
 #include <alloca.h>
 
 /* Specification.  */
@@ -39,15 +44,15 @@
 #if _LIBC || !HAVE_SETENV
 
 #if !_LIBC
-# define __environ     environ
+# define __environ      environ
 #endif
 
 #if _LIBC
 /* This lock protects against simultaneous modifications of `environ'.  */
 # include <bits/libc-lock.h>
 __libc_lock_define_initialized (static, envlock)
-# define LOCK  __libc_lock_lock (envlock)
-# define UNLOCK        __libc_lock_unlock (envlock)
+# define LOCK   __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
 #else
 # define LOCK
 # define UNLOCK
@@ -66,8 +71,8 @@ __libc_lock_define_initialized (static, envlock)
    values are from a small set.  Outside glibc this will eat up all
    memory after a while.  */
 #if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \
-                     && defined __GNUC__)
-# define USE_TSEARCH   1
+                      && defined __GNUC__)
+# define USE_TSEARCH    1
 # include <search.h>
 typedef int (*compar_fn_t) (const void *, const void *);
 
@@ -76,9 +81,9 @@ typedef int (*compar_fn_t) (const void *, const void *);
 static void *known_values;
 
 # define KNOWN_VALUE(Str) \
-  ({                                                                         \
-    void *value = tfind (Str, &known_values, (compar_fn_t) strcmp);          \
-    value != NULL ? *(char **) value : NULL;                                 \
+  ({                                                                          \
+    void *value = tfind (Str, &known_values, (compar_fn_t) strcmp);           \
+    value != NULL ? *(char **) value : NULL;                                  \
   })
 # define STORE_VALUE(Str) \
   tsearch (Str, &known_values, (compar_fn_t) strcmp)
@@ -105,7 +110,7 @@ static char **last_environ;
    free the strings.  */
 int
 __add_to_environ (const char *name, const char *value, const char *combined,
-                 int replace)
+                  int replace)
 {
   register char **ep;
   register size_t size;
@@ -122,10 +127,10 @@ __add_to_environ (const char *name, const char *value, 
const char *combined,
   if (ep != NULL)
     {
       for (; *ep != NULL; ++ep)
-       if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
-         break;
-       else
-         ++size;
+        if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
+          break;
+        else
+          ++size;
     }
 
   if (ep == NULL || *ep == NULL)
@@ -137,76 +142,76 @@ __add_to_environ (const char *name, const char *value, 
const char *combined,
 
       /* We allocated this space; we can extend it.  */
       new_environ =
-       (char **) (last_environ == NULL
-                  ? malloc ((size + 2) * sizeof (char *))
-                  : realloc (last_environ, (size + 2) * sizeof (char *)));
+        (char **) (last_environ == NULL
+                   ? malloc ((size + 2) * sizeof (char *))
+                   : realloc (last_environ, (size + 2) * sizeof (char *)));
       if (new_environ == NULL)
-       {
-         UNLOCK;
-         return -1;
-       }
+        {
+          UNLOCK;
+          return -1;
+        }
 
       /* If the whole entry is given add it.  */
       if (combined != NULL)
-       /* We must not add the string to the search tree since it belongs
-          to the user.  */
-       new_environ[size] = (char *) combined;
+        /* We must not add the string to the search tree since it belongs
+           to the user.  */
+        new_environ[size] = (char *) combined;
       else
-       {
-         /* See whether the value is already known.  */
+        {
+          /* See whether the value is already known.  */
 #ifdef USE_TSEARCH
 # ifdef _LIBC
-         new_value = (char *) alloca (namelen + 1 + vallen);
-         __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
-                    value, vallen);
+          new_value = (char *) alloca (namelen + 1 + vallen);
+          __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+                     value, vallen);
 # else
-         new_value = (char *) malloca (namelen + 1 + vallen);
-         if (new_value == NULL)
-           {
-             __set_errno (ENOMEM);
-             UNLOCK;
-             return -1;
-           }
-         memcpy (new_value, name, namelen);
-         new_value[namelen] = '=';
-         memcpy (&new_value[namelen + 1], value, vallen);
+          new_value = (char *) malloca (namelen + 1 + vallen);
+          if (new_value == NULL)
+            {
+              __set_errno (ENOMEM);
+              UNLOCK;
+              return -1;
+            }
+          memcpy (new_value, name, namelen);
+          new_value[namelen] = '=';
+          memcpy (&new_value[namelen + 1], value, vallen);
 # endif
 
-         new_environ[size] = KNOWN_VALUE (new_value);
-         if (new_environ[size] == NULL)
+          new_environ[size] = KNOWN_VALUE (new_value);
+          if (new_environ[size] == NULL)
 #endif
-           {
-             new_environ[size] = (char *) malloc (namelen + 1 + vallen);
-             if (new_environ[size] == NULL)
-               {
+            {
+              new_environ[size] = (char *) malloc (namelen + 1 + vallen);
+              if (new_environ[size] == NULL)
+                {
 #if defined USE_TSEARCH && !defined _LIBC
-                 freea (new_value);
+                  freea (new_value);
 #endif
-                 __set_errno (ENOMEM);
-                 UNLOCK;
-                 return -1;
-               }
+                  __set_errno (ENOMEM);
+                  UNLOCK;
+                  return -1;
+                }
 
 #ifdef USE_TSEARCH
-             memcpy (new_environ[size], new_value, namelen + 1 + vallen);
+              memcpy (new_environ[size], new_value, namelen + 1 + vallen);
 #else
-             memcpy (new_environ[size], name, namelen);
-             new_environ[size][namelen] = '=';
-             memcpy (&new_environ[size][namelen + 1], value, vallen);
+              memcpy (new_environ[size], name, namelen);
+              new_environ[size][namelen] = '=';
+              memcpy (&new_environ[size][namelen + 1], value, vallen);
 #endif
-             /* And save the value now.  We cannot do this when we remove
-                the string since then we cannot decide whether it is a
-                user string or not.  */
-             STORE_VALUE (new_environ[size]);
-           }
+              /* And save the value now.  We cannot do this when we remove
+                 the string since then we cannot decide whether it is a
+                 user string or not.  */
+              STORE_VALUE (new_environ[size]);
+            }
 #if defined USE_TSEARCH && !defined _LIBC
-         freea (new_value);
+          freea (new_value);
 #endif
-       }
+        }
 
       if (__environ != last_environ)
-       memcpy ((char *) new_environ, (char *) __environ,
-               size * sizeof (char *));
+        memcpy ((char *) new_environ, (char *) __environ,
+                size * sizeof (char *));
 
       new_environ[size + 1] = NULL;
 
@@ -218,57 +223,57 @@ __add_to_environ (const char *name, const char *value, 
const char *combined,
 
       /* Use the user string if given.  */
       if (combined != NULL)
-       np = (char *) combined;
+        np = (char *) combined;
       else
-       {
+        {
 #ifdef USE_TSEARCH
-         char *new_value;
+          char *new_value;
 # ifdef _LIBC
-         new_value = alloca (namelen + 1 + vallen);
-         __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
-                    value, vallen);
+          new_value = alloca (namelen + 1 + vallen);
+          __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+                     value, vallen);
 # else
-         new_value = malloca (namelen + 1 + vallen);
-         if (new_value == NULL)
-           {
-             __set_errno (ENOMEM);
-             UNLOCK;
-             return -1;
-           }
-         memcpy (new_value, name, namelen);
-         new_value[namelen] = '=';
-         memcpy (&new_value[namelen + 1], value, vallen);
+          new_value = malloca (namelen + 1 + vallen);
+          if (new_value == NULL)
+            {
+              __set_errno (ENOMEM);
+              UNLOCK;
+              return -1;
+            }
+          memcpy (new_value, name, namelen);
+          new_value[namelen] = '=';
+          memcpy (&new_value[namelen + 1], value, vallen);
 # endif
 
-         np = KNOWN_VALUE (new_value);
-         if (np == NULL)
+          np = KNOWN_VALUE (new_value);
+          if (np == NULL)
 #endif
-           {
-             np = malloc (namelen + 1 + vallen);
-             if (np == NULL)
-               {
+            {
+              np = malloc (namelen + 1 + vallen);
+              if (np == NULL)
+                {
 #if defined USE_TSEARCH && !defined _LIBC
-                 freea (new_value);
+                  freea (new_value);
 #endif
-                 __set_errno (ENOMEM);
-                 UNLOCK;
-                 return -1;
-               }
+                  __set_errno (ENOMEM);
+                  UNLOCK;
+                  return -1;
+                }
 
 #ifdef USE_TSEARCH
-             memcpy (np, new_value, namelen + 1 + vallen);
+              memcpy (np, new_value, namelen + 1 + vallen);
 #else
-             memcpy (np, name, namelen);
-             np[namelen] = '=';
-             memcpy (&np[namelen + 1], value, vallen);
+              memcpy (np, name, namelen);
+              np[namelen] = '=';
+              memcpy (&np[namelen + 1], value, vallen);
 #endif
-             /* And remember the value.  */
-             STORE_VALUE (np);
-           }
+              /* And remember the value.  */
+              STORE_VALUE (np);
+            }
 #if defined USE_TSEARCH && !defined _LIBC
-         freea (new_value);
+          freea (new_value);
 #endif
-       }
+        }
 
       *ep = np;
     }
diff --git a/lib/gl/stdbool.in.h b/gltests/stdbool.in.h
similarity index 94%
copy from lib/gl/stdbool.in.h
copy to gltests/stdbool.in.h
index 45375b3..cffa0ab 100644
--- a/lib/gl/stdbool.in.h
+++ b/gltests/stdbool.in.h
@@ -2,16 +2,16 @@
    Written by Bruno Haible <address@hidden>, 2001.
 
    This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as published by
-   the Free Software Foundation; either version 2.1, or (at your option)
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU Lesser General Public License for more details.
+   GNU General Public License for more details.
 
-   You should have received a copy of the GNU Lesser General Public License
+   You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
diff --git a/gltests/stdint.in.h b/gltests/stdint.in.h
index 53aa34a..9467e75 100644
--- a/gltests/stdint.in.h
+++ b/gltests/stdint.in.h
@@ -102,8 +102,8 @@
   ((signed) \
    ? ~ _STDINT_MIN (signed, bits, zero) \
    : /* The expression for the unsigned case.  The subtraction of (signed) \
-       is a nop in the unsigned case and avoids "signed integer overflow" \
-       warnings in the signed case.  */ \
+        is a nop in the unsigned case and avoids "signed integer overflow" \
+        warnings in the signed case.  */ \
      ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
 /* 7.18.1.1. Exact-width integer types */
@@ -454,10 +454,10 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == 
sizeof (uintmax_t)) -
 #undef SIG_ATOMIC_MAX
 #define SIG_ATOMIC_MIN  \
    _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-               address@hidden@)
+                address@hidden@)
 #define SIG_ATOMIC_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-               address@hidden@)
+                address@hidden@)
 
 
 /* size_t limit */
diff --git a/gltests/stdlib.in.h b/gltests/stdlib.in.h
index dd15ac0..af9c35e 100644
--- a/gltests/stdlib.in.h
+++ b/gltests/stdlib.in.h
@@ -56,18 +56,20 @@
 #if address@hidden@
 struct random_data
 {
-  int32_t *fptr;               /* Front pointer.  */
-  int32_t *rptr;               /* Rear pointer.  */
-  int32_t *state;              /* Array of state values.  */
-  int rand_type;               /* Type of random number generator.  */
-  int rand_deg;                        /* Degree of random number generator.  
*/
-  int rand_sep;                        /* Distance between front and rear.  */
-  int32_t *end_ptr;            /* Pointer behind state table.  */
+  int32_t *fptr;                /* Front pointer.  */
+  int32_t *rptr;                /* Rear pointer.  */
+  int32_t *state;               /* Array of state values.  */
+  int rand_type;                /* Type of random number generator.  */
+  int rand_deg;                 /* Degree of random number generator.  */
+  int rand_sep;                 /* Distance between front and rear.  */
+  int32_t *end_ptr;             /* Pointer behind state table.  */
 };
 #endif
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 
 /* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
 #ifndef EXIT_SUCCESS
@@ -91,7 +93,7 @@ extern "C" {
 # if address@hidden@
 /* Parse a signed decimal integer.
    Returns the value of the integer.  Errors are not detected.  */
-extern long long atoll (const char *string);
+extern long long atoll (const char *string) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef atoll
@@ -120,7 +122,7 @@ extern void * calloc (size_t nmemb, size_t size);
 #  define canonicalize_file_name rpl_canonicalize_file_name
 # endif
 # if address@hidden@ || @REPLACE_CANONICALIZE_FILE_NAME@
-extern char *canonicalize_file_name (const char *name);
+extern char *canonicalize_file_name (const char *name) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef canonicalize_file_name
@@ -136,7 +138,7 @@ extern char *canonicalize_file_name (const char *name);
    The three numbers are the load average of the last 1 minute, the last 5
    minutes, and the last 15 minutes, respectively.
    LOADAVG is an array of NELEM numbers.  */
-extern int getloadavg (double loadavg[], int nelem);
+extern int getloadavg (double loadavg[], int nelem) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getloadavg
@@ -159,7 +161,8 @@ extern int getloadavg (double loadavg[], int nelem);
    For more details see the POSIX:2001 specification.
    http://www.opengroup.org/susv3xsh/getsubopt.html */
 # if address@hidden@
-extern int getsubopt (char **optionp, char *const *tokens, char **valuep);
+extern int getsubopt (char **optionp, char *const *tokens, char **valuep)
+     _GL_ARG_NONNULL ((1, 2, 3));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getsubopt
@@ -190,7 +193,7 @@ extern void * malloc (size_t size);
    they are replaced with a string that makes the directory name unique.
    Returns TEMPLATE, or a null pointer if it cannot get a unique name.
    The directory is created mode 700.  */
-extern char * mkdtemp (char * /*template*/);
+extern char * mkdtemp (char * /*template*/) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkdtemp
@@ -214,7 +217,7 @@ extern char * mkdtemp (char * /*template*/);
    implementation.
    Returns the open file descriptor if successful, otherwise -1 and errno
    set.  */
-extern int mkostemp (char * /*template*/, int /*flags*/);
+extern int mkostemp (char * /*template*/, int /*flags*/) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkostemp
@@ -239,7 +242,8 @@ extern int mkostemp (char * /*template*/, int /*flags*/);
    implementation.
    Returns the open file descriptor if successful, otherwise -1 and errno
    set.  */
-extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/);
+extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/)
+     _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkostemps
@@ -261,7 +265,7 @@ extern int mkostemps (char * /*template*/, int 
/*suffixlen*/, int /*flags*/);
    Returns the open file descriptor if successful, otherwise -1 and errno
    set.  */
 #  define mkstemp rpl_mkstemp
-extern int mkstemp (char * /*template*/);
+extern int mkstemp (char * /*template*/) _GL_ARG_NONNULL ((1));
 # else
 /* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
 #  include <unistd.h>
@@ -286,7 +290,8 @@ extern int mkstemp (char * /*template*/);
    implementation.
    Returns the open file descriptor if successful, otherwise -1 and errno
    set.  */
-extern int mkstemps (char * /*template*/, int /*suffixlen*/);
+extern int mkstemps (char * /*template*/, int /*suffixlen*/)
+     _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mkstemps
@@ -300,7 +305,7 @@ extern int mkstemps (char * /*template*/, int 
/*suffixlen*/);
 # if @REPLACE_PUTENV@
 #  undef putenv
 #  define putenv rpl_putenv
-extern int putenv (char *string);
+extern int putenv (char *string) _GL_ARG_NONNULL ((1));
 # endif
 #endif
 
@@ -311,30 +316,34 @@ extern int putenv (char *string);
 #   define RAND_MAX 2147483647
 #  endif
 
-int srandom_r (unsigned int seed, struct random_data *rand_state);
+int srandom_r (unsigned int seed, struct random_data *rand_state)
+     _GL_ARG_NONNULL ((2));
 int initstate_r (unsigned int seed, char *buf, size_t buf_size,
-                struct random_data *rand_state);
-int setstate_r (char *arg_state, struct random_data *rand_state);
-int random_r (struct random_data *buf, int32_t *result);
+                 struct random_data *rand_state)
+     _GL_ARG_NONNULL ((2, 4));
+int setstate_r (char *arg_state, struct random_data *rand_state)
+     _GL_ARG_NONNULL ((1, 2));
+int random_r (struct random_data *buf, int32_t *result)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef random_r
-# define random_r(b,r)                           \
+# define random_r(b,r)                            \
     (GL_LINK_WARNING ("random_r is unportable - " \
                       "use gnulib module random_r for portability"), \
      random_r (b,r))
 # undef initstate_r
-# define initstate_r(s,b,sz,r)                      \
+# define initstate_r(s,b,sz,r)                       \
     (GL_LINK_WARNING ("initstate_r is unportable - " \
                       "use gnulib module random_r for portability"), \
      initstate_r (s,b,sz,r))
 # undef srandom_r
-# define srandom_r(s,r)                                   \
+# define srandom_r(s,r)                            \
     (GL_LINK_WARNING ("srandom_r is unportable - " \
                       "use gnulib module random_r for portability"), \
      srandom_r (s,r))
 # undef setstate_r
-# define setstate_r(a,r)                                   \
+# define setstate_r(a,r)                                    \
     (GL_LINK_WARNING ("setstate_r is unportable - " \
                       "use gnulib module random_r for portability"), \
      setstate_r (a,r))
@@ -359,7 +368,7 @@ extern void * realloc (void *ptr, size_t size);
 #  define realpath rpl_realpath
 # endif
 # if address@hidden@ || @REPLACE_REALPATH@
-extern char *realpath (const char *name, char *resolved);
+extern char *realpath (const char *name, char *resolved) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef realpath
@@ -373,7 +382,7 @@ extern char *realpath (const char *name, char *resolved);
 # if address@hidden@
 /* Test a user response to a question.
    Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
-extern int rpmatch (const char *response);
+extern int rpmatch (const char *response) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef rpmatch
@@ -391,7 +400,8 @@ extern int rpmatch (const char *response);
 # if address@hidden@ || @REPLACE_SETENV@
 /* Set NAME to VALUE in the environment.
    If REPLACE is nonzero, overwrite an existing value.  */
-extern int setenv (const char *name, const char *value, int replace);
+extern int setenv (const char *name, const char *value, int replace)
+     _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef setenv
@@ -407,7 +417,7 @@ extern int setenv (const char *name, const char *value, int 
replace);
 # endif
 # if address@hidden@ || @REPLACE_STRTOD@
  /* Parse a double from STRING, updating ENDP if appropriate.  */
-extern double strtod (const char *str, char **endp);
+extern double strtod (const char *str, char **endp) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strtod
@@ -427,7 +437,8 @@ extern double strtod (const char *str, char **endp);
    stored in *ENDPTR.
    Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
    to ERANGE.  */
-extern long long strtoll (const char *string, char **endptr, int base);
+extern long long strtoll (const char *string, char **endptr, int base)
+     _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strtoll
@@ -447,7 +458,8 @@ extern long long strtoll (const char *string, char 
**endptr, int base);
    stored in *ENDPTR.
    Upon overflow, the return value is ULLONG_MAX, and errno is set to
    ERANGE.  */
-extern unsigned long long strtoull (const char *string, char **endptr, int 
base);
+extern unsigned long long strtoull (const char *string, char **endptr, int 
base)
+     _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strtoull
@@ -464,7 +476,7 @@ extern unsigned long long strtoull (const char *string, 
char **endptr, int base)
 # endif
 # if address@hidden@ || @REPLACE_UNSETENV@
 /* Remove the variable NAME from the environment.  */
-extern int unsetenv (const char *name);
+extern int unsetenv (const char *name) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef unsetenv
diff --git a/gltests/test-environ.c b/gltests/test-environ.c
index d9501bb..b8edc50 100644
--- a/gltests/test-environ.c
+++ b/gltests/test-environ.c
@@ -36,8 +36,8 @@ main ()
   for (; (string = *remaining_variables) != NULL; remaining_variables++)
     {
       if (strncmp (string, "PATH=", 5) == 0)
-       /* Found the PATH environment variable.  */
-       return 0;
+        /* Found the PATH environment variable.  */
+        return 0;
     }
   /* Failed to find the PATH environment variable.  */
   return 1;
diff --git a/gltests/test-getopt.c b/gltests/test-getopt.c
index 6c59d47..bf85a0d 100644
--- a/gltests/test-getopt.c
+++ b/gltests/test-getopt.c
@@ -28,15 +28,15 @@
 #include <string.h>
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 /* The glibc/gnulib implementation of getopt supports setting optind = 0,
@@ -55,14 +55,18 @@
 int
 main (void)
 {
-  unsetenv ("POSIXLY_CORRECT");
+  setenv ("POSIXLY_CORRECT", "1", 1);
+  test_getopt ();
+
+#if GNULIB_GETOPT_GNU
+  test_getopt_long_posix ();
+#endif
 
+  unsetenv ("POSIXLY_CORRECT");
   test_getopt ();
+
 #if GNULIB_GETOPT_GNU
   test_getopt_long ();
-
-  setenv ("POSIXLY_CORRECT", "1", 0);
-  test_getopt_long_posix ();
 #endif
 
   return 0;
diff --git a/gltests/test-getopt.h b/gltests/test-getopt.h
index 4efec4b..bcc7fe6 100644
--- a/gltests/test-getopt.h
+++ b/gltests/test-getopt.h
@@ -16,13 +16,15 @@
 
 /* Written by Bruno Haible <address@hidden>, 2009.  */
 
+#include <stdbool.h>
+
 static void
 getopt_loop (int argc, const char **argv,
-            const char *options,
-            int *a_seen, int *b_seen,
-            const char **p_value, const char **q_value,
-            int *non_options_count, const char **non_options,
-            int *unrecognized)
+             const char *options,
+             int *a_seen, int *b_seen,
+             const char **p_value, const char **q_value,
+             int *non_options_count, const char **non_options,
+             int *unrecognized)
 {
   int c;
 
@@ -30,31 +32,31 @@ getopt_loop (int argc, const char **argv,
   while ((c = getopt (argc, (char **) argv, options)) != -1)
     {
       switch (c)
-       {
-       case 'a':
-         (*a_seen)++;
-         break;
-       case 'b':
-         (*b_seen)++;
-         break;
-       case 'p':
-         *p_value = optarg;
-         break;
-       case 'q':
-         *q_value = optarg;
-         break;
-       case '\1':
-         /* Must only happen with option '-' at the beginning.  */
-         ASSERT (options[0] == '-');
-         non_options[(*non_options_count)++] = optarg;
-         break;
-       case '?':
-         *unrecognized = optopt;
-         break;
-       default:
-         *unrecognized = c;
-         break;
-       }
+        {
+        case 'a':
+          (*a_seen)++;
+          break;
+        case 'b':
+          (*b_seen)++;
+          break;
+        case 'p':
+          *p_value = optarg;
+          break;
+        case 'q':
+          *q_value = optarg;
+          break;
+        case '\1':
+          /* Must only happen with option '-' at the beginning.  */
+          ASSERT (options[0] == '-');
+          non_options[(*non_options_count)++] = optarg;
+          break;
+        case '?':
+          *unrecognized = optopt;
+          break;
+        default:
+          *unrecognized = c;
+          break;
+        }
     }
 }
 
@@ -62,6 +64,14 @@ static void
 test_getopt (void)
 {
   int start;
+  bool posixly = !!getenv ("POSIXLY_CORRECT");
+  /* See comment in getopt.c:
+     glibc gets a LSB-compliant getopt.
+     Standalone applications get a POSIX-compliant getopt.  */
+#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2 || defined __MINGW32__)
+  /* Using getopt from gnulib or from a non-glibc system.  */
+  posixly = true;
+#endif
 
   /* Test processing of boolean options.  */
   for (start = OPTIND_MIN; start <= 1; start++)
@@ -80,10 +90,11 @@ test_getopt (void)
       argv[argc++] = "-a";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "ab",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -109,10 +120,11 @@ test_getopt (void)
       argv[argc++] = "-a";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "ab",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 1);
       ASSERT (p_value == NULL);
@@ -137,10 +149,11 @@ test_getopt (void)
       argv[argc++] = "-ba";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "ab",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 1);
       ASSERT (p_value == NULL);
@@ -166,10 +179,11 @@ test_getopt (void)
       argv[argc++] = "-a";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "ab",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 2);
       ASSERT (b_seen == 1);
       ASSERT (p_value == NULL);
@@ -195,10 +209,11 @@ test_getopt (void)
       argv[argc++] = "program";
       argv[argc++] = "-pfoo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "p:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -223,10 +238,11 @@ test_getopt (void)
       argv[argc++] = "-p";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "p:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -253,10 +269,11 @@ test_getopt (void)
       argv[argc++] = "baz";
       argv[argc++] = "-pfoo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "abp:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 1);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -283,10 +300,11 @@ test_getopt (void)
       argv[argc++] = "program";
       argv[argc++] = "-pfoo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "p::q::",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -311,10 +329,11 @@ test_getopt (void)
       argv[argc++] = "-p";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "p::q::",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -339,10 +358,11 @@ test_getopt (void)
       argv[argc++] = "-p";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "abp::q::",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -372,10 +392,11 @@ test_getopt (void)
       argv[argc++] = "-x";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "abp:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -405,46 +426,47 @@ test_getopt (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "abp:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
-      /* See comment in getopt.c:
-         glibc gets a LSB-compliant getopt.
-         Standalone applications get a POSIX-compliant getopt.  */
-#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2 || defined __MINGW32__)
-      /* Using getopt from gnulib or from a non-glibc system.  */
-      ASSERT (strcmp (argv[0], "program") == 0);
-      ASSERT (strcmp (argv[1], "donald") == 0);
-      ASSERT (strcmp (argv[2], "-p") == 0);
-      ASSERT (strcmp (argv[3], "billy") == 0);
-      ASSERT (strcmp (argv[4], "duck") == 0);
-      ASSERT (strcmp (argv[5], "-a") == 0);
-      ASSERT (strcmp (argv[6], "bar") == 0);
-      ASSERT (a_seen == 0);
-      ASSERT (b_seen == 0);
-      ASSERT (p_value == NULL);
-      ASSERT (q_value == NULL);
-      ASSERT (non_options_count == 0);
-      ASSERT (unrecognized == 0);
-      ASSERT (optind == 1);
-#else
-      /* Using getopt from glibc.  */
-      ASSERT (strcmp (argv[0], "program") == 0);
-      ASSERT (strcmp (argv[1], "-p") == 0);
-      ASSERT (strcmp (argv[2], "billy") == 0);
-      ASSERT (strcmp (argv[3], "-a") == 0);
-      ASSERT (strcmp (argv[4], "donald") == 0);
-      ASSERT (strcmp (argv[5], "duck") == 0);
-      ASSERT (strcmp (argv[6], "bar") == 0);
-      ASSERT (a_seen == 1);
-      ASSERT (b_seen == 0);
-      ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
-      ASSERT (q_value == NULL);
-      ASSERT (non_options_count == 0);
-      ASSERT (unrecognized == 0);
-      ASSERT (optind == 4);
-#endif
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
+      if (posixly)
+        {
+          ASSERT (strcmp (argv[0], "program") == 0);
+          ASSERT (strcmp (argv[1], "donald") == 0);
+          ASSERT (strcmp (argv[2], "-p") == 0);
+          ASSERT (strcmp (argv[3], "billy") == 0);
+          ASSERT (strcmp (argv[4], "duck") == 0);
+          ASSERT (strcmp (argv[5], "-a") == 0);
+          ASSERT (strcmp (argv[6], "bar") == 0);
+          ASSERT (argv[7] == NULL);
+          ASSERT (a_seen == 0);
+          ASSERT (b_seen == 0);
+          ASSERT (p_value == NULL);
+          ASSERT (q_value == NULL);
+          ASSERT (non_options_count == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 1);
+        }
+      else
+        {
+          ASSERT (strcmp (argv[0], "program") == 0);
+          ASSERT (strcmp (argv[1], "-p") == 0);
+          ASSERT (strcmp (argv[2], "billy") == 0);
+          ASSERT (strcmp (argv[3], "-a") == 0);
+          ASSERT (strcmp (argv[4], "donald") == 0);
+          ASSERT (strcmp (argv[5], "duck") == 0);
+          ASSERT (strcmp (argv[6], "bar") == 0);
+          ASSERT (argv[7] == NULL);
+          ASSERT (a_seen == 1);
+          ASSERT (b_seen == 0);
+          ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+          ASSERT (q_value == NULL);
+          ASSERT (non_options_count == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 4);
+        }
     }
 
   /* Check that '--' ends the argument processing.  */
@@ -472,56 +494,57 @@ test_getopt (void)
       argv[argc++] = "-q";
       argv[argc++] = "johnny";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "abp:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
-      /* See comment in getopt.c:
-         glibc gets a LSB-compliant getopt.
-         Standalone applications get a POSIX-compliant getopt.  */
-#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2 || defined __MINGW32__)
-      /* Using getopt from gnulib or from a non-glibc system.  */
-      ASSERT (strcmp (argv[0], "program") == 0);
-      ASSERT (strcmp (argv[1], "donald") == 0);
-      ASSERT (strcmp (argv[2], "-p") == 0);
-      ASSERT (strcmp (argv[3], "billy") == 0);
-      ASSERT (strcmp (argv[4], "duck") == 0);
-      ASSERT (strcmp (argv[5], "-a") == 0);
-      ASSERT (strcmp (argv[6], "--") == 0);
-      ASSERT (strcmp (argv[7], "-b") == 0);
-      ASSERT (strcmp (argv[8], "foo") == 0);
-      ASSERT (strcmp (argv[9], "-q") == 0);
-      ASSERT (strcmp (argv[10], "johnny") == 0);
-      ASSERT (strcmp (argv[11], "bar") == 0);
-      ASSERT (a_seen == 0);
-      ASSERT (b_seen == 0);
-      ASSERT (p_value == NULL);
-      ASSERT (q_value == NULL);
-      ASSERT (non_options_count == 0);
-      ASSERT (unrecognized == 0);
-      ASSERT (optind == 1);
-#else
-      /* Using getopt from glibc.  */
-      ASSERT (strcmp (argv[0], "program") == 0);
-      ASSERT (strcmp (argv[1], "-p") == 0);
-      ASSERT (strcmp (argv[2], "billy") == 0);
-      ASSERT (strcmp (argv[3], "-a") == 0);
-      ASSERT (strcmp (argv[4], "--") == 0);
-      ASSERT (strcmp (argv[5], "donald") == 0);
-      ASSERT (strcmp (argv[6], "duck") == 0);
-      ASSERT (strcmp (argv[7], "-b") == 0);
-      ASSERT (strcmp (argv[8], "foo") == 0);
-      ASSERT (strcmp (argv[9], "-q") == 0);
-      ASSERT (strcmp (argv[10], "johnny") == 0);
-      ASSERT (strcmp (argv[11], "bar") == 0);
-      ASSERT (a_seen == 1);
-      ASSERT (b_seen == 0);
-      ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
-      ASSERT (q_value == NULL);
-      ASSERT (non_options_count == 0);
-      ASSERT (unrecognized == 0);
-      ASSERT (optind == 5);
-#endif
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
+      if (posixly)
+        {
+          ASSERT (strcmp (argv[0], "program") == 0);
+          ASSERT (strcmp (argv[1], "donald") == 0);
+          ASSERT (strcmp (argv[2], "-p") == 0);
+          ASSERT (strcmp (argv[3], "billy") == 0);
+          ASSERT (strcmp (argv[4], "duck") == 0);
+          ASSERT (strcmp (argv[5], "-a") == 0);
+          ASSERT (strcmp (argv[6], "--") == 0);
+          ASSERT (strcmp (argv[7], "-b") == 0);
+          ASSERT (strcmp (argv[8], "foo") == 0);
+          ASSERT (strcmp (argv[9], "-q") == 0);
+          ASSERT (strcmp (argv[10], "johnny") == 0);
+          ASSERT (strcmp (argv[11], "bar") == 0);
+          ASSERT (argv[12] == NULL);
+          ASSERT (a_seen == 0);
+          ASSERT (b_seen == 0);
+          ASSERT (p_value == NULL);
+          ASSERT (q_value == NULL);
+          ASSERT (non_options_count == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 1);
+        }
+      else
+        {
+          ASSERT (strcmp (argv[0], "program") == 0);
+          ASSERT (strcmp (argv[1], "-p") == 0);
+          ASSERT (strcmp (argv[2], "billy") == 0);
+          ASSERT (strcmp (argv[3], "-a") == 0);
+          ASSERT (strcmp (argv[4], "--") == 0);
+          ASSERT (strcmp (argv[5], "donald") == 0);
+          ASSERT (strcmp (argv[6], "duck") == 0);
+          ASSERT (strcmp (argv[7], "-b") == 0);
+          ASSERT (strcmp (argv[8], "foo") == 0);
+          ASSERT (strcmp (argv[9], "-q") == 0);
+          ASSERT (strcmp (argv[10], "johnny") == 0);
+          ASSERT (strcmp (argv[11], "bar") == 0);
+          ASSERT (argv[12] == NULL);
+          ASSERT (a_seen == 1);
+          ASSERT (b_seen == 0);
+          ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+          ASSERT (q_value == NULL);
+          ASSERT (non_options_count == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 5);
+        }
     }
 
 #if GNULIB_GETOPT_GNU
@@ -545,10 +568,11 @@ test_getopt (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "-abp:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "donald") == 0);
       ASSERT (strcmp (argv[2], "-p") == 0);
@@ -556,6 +580,7 @@ test_getopt (void)
       ASSERT (strcmp (argv[4], "duck") == 0);
       ASSERT (strcmp (argv[5], "-a") == 0);
       ASSERT (strcmp (argv[6], "bar") == 0);
+      ASSERT (argv[7] == NULL);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
@@ -593,10 +618,11 @@ test_getopt (void)
       argv[argc++] = "-q";
       argv[argc++] = "johnny";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "-abp:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "donald") == 0);
       ASSERT (strcmp (argv[2], "-p") == 0);
@@ -609,32 +635,33 @@ test_getopt (void)
       ASSERT (strcmp (argv[9], "-q") == 0);
       ASSERT (strcmp (argv[10], "johnny") == 0);
       ASSERT (strcmp (argv[11], "bar") == 0);
+      ASSERT (argv[12] == NULL);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
       ASSERT (q_value == NULL);
       if (non_options_count == 2)
         {
-         /* glibc behaviour.  */
-         ASSERT (non_options_count == 2);
-         ASSERT (strcmp (non_options[0], "donald") == 0);
-         ASSERT (strcmp (non_options[1], "duck") == 0);
-         ASSERT (unrecognized == 0);
-         ASSERT (optind == 7);
+          /* glibc behaviour.  */
+          ASSERT (non_options_count == 2);
+          ASSERT (strcmp (non_options[0], "donald") == 0);
+          ASSERT (strcmp (non_options[1], "duck") == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 7);
         }
       else
         {
-         /* Another valid behaviour.  */
-         ASSERT (non_options_count == 7);
-         ASSERT (strcmp (non_options[0], "donald") == 0);
-         ASSERT (strcmp (non_options[1], "duck") == 0);
-         ASSERT (strcmp (non_options[2], "-b") == 0);
-         ASSERT (strcmp (non_options[3], "foo") == 0);
-         ASSERT (strcmp (non_options[4], "-q") == 0);
-         ASSERT (strcmp (non_options[5], "johnny") == 0);
-         ASSERT (strcmp (non_options[6], "bar") == 0);
-         ASSERT (unrecognized == 0);
-         ASSERT (optind == 12);
+          /* Another valid behaviour.  */
+          ASSERT (non_options_count == 7);
+          ASSERT (strcmp (non_options[0], "donald") == 0);
+          ASSERT (strcmp (non_options[1], "duck") == 0);
+          ASSERT (strcmp (non_options[2], "-b") == 0);
+          ASSERT (strcmp (non_options[3], "foo") == 0);
+          ASSERT (strcmp (non_options[4], "-q") == 0);
+          ASSERT (strcmp (non_options[5], "johnny") == 0);
+          ASSERT (strcmp (non_options[6], "bar") == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 12);
         }
     }
 #endif
@@ -659,46 +686,47 @@ test_getopt (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "abp:q:-",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
-      /* See comment in getopt.c:
-         glibc gets a LSB-compliant getopt.
-         Standalone applications get a POSIX-compliant getopt.  */
-#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2 || defined __MINGW32__)
-      /* Using getopt from gnulib or from a non-glibc system.  */
-      ASSERT (strcmp (argv[0], "program") == 0);
-      ASSERT (strcmp (argv[1], "donald") == 0);
-      ASSERT (strcmp (argv[2], "-p") == 0);
-      ASSERT (strcmp (argv[3], "billy") == 0);
-      ASSERT (strcmp (argv[4], "duck") == 0);
-      ASSERT (strcmp (argv[5], "-a") == 0);
-      ASSERT (strcmp (argv[6], "bar") == 0);
-      ASSERT (a_seen == 0);
-      ASSERT (b_seen == 0);
-      ASSERT (p_value == NULL);
-      ASSERT (q_value == NULL);
-      ASSERT (non_options_count == 0);
-      ASSERT (unrecognized == 0);
-      ASSERT (optind == 1);
-#else
-      /* Using getopt from glibc.  */
-      ASSERT (strcmp (argv[0], "program") == 0);
-      ASSERT (strcmp (argv[1], "-p") == 0);
-      ASSERT (strcmp (argv[2], "billy") == 0);
-      ASSERT (strcmp (argv[3], "-a") == 0);
-      ASSERT (strcmp (argv[4], "donald") == 0);
-      ASSERT (strcmp (argv[5], "duck") == 0);
-      ASSERT (strcmp (argv[6], "bar") == 0);
-      ASSERT (a_seen == 1);
-      ASSERT (b_seen == 0);
-      ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
-      ASSERT (q_value == NULL);
-      ASSERT (non_options_count == 0);
-      ASSERT (unrecognized == 0);
-      ASSERT (optind == 4);
-#endif
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
+      if (posixly)
+        {
+          ASSERT (strcmp (argv[0], "program") == 0);
+          ASSERT (strcmp (argv[1], "donald") == 0);
+          ASSERT (strcmp (argv[2], "-p") == 0);
+          ASSERT (strcmp (argv[3], "billy") == 0);
+          ASSERT (strcmp (argv[4], "duck") == 0);
+          ASSERT (strcmp (argv[5], "-a") == 0);
+          ASSERT (strcmp (argv[6], "bar") == 0);
+          ASSERT (argv[7] == NULL);
+          ASSERT (a_seen == 0);
+          ASSERT (b_seen == 0);
+          ASSERT (p_value == NULL);
+          ASSERT (q_value == NULL);
+          ASSERT (non_options_count == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 1);
+        }
+      else
+        {
+          ASSERT (strcmp (argv[0], "program") == 0);
+          ASSERT (strcmp (argv[1], "-p") == 0);
+          ASSERT (strcmp (argv[2], "billy") == 0);
+          ASSERT (strcmp (argv[3], "-a") == 0);
+          ASSERT (strcmp (argv[4], "donald") == 0);
+          ASSERT (strcmp (argv[5], "duck") == 0);
+          ASSERT (strcmp (argv[6], "bar") == 0);
+          ASSERT (argv[7] == NULL);
+          ASSERT (a_seen == 1);
+          ASSERT (b_seen == 0);
+          ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+          ASSERT (q_value == NULL);
+          ASSERT (non_options_count == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 4);
+        }
     }
 
   /* Check that the '+' flag causes the first non-option to terminate the
@@ -722,10 +750,11 @@ test_getopt (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "+abp:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "donald") == 0);
       ASSERT (strcmp (argv[2], "-p") == 0);
@@ -733,6 +762,7 @@ test_getopt (void)
       ASSERT (strcmp (argv[4], "duck") == 0);
       ASSERT (strcmp (argv[5], "-a") == 0);
       ASSERT (strcmp (argv[6], "bar") == 0);
+      ASSERT (argv[7] == NULL);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -755,10 +785,11 @@ test_getopt (void)
 
       argv[argc++] = "program";
       argv[argc++] = "-+";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "+abp:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -793,10 +824,11 @@ test_getopt (void)
       argv[argc++] = "-q";
       argv[argc++] = "johnny";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "+abp:q:",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "donald") == 0);
       ASSERT (strcmp (argv[2], "-p") == 0);
@@ -809,6 +841,7 @@ test_getopt (void)
       ASSERT (strcmp (argv[9], "-q") == 0);
       ASSERT (strcmp (argv[10], "johnny") == 0);
       ASSERT (strcmp (argv[11], "bar") == 0);
+      ASSERT (argv[12] == NULL);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -838,45 +871,46 @@ test_getopt (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_loop (argc, argv, "abp:q:+",
-                  &a_seen, &b_seen, &p_value, &q_value,
-                  &non_options_count, non_options, &unrecognized);
-      /* See comment in getopt.c:
-         glibc gets a LSB-compliant getopt.
-         Standalone applications get a POSIX-compliant getopt.  */
-#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2 || defined __MINGW32__)
-      /* Using getopt from gnulib or from a non-glibc system.  */
-      ASSERT (strcmp (argv[0], "program") == 0);
-      ASSERT (strcmp (argv[1], "donald") == 0);
-      ASSERT (strcmp (argv[2], "-p") == 0);
-      ASSERT (strcmp (argv[3], "billy") == 0);
-      ASSERT (strcmp (argv[4], "duck") == 0);
-      ASSERT (strcmp (argv[5], "-a") == 0);
-      ASSERT (strcmp (argv[6], "bar") == 0);
-      ASSERT (a_seen == 0);
-      ASSERT (b_seen == 0);
-      ASSERT (p_value == NULL);
-      ASSERT (q_value == NULL);
-      ASSERT (non_options_count == 0);
-      ASSERT (unrecognized == 0);
-      ASSERT (optind == 1);
-#else
-      /* Using getopt from glibc.  */
-      ASSERT (strcmp (argv[0], "program") == 0);
-      ASSERT (strcmp (argv[1], "-p") == 0);
-      ASSERT (strcmp (argv[2], "billy") == 0);
-      ASSERT (strcmp (argv[3], "-a") == 0);
-      ASSERT (strcmp (argv[4], "donald") == 0);
-      ASSERT (strcmp (argv[5], "duck") == 0);
-      ASSERT (strcmp (argv[6], "bar") == 0);
-      ASSERT (a_seen == 1);
-      ASSERT (b_seen == 0);
-      ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
-      ASSERT (q_value == NULL);
-      ASSERT (non_options_count == 0);
-      ASSERT (unrecognized == 0);
-      ASSERT (optind == 4);
-#endif
+                   &a_seen, &b_seen, &p_value, &q_value,
+                   &non_options_count, non_options, &unrecognized);
+      if (posixly)
+        {
+          ASSERT (strcmp (argv[0], "program") == 0);
+          ASSERT (strcmp (argv[1], "donald") == 0);
+          ASSERT (strcmp (argv[2], "-p") == 0);
+          ASSERT (strcmp (argv[3], "billy") == 0);
+          ASSERT (strcmp (argv[4], "duck") == 0);
+          ASSERT (strcmp (argv[5], "-a") == 0);
+          ASSERT (strcmp (argv[6], "bar") == 0);
+          ASSERT (argv[7] == NULL);
+          ASSERT (a_seen == 0);
+          ASSERT (b_seen == 0);
+          ASSERT (p_value == NULL);
+          ASSERT (q_value == NULL);
+          ASSERT (non_options_count == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 1);
+        }
+      else
+        {
+          ASSERT (strcmp (argv[0], "program") == 0);
+          ASSERT (strcmp (argv[1], "-p") == 0);
+          ASSERT (strcmp (argv[2], "billy") == 0);
+          ASSERT (strcmp (argv[3], "-a") == 0);
+          ASSERT (strcmp (argv[4], "donald") == 0);
+          ASSERT (strcmp (argv[5], "duck") == 0);
+          ASSERT (strcmp (argv[6], "bar") == 0);
+          ASSERT (argv[7] == NULL);
+          ASSERT (a_seen == 1);
+          ASSERT (b_seen == 0);
+          ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
+          ASSERT (q_value == NULL);
+          ASSERT (non_options_count == 0);
+          ASSERT (unrecognized == 0);
+          ASSERT (optind == 4);
+        }
     }
 }
diff --git a/gltests/test-getopt_long.h b/gltests/test-getopt_long.h
index d0d16fa..5b6acc6 100644
--- a/gltests/test-getopt_long.h
+++ b/gltests/test-getopt_long.h
@@ -42,48 +42,48 @@ static const struct option long_options_optional[] =
 
 static void
 getopt_long_loop (int argc, const char **argv,
-                 const char *options, const struct option *long_options,
-                 const char **p_value, const char **q_value,
-                 int *non_options_count, const char **non_options,
-                 int *unrecognized)
+                  const char *options, const struct option *long_options,
+                  const char **p_value, const char **q_value,
+                  int *non_options_count, const char **non_options,
+                  int *unrecognized)
 {
   int option_index;
   int c;
 
   opterr = 0;
   while ((c = getopt_long (argc, (char **) argv, options, long_options,
-                          &option_index))
-        != -1)
+                           &option_index))
+         != -1)
     {
       switch (c)
-       {
-       case 0:
-         /* An option with a non-NULL flag pointer was processed.  */
-         break;
-       case 'a':
-         a_seen++;
-         break;
-       case 'b':
-         b_seen = 1;
-         break;
-       case 'p':
-         *p_value = optarg;
-         break;
-       case 'q':
-         *q_value = optarg;
-         break;
-       case '\1':
-         /* Must only happen with option '-' at the beginning.  */
-         ASSERT (options[0] == '-');
-         non_options[(*non_options_count)++] = optarg;
-         break;
-       case '?':
-         *unrecognized = optopt;
-         break;
-       default:
-         *unrecognized = c;
-         break;
-       }
+        {
+        case 0:
+          /* An option with a non-NULL flag pointer was processed.  */
+          break;
+        case 'a':
+          a_seen++;
+          break;
+        case 'b':
+          b_seen = 1;
+          break;
+        case 'p':
+          *p_value = optarg;
+          break;
+        case 'q':
+          *q_value = optarg;
+          break;
+        case '\1':
+          /* Must only happen with option '-' at the beginning.  */
+          ASSERT (options[0] == '-');
+          non_options[(*non_options_count)++] = optarg;
+          break;
+        case '?':
+          *unrecognized = optopt;
+          break;
+        default:
+          *unrecognized = c;
+          break;
+        }
     }
 }
 
@@ -111,6 +111,7 @@ test_getopt_long (void)
 
     argv[argc++] = "program";
     argv[argc++] = "--x";
+    argv[argc] = NULL;
     optind = 1;
     opterr = 0;
     c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
@@ -125,6 +126,7 @@ test_getopt_long (void)
 
     argv[argc++] = "program";
     argv[argc++] = "--xt";
+    argv[argc] = NULL;
     optind = 1;
     opterr = 0;
     c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
@@ -139,6 +141,7 @@ test_getopt_long (void)
 
     argv[argc++] = "program";
     argv[argc++] = "--xtr";
+    argv[argc] = NULL;
     optind = 1;
     opterr = 0;
     c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
@@ -153,6 +156,7 @@ test_getopt_long (void)
 
     argv[argc++] = "program";
     argv[argc++] = "--xtra";
+    argv[argc] = NULL;
     optind = 1;
     opterr = 0;
     c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
@@ -166,6 +170,7 @@ test_getopt_long (void)
 
     argv[argc++] = "program";
     argv[argc++] = "--xtre";
+    argv[argc] = NULL;
     optind = 1;
     opterr = 0;
     c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
@@ -180,6 +185,7 @@ test_getopt_long (void)
 
     argv[argc++] = "program";
     argv[argc++] = "--xtrem";
+    argv[argc] = NULL;
     optind = 1;
     opterr = 0;
     c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
@@ -194,6 +200,7 @@ test_getopt_long (void)
 
     argv[argc++] = "program";
     argv[argc++] = "--xtreme";
+    argv[argc] = NULL;
     optind = 1;
     opterr = 0;
     c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
@@ -207,6 +214,7 @@ test_getopt_long (void)
 
     argv[argc++] = "program";
     argv[argc++] = "--xtremel";
+    argv[argc] = NULL;
     optind = 1;
     opterr = 0;
     c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
@@ -220,6 +228,7 @@ test_getopt_long (void)
 
     argv[argc++] = "program";
     argv[argc++] = "--xtremely";
+    argv[argc] = NULL;
     optind = 1;
     opterr = 0;
     c = do_getopt_long (argc, argv, "ab", long_options_required, 
&option_index);
@@ -243,10 +252,11 @@ test_getopt_long (void)
       argv[argc++] = "-a";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "ab", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -272,10 +282,11 @@ test_getopt_long (void)
       argv[argc++] = "-a";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "ab", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 1);
       ASSERT (p_value == NULL);
@@ -300,10 +311,11 @@ test_getopt_long (void)
       argv[argc++] = "-ba";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "ab", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 1);
       ASSERT (p_value == NULL);
@@ -329,10 +341,11 @@ test_getopt_long (void)
       argv[argc++] = "-a";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "ab", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 2);
       ASSERT (b_seen == 1);
       ASSERT (p_value == NULL);
@@ -358,10 +371,11 @@ test_getopt_long (void)
       argv[argc++] = "program";
       argv[argc++] = "-pfoo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "p:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -386,10 +400,11 @@ test_getopt_long (void)
       argv[argc++] = "-p";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "p:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -416,10 +431,11 @@ test_getopt_long (void)
       argv[argc++] = "baz";
       argv[argc++] = "-pfoo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "abp:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 1);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -445,10 +461,11 @@ test_getopt_long (void)
       argv[argc++] = "program";
       argv[argc++] = "-pfoo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "p::q::", long_options_optional,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -473,10 +490,11 @@ test_getopt_long (void)
       argv[argc++] = "-p";
       argv[argc++] = "foo";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "p::q::", long_options_optional,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -501,10 +519,11 @@ test_getopt_long (void)
       argv[argc++] = "-p";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "abp::q::", long_options_optional,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -533,10 +552,11 @@ test_getopt_long (void)
       argv[argc++] = "-x";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "abp:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
@@ -566,10 +586,11 @@ test_getopt_long (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "abp:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "-p") == 0);
       ASSERT (strcmp (argv[2], "billy") == 0);
@@ -577,6 +598,7 @@ test_getopt_long (void)
       ASSERT (strcmp (argv[4], "donald") == 0);
       ASSERT (strcmp (argv[5], "duck") == 0);
       ASSERT (strcmp (argv[6], "bar") == 0);
+      ASSERT (argv[7] == NULL);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
@@ -611,10 +633,11 @@ test_getopt_long (void)
       argv[argc++] = "-q";
       argv[argc++] = "johnny";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "abp:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "-p") == 0);
       ASSERT (strcmp (argv[2], "billy") == 0);
@@ -627,6 +650,7 @@ test_getopt_long (void)
       ASSERT (strcmp (argv[9], "-q") == 0);
       ASSERT (strcmp (argv[10], "johnny") == 0);
       ASSERT (strcmp (argv[11], "bar") == 0);
+      ASSERT (argv[12] == NULL);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
@@ -656,10 +680,11 @@ test_getopt_long (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "-abp:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "donald") == 0);
       ASSERT (strcmp (argv[2], "-p") == 0);
@@ -667,6 +692,7 @@ test_getopt_long (void)
       ASSERT (strcmp (argv[4], "duck") == 0);
       ASSERT (strcmp (argv[5], "-a") == 0);
       ASSERT (strcmp (argv[6], "bar") == 0);
+      ASSERT (argv[7] == NULL);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
@@ -704,10 +730,11 @@ test_getopt_long (void)
       argv[argc++] = "-q";
       argv[argc++] = "johnny";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "-abp:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "donald") == 0);
       ASSERT (strcmp (argv[2], "-p") == 0);
@@ -720,32 +747,33 @@ test_getopt_long (void)
       ASSERT (strcmp (argv[9], "-q") == 0);
       ASSERT (strcmp (argv[10], "johnny") == 0);
       ASSERT (strcmp (argv[11], "bar") == 0);
+      ASSERT (argv[12] == NULL);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
       ASSERT (q_value == NULL);
       if (non_options_count == 2)
       {
-       /* glibc behaviour.  */
-       ASSERT (non_options_count == 2);
-       ASSERT (strcmp (non_options[0], "donald") == 0);
-       ASSERT (strcmp (non_options[1], "duck") == 0);
-       ASSERT (unrecognized == 0);
-       ASSERT (optind == 7);
+        /* glibc behaviour.  */
+        ASSERT (non_options_count == 2);
+        ASSERT (strcmp (non_options[0], "donald") == 0);
+        ASSERT (strcmp (non_options[1], "duck") == 0);
+        ASSERT (unrecognized == 0);
+        ASSERT (optind == 7);
       }
       else
       {
-       /* Another valid behaviour.  */
-       ASSERT (non_options_count == 7);
-       ASSERT (strcmp (non_options[0], "donald") == 0);
-       ASSERT (strcmp (non_options[1], "duck") == 0);
-       ASSERT (strcmp (non_options[2], "-b") == 0);
-       ASSERT (strcmp (non_options[3], "foo") == 0);
-       ASSERT (strcmp (non_options[4], "-q") == 0);
-       ASSERT (strcmp (non_options[5], "johnny") == 0);
-       ASSERT (strcmp (non_options[6], "bar") == 0);
-       ASSERT (unrecognized == 0);
-       ASSERT (optind == 12);
+        /* Another valid behaviour.  */
+        ASSERT (non_options_count == 7);
+        ASSERT (strcmp (non_options[0], "donald") == 0);
+        ASSERT (strcmp (non_options[1], "duck") == 0);
+        ASSERT (strcmp (non_options[2], "-b") == 0);
+        ASSERT (strcmp (non_options[3], "foo") == 0);
+        ASSERT (strcmp (non_options[4], "-q") == 0);
+        ASSERT (strcmp (non_options[5], "johnny") == 0);
+        ASSERT (strcmp (non_options[6], "bar") == 0);
+        ASSERT (unrecognized == 0);
+        ASSERT (optind == 12);
       }
     }
 
@@ -769,10 +797,11 @@ test_getopt_long (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "abp:q:-", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "-p") == 0);
       ASSERT (strcmp (argv[2], "billy") == 0);
@@ -780,6 +809,7 @@ test_getopt_long (void)
       ASSERT (strcmp (argv[4], "donald") == 0);
       ASSERT (strcmp (argv[5], "duck") == 0);
       ASSERT (strcmp (argv[6], "bar") == 0);
+      ASSERT (argv[7] == NULL);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
@@ -810,10 +840,11 @@ test_getopt_long (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "+abp:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "donald") == 0);
       ASSERT (strcmp (argv[2], "-p") == 0);
@@ -821,6 +852,7 @@ test_getopt_long (void)
       ASSERT (strcmp (argv[4], "duck") == 0);
       ASSERT (strcmp (argv[5], "-a") == 0);
       ASSERT (strcmp (argv[6], "bar") == 0);
+      ASSERT (argv[7] == NULL);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -843,10 +875,11 @@ test_getopt_long (void)
 
       argv[argc++] = "program";
       argv[argc++] = "-+";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "+abp:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -881,10 +914,11 @@ test_getopt_long (void)
       argv[argc++] = "-q";
       argv[argc++] = "johnny";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "+abp:q:", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "donald") == 0);
       ASSERT (strcmp (argv[2], "-p") == 0);
@@ -897,6 +931,7 @@ test_getopt_long (void)
       ASSERT (strcmp (argv[9], "-q") == 0);
       ASSERT (strcmp (argv[10], "johnny") == 0);
       ASSERT (strcmp (argv[11], "bar") == 0);
+      ASSERT (argv[12] == NULL);
       ASSERT (a_seen == 0);
       ASSERT (b_seen == 0);
       ASSERT (p_value == NULL);
@@ -926,10 +961,11 @@ test_getopt_long (void)
       argv[argc++] = "duck";
       argv[argc++] = "-a";
       argv[argc++] = "bar";
+      argv[argc] = NULL;
       optind = start;
       getopt_long_loop (argc, argv, "abp:q:+", long_options_required,
-                       &p_value, &q_value,
-                       &non_options_count, non_options, &unrecognized);
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
       ASSERT (strcmp (argv[0], "program") == 0);
       ASSERT (strcmp (argv[1], "-p") == 0);
       ASSERT (strcmp (argv[2], "billy") == 0);
@@ -937,6 +973,7 @@ test_getopt_long (void)
       ASSERT (strcmp (argv[4], "donald") == 0);
       ASSERT (strcmp (argv[5], "duck") == 0);
       ASSERT (strcmp (argv[6], "bar") == 0);
+      ASSERT (argv[7] == NULL);
       ASSERT (a_seen == 1);
       ASSERT (b_seen == 0);
       ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
@@ -954,16 +991,67 @@ test_getopt_long (void)
 static void
 test_getopt_long_posix (void)
 {
-  int c = 3;
-  const char *v[4] = {"test", "-r", "foo", NULL};
-  struct option l[] = {{NULL, 0, NULL, 0}};
   int start;
-  int result;
+
+  /* Check that POSIXLY_CORRECT doesn't change optional arguments.  */
+  for (start = OPTIND_MIN; start <= 1; start++)
+    {
+      const char *p_value = NULL;
+      const char *q_value = NULL;
+      int non_options_count = 0;
+      const char *non_options[10];
+      int unrecognized = 0;
+      int argc = 0;
+      const char *argv[10];
+      a_seen = 0;
+      b_seen = 0;
+
+      argv[argc++] = "program";
+      argv[argc++] = "-p";
+      argv[argc++] = "billy";
+      argv[argc] = NULL;
+      optind = start;
+      getopt_long_loop (argc, argv, "p::", long_options_required,
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
+      ASSERT (a_seen == 0);
+      ASSERT (b_seen == 0);
+      ASSERT (p_value == NULL);
+      ASSERT (q_value == NULL);
+      ASSERT (non_options_count == 0);
+      ASSERT (unrecognized == 0);
+      ASSERT (optind == 2);
+    }
+
+  /* Check that leading - still sees options after non-options.  */
   for (start = OPTIND_MIN; start <= 1; start++)
     {
+      const char *p_value = NULL;
+      const char *q_value = NULL;
+      int non_options_count = 0;
+      const char *non_options[10];
+      int unrecognized = 0;
+      int argc = 0;
+      const char *argv[10];
+      a_seen = 0;
+      b_seen = 0;
+
+      argv[argc++] = "program";
+      argv[argc++] = "-a";
+      argv[argc++] = "billy";
+      argv[argc++] = "-b";
+      argv[argc] = NULL;
       optind = start;
-      result = do_getopt_long (c, v, "r::", l, NULL);
+      getopt_long_loop (argc, argv, "-ab", long_options_required,
+                        &p_value, &q_value,
+                        &non_options_count, non_options, &unrecognized);
+      ASSERT (a_seen == 1);
+      ASSERT (b_seen == 1);
+      ASSERT (p_value == NULL);
+      ASSERT (q_value == NULL);
+      ASSERT (non_options_count == 1);
+      ASSERT (strcmp (non_options[0], "billy") == 0);
+      ASSERT (unrecognized == 0);
+      ASSERT (optind == 4);
     }
-  ASSERT (result == 'r');
-  ASSERT (optarg == NULL);
 }
diff --git a/gltests/test-setenv.c b/gltests/test-setenv.c
index 61be838..eb1fe33 100644
--- a/gltests/test-setenv.c
+++ b/gltests/test-setenv.c
@@ -52,9 +52,13 @@ main (void)
   errno = 0;
   ASSERT (setenv ("a=b", "", 0) == -1);
   ASSERT (errno == EINVAL);
+#if 0
+  /* glibc and gnulib's implementation guarantee this, but POSIX no
+     longer requires it: http://austingroupbugs.net/view.php?id=185  */
   errno = 0;
   ASSERT (setenv (NULL, "", 0) == -1);
   ASSERT (errno == EINVAL);
+#endif
 
   return 0;
 }
diff --git a/lib/gltests/test-stdbool.c b/gltests/test-stdbool.c
similarity index 100%
copy from lib/gltests/test-stdbool.c
copy to gltests/test-stdbool.c
diff --git a/gltests/test-strerror.c b/gltests/test-strerror.c
index 27eb969..ba23edc 100644
--- a/gltests/test-strerror.c
+++ b/gltests/test-strerror.c
@@ -25,15 +25,15 @@
 #include <string.h>
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 int
diff --git a/gltests/test-unsetenv.c b/gltests/test-unsetenv.c
index 11af82c..2815cf3 100644
--- a/gltests/test-unsetenv.c
+++ b/gltests/test-unsetenv.c
@@ -57,9 +57,13 @@ main (void)
   errno = 0;
   ASSERT (unsetenv ("a=b") == -1);
   ASSERT (errno == EINVAL);
+#if 0
+  /* glibc and gnulib's implementation guarantee this, but POSIX no
+     longer requires it: http://austingroupbugs.net/view.php?id=185  */
   errno = 0;
   ASSERT (unsetenv (NULL) == -1);
   ASSERT (errno == EINVAL);
+#endif
 
   return 0;
 }
diff --git a/gltests/test-update-copyright.sh b/gltests/test-update-copyright.sh
index 859c75d..d555239 100755
--- a/gltests/test-update-copyright.sh
+++ b/gltests/test-update-copyright.sh
@@ -223,7 +223,7 @@ rm $TMP*
 ## -------------- ##
 
 TMP=$TMP_BASE-current-year
-YEAR=`/usr/bin/perl -e 'print [localtime]->[5] + 1900'`;
+YEAR=`date +%Y`
 cat > $TMP <<EOF
 '\" Copyright (C) 2006
 '\" Free Software Foundation,
diff --git a/gltests/test-version-etc.sh b/gltests/test-version-etc.sh
index 528fadd..071764a 100755
--- a/gltests/test-version-etc.sh
+++ b/gltests/test-version-etc.sh
@@ -33,7 +33,8 @@ EOT
 
 ./test-version-etc${EXEEXT} --version |
  sed '1s/test-version-etc (.*) .*/test-version-etc (PROJECT) VERSION/
-      2s/Copyright (C) [0-9]\{4,4\}/COPYRIGHT/' |
+      /^Packaged by/d
+      2,3 s/Copyright (C) [0-9]\{4,4\}/COPYRIGHT/' |
  tr -d '\015' |
  diff -c $TMP - || ERR=1
 
diff --git a/gltests/unsetenv.c b/gltests/unsetenv.c
index 21fb199..89ce64b 100644
--- a/gltests/unsetenv.c
+++ b/gltests/unsetenv.c
@@ -16,6 +16,10 @@
 
 #include <config.h>
 
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   optimizes away the name == NULL test below.  */
+#define _GL_ARG_NONNULL(params)
+
 /* Specification.  */
 #include <stdlib.h>
 
@@ -28,15 +32,15 @@
 #include <unistd.h>
 
 #if !_LIBC
-# define __environ     environ
+# define __environ      environ
 #endif
 
 #if _LIBC
 /* This lock protects against simultaneous modifications of `environ'.  */
 # include <bits/libc-lock.h>
 __libc_lock_define_initialized (static, envlock)
-# define LOCK  __libc_lock_lock (envlock)
-# define UNLOCK        __libc_lock_unlock (envlock)
+# define LOCK   __libc_lock_lock (envlock)
+# define UNLOCK __libc_lock_unlock (envlock)
 #else
 # define LOCK
 # define UNLOCK
@@ -69,13 +73,13 @@ unsetenv (const char *name)
   while (*ep != NULL)
     if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
       {
-       /* Found it.  Remove this pointer by moving later ones back.  */
-       char **dp = ep;
+        /* Found it.  Remove this pointer by moving later ones back.  */
+        char **dp = ep;
 
-       do
-         dp[0] = dp[1];
-       while (*dp++);
-       /* Continue the loop in case NAME appears again.  */
+        do
+          dp[0] = dp[1];
+        while (*dp++);
+        /* Continue the loop in case NAME appears again.  */
       }
     else
       ++ep;
diff --git a/gltests/verify.h b/gltests/verify.h
index fac53f6..3fbb639 100644
--- a/gltests/verify.h
+++ b/gltests/verify.h
@@ -110,8 +110,8 @@
 
        #if 4 <= __GNUC__
        # define verify(R) \
-          extern int (* verify_function__ (void)) \
-                     [__builtin_constant_p (R) && (R) ? 1 : -1]
+           extern int (* verify_function__ (void)) \
+                      [__builtin_constant_p (R) && (R) ? 1 : -1]
        #endif
 
    * In C++, any struct definition inside sizeof is invalid.
diff --git a/gltests/wchar.in.h b/gltests/wchar.in.h
index cc5baad..df171d6 100644
--- a/gltests/wchar.in.h
+++ b/gltests/wchar.in.h
@@ -74,6 +74,8 @@
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -197,7 +199,8 @@ extern size_t mbrlen (const char *s, size_t n, mbstate_t 
*ps);
 #  define mbsrtowcs rpl_mbsrtowcs
 # endif
 # if address@hidden@ || @REPLACE_MBSRTOWCS@
-extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, 
mbstate_t *ps);
+extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, 
mbstate_t *ps)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbsrtowcs
@@ -215,7 +218,8 @@ extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, 
size_t len, mbstate_t
 #  define mbsnrtowcs rpl_mbsnrtowcs
 # endif
 # if address@hidden@ || @REPLACE_MBSNRTOWCS@
-extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, 
size_t len, mbstate_t *ps);
+extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, 
size_t len, mbstate_t *ps)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbsnrtowcs
@@ -251,7 +255,8 @@ extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
 #  define wcsrtombs rpl_wcsrtombs
 # endif
 # if address@hidden@ || @REPLACE_WCSRTOMBS@
-extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, 
mbstate_t *ps);
+extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, 
mbstate_t *ps)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsrtombs
@@ -269,7 +274,8 @@ extern size_t wcsrtombs (char *dest, const wchar_t **srcp, 
size_t len, mbstate_t
 #  define wcsnrtombs rpl_wcsnrtombs
 # endif
 # if address@hidden@ || @REPLACE_WCSNRTOMBS@
-extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, 
size_t len, mbstate_t *ps);
+extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, 
size_t len, mbstate_t *ps)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsnrtombs
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index 558dab1..b0e4917 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -38,6 +38,25 @@ libgnu_la_DEPENDENCIES = $(lgl_LTLIBOBJS)
 EXTRA_libgnu_la_SOURCES =
 libgnu_la_LDFLAGS = $(AM_LDFLAGS)
 
+## begin gnulib module arg-nonnull
+
+BUILT_SOURCES += arg-nonnull.h
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
+arg-nonnull.h: $(top_srcdir)/build-aux/arg-nonnull.h
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/build-aux/arg-nonnull.h \
+         > address@hidden && \
+       mv address@hidden $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/arg-nonnull.h
+
+## end   gnulib module arg-nonnull
+
 ## begin gnulib module c-ctype
 
 libgnu_la_SOURCES += c-ctype.h c-ctype.c
@@ -75,7 +94,7 @@ BUILT_SOURCES += $(ICONV_H)
 
 # We need the following in order to create <iconv.h> when the system
 # doesn't have one that works with the given compiler.
-iconv.h: iconv.in.h
+iconv.h: iconv.in.h $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -85,6 +104,7 @@ iconv.h: iconv.in.h
              -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
              -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
              -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/iconv.in.h; \
        } > address@hidden && \
        mv address@hidden $@
@@ -128,7 +148,18 @@ AM_CFLAGS += $(CFLAG_VISIBILITY)
 
 ## begin gnulib module link-warning
 
-LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
+BUILT_SOURCES += link-warning.h
+# The link-warning.h that gets inserted into generated .h files is the same as
+# build-aux/link-warning.h, except that it has the copyright header cut off.
+link-warning.h: $(top_srcdir)/build-aux/link-warning.h
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       sed -n -e '/GL_LINK_WARNING/,$$p' \
+         < $(top_srcdir)/build-aux/link-warning.h \
+         > address@hidden && \
+       mv address@hidden $@
+MOSTLYCLEANFILES += link-warning.h link-warning.h-t
+
+LINK_WARNING_H=link-warning.h
 
 EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h
 
@@ -232,7 +263,7 @@ BUILT_SOURCES += string.h
 
 # We need the following in order to create <string.h> when the system
 # doesn't have one that works with the given compiler.
-string.h: string.in.h
+string.h: string.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -299,6 +330,7 @@ string.h: string.in.h
              -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
              -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/string.in.h; \
        } > address@hidden && \
        mv address@hidden $@
@@ -323,7 +355,7 @@ BUILT_SOURCES += $(WCHAR_H)
 
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
-wchar.h: wchar.in.h
+wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -366,6 +398,7 @@ wchar.h: wchar.in.h
              -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
            < $(srcdir)/wchar.in.h; \
        } > address@hidden && \
        mv address@hidden $@
diff --git a/lib/gl/c-strcasecmp.c b/lib/gl/c-strcasecmp.c
index 8c006ca..ed98358 100644
--- a/lib/gl/c-strcasecmp.c
+++ b/lib/gl/c-strcasecmp.c
@@ -40,7 +40,7 @@ c_strcasecmp (const char *s1, const char *s2)
       c2 = c_tolower (*p2);
 
       if (c1 == '\0')
-       break;
+        break;
 
       ++p1;
       ++p2;
diff --git a/lib/gl/c-strncasecmp.c b/lib/gl/c-strncasecmp.c
index 03f10f6..2d23c8e 100644
--- a/lib/gl/c-strncasecmp.c
+++ b/lib/gl/c-strncasecmp.c
@@ -40,7 +40,7 @@ c_strncasecmp (const char *s1, const char *s2, size_t n)
       c2 = c_tolower (*p2);
 
       if (--n == 0 || c1 == '\0')
-       break;
+        break;
 
       ++p1;
       ++p2;
diff --git a/lib/gl/gettext.h b/lib/gl/gettext.h
index 56d4a21..36eaf2b 100644
--- a/lib/gl/gettext.h
+++ b/lib/gl/gettext.h
@@ -101,74 +101,4 @@
    initializer for static 'char[]' or 'const char[]' variables.  */
 #define gettext_noop(String) String
 
-/* The separator between msgctxt and msgid in a .mo file.  */
-#define GETTEXT_CONTEXT_GLUE "\004"
-
-/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
-   MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
-   short and rarely need to change.
-   The letter 'p' stands for 'particular' or 'special'.  */
-#ifdef DEFAULT_TEXT_DOMAIN
-# define pgettext(Msgctxt, Msgid) \
-   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, LC_MESSAGES)
-#else
-# define pgettext(Msgctxt, Msgid) \
-   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
-#endif
-#define dpgettext(Domainname, Msgctxt, Msgid) \
-  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
-#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
-  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
Category)
-#ifdef DEFAULT_TEXT_DOMAIN
-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
-   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, MsgidPlural, N, LC_MESSAGES)
-#else
-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
-   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
-#endif
-#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
-  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
-#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
-  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, Category)
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static const char *
-pgettext_aux (const char *domain,
-             const char *msg_ctxt_id, const char *msgid,
-             int category)
-{
-  const char *translation = dcgettext (domain, msg_ctxt_id, category);
-  if (translation == msg_ctxt_id)
-    return msgid;
-  else
-    return translation;
-}
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static const char *
-npgettext_aux (const char *domain,
-              const char *msg_ctxt_id, const char *msgid,
-              const char *msgid_plural, unsigned long int n,
-              int category)
-{
-  const char *translation =
-    dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
-  if (translation == msg_ctxt_id || translation == msgid_plural)
-    return (n == 1 ? msgid : msgid_plural);
-  else
-    return translation;
-}
-
 #endif /* _LIBGETTEXT_H */
diff --git a/lib/gl/iconv.in.h b/lib/gl/iconv.in.h
index db2f139..e522e19 100644
--- a/lib/gl/iconv.in.h
+++ b/lib/gl/iconv.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <iconv.h>.
 
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -28,6 +28,8 @@
 #ifndef _GL_ICONV_H
 #define _GL_ICONV_H
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -37,7 +39,8 @@ extern "C" {
 /* An iconv_open wrapper that supports the IANA standardized encoding names
    ("ISO-8859-1" etc.) as far as possible.  */
 # define iconv_open rpl_iconv_open
-extern iconv_t iconv_open (const char *tocode, const char *fromcode);
+extern iconv_t iconv_open (const char *tocode, const char *fromcode)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @REPLACE_ICONV_UTF@
@@ -56,8 +59,8 @@ extern iconv_t iconv_open (const char *tocode, const char 
*fromcode);
 #if @REPLACE_ICONV@
 # define iconv rpl_iconv
 extern size_t iconv (iconv_t cd,
-                    @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
-                    char **outbuf, size_t *outbytesleft);
+                     @ICONV_CONST@ char **inbuf, size_t *inbytesleft,
+                     char **outbuf, size_t *outbytesleft);
 # define iconv_close rpl_iconv_close
 extern int iconv_close (iconv_t cd);
 #endif
diff --git a/lib/gl/iconv_open.c b/lib/gl/iconv_open.c
index 01efaf3..0073057 100644
--- a/lib/gl/iconv_open.c
+++ b/lib/gl/iconv_open.c
@@ -67,33 +67,33 @@ rpl_iconv_open (const char *tocode, const char *fromcode)
       && fromcode[3] == '-')
     {
       if (c_toupper (tocode[0]) == 'U'
-         && c_toupper (tocode[1]) == 'T'
-         && c_toupper (tocode[2]) == 'F'
-         && tocode[3] == '-')
-       {
-         if (strcmp (fromcode + 4, "8") == 0)
-           {
-             if (c_strcasecmp (tocode + 4, "16BE") == 0)
-               return _ICONV_UTF8_UTF16BE;
-             if (c_strcasecmp (tocode + 4, "16LE") == 0)
-               return _ICONV_UTF8_UTF16LE;
-             if (c_strcasecmp (tocode + 4, "32BE") == 0)
-               return _ICONV_UTF8_UTF32BE;
-             if (c_strcasecmp (tocode + 4, "32LE") == 0)
-               return _ICONV_UTF8_UTF32LE;
-           }
-         else if (strcmp (tocode + 4, "8") == 0)
-           {
-             if (c_strcasecmp (fromcode + 4, "16BE") == 0)
-               return _ICONV_UTF16BE_UTF8;
-             if (c_strcasecmp (fromcode + 4, "16LE") == 0)
-               return _ICONV_UTF16LE_UTF8;
-             if (c_strcasecmp (fromcode + 4, "32BE") == 0)
-               return _ICONV_UTF32BE_UTF8;
-             if (c_strcasecmp (fromcode + 4, "32LE") == 0)
-               return _ICONV_UTF32LE_UTF8;
-           }
-       }
+          && c_toupper (tocode[1]) == 'T'
+          && c_toupper (tocode[2]) == 'F'
+          && tocode[3] == '-')
+        {
+          if (strcmp (fromcode + 4, "8") == 0)
+            {
+              if (c_strcasecmp (tocode + 4, "16BE") == 0)
+                return _ICONV_UTF8_UTF16BE;
+              if (c_strcasecmp (tocode + 4, "16LE") == 0)
+                return _ICONV_UTF8_UTF16LE;
+              if (c_strcasecmp (tocode + 4, "32BE") == 0)
+                return _ICONV_UTF8_UTF32BE;
+              if (c_strcasecmp (tocode + 4, "32LE") == 0)
+                return _ICONV_UTF8_UTF32LE;
+            }
+          else if (strcmp (tocode + 4, "8") == 0)
+            {
+              if (c_strcasecmp (fromcode + 4, "16BE") == 0)
+                return _ICONV_UTF16BE_UTF8;
+              if (c_strcasecmp (fromcode + 4, "16LE") == 0)
+                return _ICONV_UTF16LE_UTF8;
+              if (c_strcasecmp (fromcode + 4, "32BE") == 0)
+                return _ICONV_UTF32BE_UTF8;
+              if (c_strcasecmp (fromcode + 4, "32LE") == 0)
+                return _ICONV_UTF32LE_UTF8;
+            }
+        }
     }
 #endif
 
@@ -116,20 +116,20 @@ rpl_iconv_open (const char *tocode, const char *fromcode)
 
   /* Convert the encodings to upper case, because
        1. in the arguments of iconv_open() on AIX, HP-UX, and OSF/1 the case
-         matters,
+          matters,
        2. it makes searching in the table faster.  */
   {
     const char *p = fromcode;
     char *q = fromcode_upper;
     while ((*q = c_toupper (*p)) != '\0')
       {
-       p++;
-       q++;
-       if (q == &fromcode_upper[SIZEOF (fromcode_upper)])
-         {
-           errno = EINVAL;
-           return (iconv_t)(-1);
-         }
+        p++;
+        q++;
+        if (q == &fromcode_upper[SIZEOF (fromcode_upper)])
+          {
+            errno = EINVAL;
+            return (iconv_t)(-1);
+          }
       }
     fromcode_upper_end = q;
   }
@@ -139,13 +139,13 @@ rpl_iconv_open (const char *tocode, const char *fromcode)
     char *q = tocode_upper;
     while ((*q = c_toupper (*p)) != '\0')
       {
-       p++;
-       q++;
-       if (q == &tocode_upper[SIZEOF (tocode_upper)])
-         {
-           errno = EINVAL;
-           return (iconv_t)(-1);
-         }
+        p++;
+        q++;
+        if (q == &tocode_upper[SIZEOF (tocode_upper)])
+          {
+            errno = EINVAL;
+            return (iconv_t)(-1);
+          }
       }
     tocode_upper_end = q;
   }
diff --git a/lib/gl/m4/extensions.m4 b/lib/gl/m4/extensions.m4
index ba6d5e1..99fba9f 100644
--- a/lib/gl/m4/extensions.m4
+++ b/lib/gl/m4/extensions.m4
@@ -74,8 +74,8 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
     [ac_cv_safe_to_define___extensions__],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[
-#        define __EXTENSIONS__ 1
-         ]AC_INCLUDES_DEFAULT])],
+#         define __EXTENSIONS__ 1
+          ]AC_INCLUDES_DEFAULT])],
        [ac_cv_safe_to_define___extensions__=yes],
        [ac_cv_safe_to_define___extensions__=no])])
   test $ac_cv_safe_to_define___extensions__ = yes &&
diff --git a/lib/gl/m4/gnulib-common.m4 b/lib/gl/m4/gnulib-common.m4
index c8fda20..75da53d 100644
--- a/lib/gl/m4/gnulib-common.m4
+++ b/lib/gl/m4/gnulib-common.m4
@@ -70,13 +70,13 @@ AC_DEFUN([AC_C_RESTRICT],
    for ac_kw in __restrict __restrict__ _Restrict restrict; do
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
       [[typedef int * int_ptr;
-       int foo (int_ptr $ac_kw ip) {
-       return ip[0];
+        int foo (int_ptr $ac_kw ip) {
+        return ip[0];
        }]],
       [[int s[1];
-       int * $ac_kw t = s;
-       t[0] = 0;
-       return foo(t)]])],
+        int * $ac_kw t = s;
+        t[0] = 0;
+        return foo(t)]])],
       [ac_cv_c_restrict=$ac_kw])
      test "$ac_cv_c_restrict" != no && break
    done
diff --git a/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index 47bd7cc..7d3af1d 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/gl/m4/gnulib-comp.m4
@@ -83,7 +83,7 @@ AC_DEFUN([lgl_INIT],
     if test -n "$lgl_LIBOBJS"; then
       # Remove the extension.
       sed_drop_objext='s/\.o$//;s/\.obj$//'
-      for i in `for i in $lgl_LIBOBJS; do echo "$i"; done | sed 
"$sed_drop_objext" | sort | uniq`; do
+      for i in `for i in $lgl_LIBOBJS; do echo "$i"; done | sed -e 
"$sed_drop_objext" | sort | uniq`; do
         lgl_libobjs="$lgl_libobjs $i.$ac_objext"
         lgl_ltlibobjs="$lgl_ltlibobjs $i.lo"
       done
@@ -126,7 +126,7 @@ AC_DEFUN([lgl_INIT],
     if test -n "$lgltests_LIBOBJS"; then
       # Remove the extension.
       sed_drop_objext='s/\.o$//;s/\.obj$//'
-      for i in `for i in $lgltests_LIBOBJS; do echo "$i"; done | sed 
"$sed_drop_objext" | sort | uniq`; do
+      for i in `for i in $lgltests_LIBOBJS; do echo "$i"; done | sed -e 
"$sed_drop_objext" | sort | uniq`; do
         lgltests_libobjs="$lgltests_libobjs $i.$ac_objext"
         lgltests_ltlibobjs="$lgltests_ltlibobjs $i.lo"
       done
@@ -195,6 +195,7 @@ AC_DEFUN([lgltests_LIBSOURCES], [
 # This macro records the list of files which have been installed by
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([lgl_FILE_LIST], [
+  build-aux/arg-nonnull.h
   build-aux/config.rpath
   build-aux/link-warning.h
   lib/c-ctype.c
diff --git a/lib/gl/m4/iconv_h.m4 b/lib/gl/m4/iconv_h.m4
index bc05b05..c56a489 100644
--- a/lib/gl/m4/iconv_h.m4
+++ b/lib/gl/m4/iconv_h.m4
@@ -1,5 +1,5 @@
-# iconv_h.m4 serial 4
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# iconv_h.m4 serial 5
+dnl Copyright (C) 2007-2009 Free Software Foundation, 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.
@@ -7,6 +7,9 @@ dnl with or without modifications, as long as this notice is 
preserved.
 AC_DEFUN([gl_ICONV_H],
 [
   AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+
+  dnl Execute this unconditionally, because ICONV_H may be set by other
+  dnl modules, after this code is executed.
   gl_CHECK_NEXT_HEADERS([iconv.h])
 ])
 
diff --git a/lib/gl/m4/iconv_open.m4 b/lib/gl/m4/iconv_open.m4
index 8eeef9f..6bf78bc 100644
--- a/lib/gl/m4/iconv_open.m4
+++ b/lib/gl/m4/iconv_open.m4
@@ -90,8 +90,8 @@ int main ()
     outptr = buf;
     outbytesleft = sizeof (buf);
     res = iconv (cd,
-                (ICONV_CONST char **) &inptr, &inbytesleft,
-                &outptr, &outbytesleft);
+                 (ICONV_CONST char **) &inptr, &inbytesleft,
+                 &outptr, &outbytesleft);
     ASSERT (res == 0 && inbytesleft == 0);
     ASSERT (outptr == buf + (sizeof (expected) - 1));
     ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
@@ -117,8 +117,8 @@ int main ()
     outptr = buf;
     outbytesleft = sizeof (buf);
     res = iconv (cd,
-                (ICONV_CONST char **) &inptr, &inbytesleft,
-                &outptr, &outbytesleft);
+                 (ICONV_CONST char **) &inptr, &inbytesleft,
+                 &outptr, &outbytesleft);
     ASSERT (res == 0 && inbytesleft == 0);
     ASSERT (outptr == buf + (sizeof (expected) - 1));
     ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
@@ -144,8 +144,8 @@ int main ()
     outptr = buf;
     outbytesleft = sizeof (buf);
     res = iconv (cd,
-                (ICONV_CONST char **) &inptr, &inbytesleft,
-                &outptr, &outbytesleft);
+                 (ICONV_CONST char **) &inptr, &inbytesleft,
+                 &outptr, &outbytesleft);
     ASSERT (res == 0 && inbytesleft == 0);
     ASSERT (outptr == buf + (sizeof (expected) - 1));
     ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
@@ -171,8 +171,8 @@ int main ()
     outptr = buf;
     outbytesleft = sizeof (buf);
     res = iconv (cd,
-                (ICONV_CONST char **) &inptr, &inbytesleft,
-                &outptr, &outbytesleft);
+                 (ICONV_CONST char **) &inptr, &inbytesleft,
+                 &outptr, &outbytesleft);
     ASSERT (res == 0 && inbytesleft == 0);
     ASSERT (outptr == buf + (sizeof (expected) - 1));
     ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
@@ -199,8 +199,8 @@ int main ()
     outptr = buf;
     outbytesleft = sizeof (buf);
     res = iconv (cd,
-                (ICONV_CONST char **) &inptr, &inbytesleft,
-                &outptr, &outbytesleft);
+                 (ICONV_CONST char **) &inptr, &inbytesleft,
+                 &outptr, &outbytesleft);
     ASSERT (res == 0 && inbytesleft == 0);
     ASSERT (outptr == buf + (sizeof (expected) - 1));
     ASSERT (memcmp (buf, expected, sizeof (expected) - 1) == 0);
diff --git a/lib/gl/m4/include_next.m4 b/lib/gl/m4/include_next.m4
index 5e22ded..2e6273f 100644
--- a/lib/gl/m4/include_next.m4
+++ b/lib/gl/m4/include_next.m4
@@ -109,11 +109,11 @@ EOF
 # be
 # '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
 # That way, a header file with the following line:
-#      address@hidden@ @NEXT_FOO_H@
+#       address@hidden@ @NEXT_FOO_H@
 # or
-#      address@hidden@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
+#       address@hidden@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
 # behaves (after sed substitution) as if it contained
-#      #include_next <foo.h>
+#       #include_next <foo.h>
 # even if the compiler does not support include_next.
 # The three "///" are to pacify Sun C 5.8, which otherwise would say
 # "warning: #include of /usr/include/... may be non-portable".
@@ -129,46 +129,46 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
 
   m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
-                   [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
+                    [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
      if test $gl_cv_have_include_next = yes; then
        AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
      else
        AC_CACHE_CHECK(
-        [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
-        m4_defn([gl_next_header]),
-        [AS_VAR_PUSHDEF([gl_header_exists],
-                        [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
-         if test AS_VAR_GET(gl_header_exists) = yes; then
-           AC_LANG_CONFTEST(
-             [AC_LANG_SOURCE(
-                [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
-              )])
-           dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
-           dnl that contain only a #include of other header files and no
-           dnl non-comment tokens of their own. This leads to a failure to
-           dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
-           dnl and others. The workaround is to force preservation of comments
-           dnl through option -C. This ensures all necessary #line directives
-           dnl are present. GCC supports option -C as well.
-           case "$host_os" in
-             aix*) gl_absname_cpp="$ac_cpp -C" ;;
-             *)    gl_absname_cpp="$ac_cpp" ;;
-           esac
-           dnl eval is necessary to expand gl_absname_cpp.
-           dnl Ultrix and Pyramid sh refuse to redirect output of eval,
-           dnl so use subshell.
-           AS_VAR_SET([gl_next_header],
-             ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 
2>&AS_MESSAGE_LOG_FD |
-              sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
-                s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
-                s#^/[^/]#//&#
-                p
-                q
-              }'`'"'])
-         else
-           AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
-         fi
-         AS_VAR_POPDEF([gl_header_exists])])
+         [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+         m4_defn([gl_next_header]),
+         [AS_VAR_PUSHDEF([gl_header_exists],
+                         [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+          if test AS_VAR_GET(gl_header_exists) = yes; then
+            AC_LANG_CONFTEST(
+              [AC_LANG_SOURCE(
+                 [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
+               )])
+            dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
+            dnl that contain only a #include of other header files and no
+            dnl non-comment tokens of their own. This leads to a failure to
+            dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
+            dnl and others. The workaround is to force preservation of comments
+            dnl through option -C. This ensures all necessary #line directives
+            dnl are present. GCC supports option -C as well.
+            case "$host_os" in
+              aix*) gl_absname_cpp="$ac_cpp -C" ;;
+              *)    gl_absname_cpp="$ac_cpp" ;;
+            esac
+            dnl eval is necessary to expand gl_absname_cpp.
+            dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+            dnl so use subshell.
+            AS_VAR_SET([gl_next_header],
+              ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 
2>&AS_MESSAGE_LOG_FD |
+               sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+                 s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
+                 s#^/[^/]#//&#
+                 p
+                 q
+               }'`'"'])
+          else
+            AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+          fi
+          AS_VAR_POPDEF([gl_header_exists])])
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
diff --git a/lib/gl/m4/ld-version-script.m4 b/lib/gl/m4/ld-version-script.m4
index a97888f..43b725b 100644
--- a/lib/gl/m4/ld-version-script.m4
+++ b/lib/gl/m4/ld-version-script.m4
@@ -27,7 +27,7 @@ AC_DEFUN([gl_LD_VERSION_SCRIPT],
     LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
     cat > conftest.map <<EOF
 VERS_1 {
-       global: sym;
+        global: sym;
 };
 
 VERS_2 {
diff --git a/lib/gl/m4/lib-ld.m4 b/lib/gl/m4/lib-ld.m4
index e4863f2..4b4db07 100644
--- a/lib/gl/m4/lib-ld.m4
+++ b/lib/gl/m4/lib-ld.m4
@@ -59,7 +59,7 @@ if test "$GCC" = yes; then
       # Canonicalize the path of ld
       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
       done
       test -z "$LD" && LD="$ac_prog"
       ;;
@@ -89,9 +89,9 @@ AC_CACHE_VAL([acl_cv_path_LD],
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
       *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break ;;
+        test "$with_gnu_ld" != no && break ;;
       *)
-       test "$with_gnu_ld" != yes && break ;;
+        test "$with_gnu_ld" != yes && break ;;
       esac
     fi
   done
diff --git a/lib/gl/m4/longlong.m4 b/lib/gl/m4/longlong.m4
index eedc8d5..6d17ea3 100644
--- a/lib/gl/m4/longlong.m4
+++ b/lib/gl/m4/longlong.m4
@@ -20,30 +20,30 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
     [AC_LINK_IFELSE(
        [_AC_TYPE_LONG_LONG_SNIPPET],
        [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
-       dnl If cross compiling, assume the bug isn't important, since
-       dnl nobody cross compiles for this platform as far as we know.
-       AC_RUN_IFELSE(
-         [AC_LANG_PROGRAM(
-            address@hidden:@include <limits.h>
-              @%:@ifndef LLONG_MAX
-              @%:@ define HALF \
-                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-              @%:@ define LLONG_MAX (HALF - 1 + HALF)
-              @%:@endif]],
-            [[long long int n = 1;
-              int i;
-              for (i = 0; ; i++)
-                {
-                  long long int m = n << i;
-                  if (m >> i != n)
-                    return 1;
-                  if (LLONG_MAX / 2 < m)
-                    break;
-                }
-              return 0;]])],
-         [ac_cv_type_long_long_int=yes],
-         [ac_cv_type_long_long_int=no],
-         [ac_cv_type_long_long_int=yes])],
+        dnl If cross compiling, assume the bug isn't important, since
+        dnl nobody cross compiles for this platform as far as we know.
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+             address@hidden:@include <limits.h>
+               @%:@ifndef LLONG_MAX
+               @%:@ define HALF \
+                        (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+               @%:@ define LLONG_MAX (HALF - 1 + HALF)
+               @%:@endif]],
+             [[long long int n = 1;
+               int i;
+               for (i = 0; ; i++)
+                 {
+                   long long int m = n << i;
+                   if (m >> i != n)
+                     return 1;
+                   if (LLONG_MAX / 2 < m)
+                     break;
+                 }
+               return 0;]])],
+          [ac_cv_type_long_long_int=yes],
+          [ac_cv_type_long_long_int=no],
+          [ac_cv_type_long_long_int=yes])],
        [ac_cv_type_long_long_int=no])])
   if test $ac_cv_type_long_long_int = yes; then
     AC_DEFINE([HAVE_LONG_LONG_INT], [1],
@@ -83,24 +83,24 @@ AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
 [
   AC_LANG_PROGRAM(
     [[/* For now, do not test the preprocessor; as of 2007 there are too many
-        implementations with broken preprocessors.  Perhaps this can
-        be revisited in 2012.  In the meantime, code should not expect
-        #if to work with literals wider than 32 bits.  */
+         implementations with broken preprocessors.  Perhaps this can
+         be revisited in 2012.  In the meantime, code should not expect
+         #if to work with literals wider than 32 bits.  */
       /* Test literals.  */
       long long int ll = 9223372036854775807ll;
       long long int nll = -9223372036854775807LL;
       unsigned long long int ull = 18446744073709551615ULL;
       /* Test constant expressions.   */
       typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                    ? 1 : -1)];
+                     ? 1 : -1)];
       int i = 63;]],
     [[/* Test availability of runtime routines for shift and division.  */
       long long int llmax = 9223372036854775807ll;
       unsigned long long int ullmax = 18446744073709551615ull;
       return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-             | (llmax / ll) | (llmax % ll)
-             | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-             | (ullmax / ull) | (ullmax % ull));]])
+              | (llmax / ll) | (llmax % ll)
+              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+              | (ullmax / ull) | (ullmax % ull));]])
 ])
diff --git a/lib/gl/m4/stdbool.m4 b/lib/gl/m4/stdbool.m4
index 57c804a..5e22d7a 100644
--- a/lib/gl/m4/stdbool.m4
+++ b/lib/gl/m4/stdbool.m4
@@ -38,77 +38,77 @@ AC_DEFUN([AC_HEADER_STDBOOL],
   [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
      [ac_cv_header_stdbool_h],
      [AC_TRY_COMPILE(
-       [
-         #include <stdbool.h>
-         #ifndef bool
-          "error: bool is not defined"
-         #endif
-         #ifndef false
-          "error: false is not defined"
-         #endif
-         #if false
-          "error: false is not 0"
-         #endif
-         #ifndef true
-          "error: true is not defined"
-         #endif
-         #if true != 1
-          "error: true is not 1"
-         #endif
-         #ifndef __bool_true_false_are_defined
-          "error: __bool_true_false_are_defined is not defined"
-         #endif
+        [
+          #include <stdbool.h>
+          #ifndef bool
+           "error: bool is not defined"
+          #endif
+          #ifndef false
+           "error: false is not defined"
+          #endif
+          #if false
+           "error: false is not 0"
+          #endif
+          #ifndef true
+           "error: true is not defined"
+          #endif
+          #if true != 1
+           "error: true is not 1"
+          #endif
+          #ifndef __bool_true_false_are_defined
+           "error: __bool_true_false_are_defined is not defined"
+          #endif
 
-         struct s { _Bool s: 1; _Bool t; } s;
+          struct s { _Bool s: 1; _Bool t; } s;
 
-         char a[true == 1 ? 1 : -1];
-         char b[false == 0 ? 1 : -1];
-         char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-         char d[(bool) 0.5 == true ? 1 : -1];
-         bool e = &s;
-         char f[(_Bool) 0.0 == false ? 1 : -1];
-         char g[true];
-         char h[sizeof (_Bool)];
-         char i[sizeof s.t];
-         enum { j = false, k = true, l = false * true, m = true * 256 };
-         _Bool n[m];
-         char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-         char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-         #if defined __xlc__ || defined __GNUC__
-          /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-             reported by James Lemley on 2005-10-05; see
-             
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-             This test is not quite right, since xlc is allowed to
-             reject this program, as the initializer for xlcbug is
-             not one of the forms that C requires support for.
-             However, doing the test right would require a run-time
-             test, and that would make cross-compilation harder.
-             Let us hope that IBM fixes the xlc bug, and also adds
-             support for this kind of constant expression.  In the
-             meantime, this test will reject xlc, which is OK, since
-             our stdbool.h substitute should suffice.  We also test
-             this with GCC, where it should work, to detect more
-             quickly whether someone messes up the test in the
-             future.  */
-          char digs[] = "0123456789";
-          int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-         #endif
-         /* Catch a bug in an HP-UX C compiler.  See
-            http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-            
http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-          */
-         _Bool q = true;
-         _Bool *pq = &q;
-       ],
-       [
-         *pq |= q;
-         *pq |= ! q;
-         /* Refer to every declared value, to avoid compiler optimizations.  */
-         return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-                 + !m + !n + !o + !p + !q + !pq);
-       ],
-       [ac_cv_header_stdbool_h=yes],
-       [ac_cv_header_stdbool_h=no])])
+          char a[true == 1 ? 1 : -1];
+          char b[false == 0 ? 1 : -1];
+          char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+          char d[(bool) 0.5 == true ? 1 : -1];
+          bool e = &s;
+          char f[(_Bool) 0.0 == false ? 1 : -1];
+          char g[true];
+          char h[sizeof (_Bool)];
+          char i[sizeof s.t];
+          enum { j = false, k = true, l = false * true, m = true * 256 };
+          _Bool n[m];
+          char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+          char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+          #if defined __xlc__ || defined __GNUC__
+           /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+              reported by James Lemley on 2005-10-05; see
+              
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+              This test is not quite right, since xlc is allowed to
+              reject this program, as the initializer for xlcbug is
+              not one of the forms that C requires support for.
+              However, doing the test right would require a run-time
+              test, and that would make cross-compilation harder.
+              Let us hope that IBM fixes the xlc bug, and also adds
+              support for this kind of constant expression.  In the
+              meantime, this test will reject xlc, which is OK, since
+              our stdbool.h substitute should suffice.  We also test
+              this with GCC, where it should work, to detect more
+              quickly whether someone messes up the test in the
+              future.  */
+           char digs[] = "0123456789";
+           int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+          #endif
+          /* Catch a bug in an HP-UX C compiler.  See
+             http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+             
http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+           */
+          _Bool q = true;
+          _Bool *pq = &q;
+        ],
+        [
+          *pq |= q;
+          *pq |= ! q;
+          /* Refer to every declared value, to avoid compiler optimizations.  
*/
+          return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                  + !m + !n + !o + !p + !q + !pq);
+        ],
+        [ac_cv_header_stdbool_h=yes],
+        [ac_cv_header_stdbool_h=no])])
    AC_CHECK_TYPES([_Bool])
    if test $ac_cv_header_stdbool_h = yes; then
      AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to 
C99.])
diff --git a/lib/gl/m4/stdint.m4 b/lib/gl/m4/stdint.m4
index a2e8bdd..819d629 100644
--- a/lib/gl/m4/stdint.m4
+++ b/lib/gl/m4/stdint.m4
@@ -396,12 +396,12 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
        for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
          case $glsuf in
            '')  gltype1='int';;
-           l)  gltype1='long int';;
-           ll) gltype1='long long int';;
-           i64)        gltype1='__int64';;
-           u)  gltype1='unsigned int';;
-           ul) gltype1='unsigned long int';;
-           ull)        gltype1='unsigned long long int';;
+           l)   gltype1='long int';;
+           ll)  gltype1='long long int';;
+           i64) gltype1='__int64';;
+           u)   gltype1='unsigned int';;
+           ul)  gltype1='unsigned long int';;
+           ull) gltype1='unsigned long long int';;
            ui64)gltype1='unsigned __int64';;
          esac
          AC_COMPILE_IFELSE(
diff --git a/lib/gl/m4/string_h.m4 b/lib/gl/m4/string_h.m4
index edc5c6e..e870534 100644
--- a/lib/gl/m4/string_h.m4
+++ b/lib/gl/m4/string_h.m4
@@ -66,31 +66,31 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_STRSIGNAL=0;   AC_SUBST([GNULIB_STRSIGNAL])
   GNULIB_STRVERSCMP=0;   AC_SUBST([GNULIB_STRVERSCMP])
   dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_DECL_MEMMEM=1;          AC_SUBST([HAVE_DECL_MEMMEM])
-  HAVE_MEMPCPY=1;              AC_SUBST([HAVE_MEMPCPY])
-  HAVE_DECL_MEMRCHR=1;         AC_SUBST([HAVE_DECL_MEMRCHR])
-  HAVE_RAWMEMCHR=1;            AC_SUBST([HAVE_RAWMEMCHR])
-  HAVE_STPCPY=1;               AC_SUBST([HAVE_STPCPY])
-  HAVE_STPNCPY=1;              AC_SUBST([HAVE_STPNCPY])
-  HAVE_STRCHRNUL=1;            AC_SUBST([HAVE_STRCHRNUL])
-  HAVE_DECL_STRDUP=1;          AC_SUBST([HAVE_DECL_STRDUP])
-  HAVE_DECL_STRNDUP=1;         AC_SUBST([HAVE_DECL_STRNDUP])
-  HAVE_DECL_STRNLEN=1;         AC_SUBST([HAVE_DECL_STRNLEN])
-  HAVE_STRPBRK=1;              AC_SUBST([HAVE_STRPBRK])
-  HAVE_STRSEP=1;               AC_SUBST([HAVE_STRSEP])
-  HAVE_STRCASESTR=1;           AC_SUBST([HAVE_STRCASESTR])
-  HAVE_DECL_STRTOK_R=1;                AC_SUBST([HAVE_DECL_STRTOK_R])
-  HAVE_DECL_STRERROR=1;                AC_SUBST([HAVE_DECL_STRERROR])
-  HAVE_DECL_STRSIGNAL=1;       AC_SUBST([HAVE_DECL_STRSIGNAL])
-  HAVE_STRVERSCMP=1;           AC_SUBST([HAVE_STRVERSCMP])
-  REPLACE_MEMCHR=0;            AC_SUBST([REPLACE_MEMCHR])
-  REPLACE_MEMMEM=0;            AC_SUBST([REPLACE_MEMMEM])
-  REPLACE_STRDUP=0;            AC_SUBST([REPLACE_STRDUP])
-  REPLACE_STRSTR=0;            AC_SUBST([REPLACE_STRSTR])
-  REPLACE_STRCASESTR=0;                AC_SUBST([REPLACE_STRCASESTR])
-  REPLACE_STRERROR=0;          AC_SUBST([REPLACE_STRERROR])
-  REPLACE_STRNDUP=0;           AC_SUBST([REPLACE_STRNDUP])
-  REPLACE_STRSIGNAL=0;         AC_SUBST([REPLACE_STRSIGNAL])
-  REPLACE_STRTOK_R=0;          AC_SUBST([REPLACE_STRTOK_R])
-  UNDEFINE_STRTOK_R=0;         AC_SUBST([UNDEFINE_STRTOK_R])
+  HAVE_DECL_MEMMEM=1;           AC_SUBST([HAVE_DECL_MEMMEM])
+  HAVE_MEMPCPY=1;               AC_SUBST([HAVE_MEMPCPY])
+  HAVE_DECL_MEMRCHR=1;          AC_SUBST([HAVE_DECL_MEMRCHR])
+  HAVE_RAWMEMCHR=1;             AC_SUBST([HAVE_RAWMEMCHR])
+  HAVE_STPCPY=1;                AC_SUBST([HAVE_STPCPY])
+  HAVE_STPNCPY=1;               AC_SUBST([HAVE_STPNCPY])
+  HAVE_STRCHRNUL=1;             AC_SUBST([HAVE_STRCHRNUL])
+  HAVE_DECL_STRDUP=1;           AC_SUBST([HAVE_DECL_STRDUP])
+  HAVE_DECL_STRNDUP=1;          AC_SUBST([HAVE_DECL_STRNDUP])
+  HAVE_DECL_STRNLEN=1;          AC_SUBST([HAVE_DECL_STRNLEN])
+  HAVE_STRPBRK=1;               AC_SUBST([HAVE_STRPBRK])
+  HAVE_STRSEP=1;                AC_SUBST([HAVE_STRSEP])
+  HAVE_STRCASESTR=1;            AC_SUBST([HAVE_STRCASESTR])
+  HAVE_DECL_STRTOK_R=1;         AC_SUBST([HAVE_DECL_STRTOK_R])
+  HAVE_DECL_STRERROR=1;         AC_SUBST([HAVE_DECL_STRERROR])
+  HAVE_DECL_STRSIGNAL=1;        AC_SUBST([HAVE_DECL_STRSIGNAL])
+  HAVE_STRVERSCMP=1;            AC_SUBST([HAVE_STRVERSCMP])
+  REPLACE_MEMCHR=0;             AC_SUBST([REPLACE_MEMCHR])
+  REPLACE_MEMMEM=0;             AC_SUBST([REPLACE_MEMMEM])
+  REPLACE_STRDUP=0;             AC_SUBST([REPLACE_STRDUP])
+  REPLACE_STRSTR=0;             AC_SUBST([REPLACE_STRSTR])
+  REPLACE_STRCASESTR=0;         AC_SUBST([REPLACE_STRCASESTR])
+  REPLACE_STRERROR=0;           AC_SUBST([REPLACE_STRERROR])
+  REPLACE_STRNDUP=0;            AC_SUBST([REPLACE_STRNDUP])
+  REPLACE_STRSIGNAL=0;          AC_SUBST([REPLACE_STRSIGNAL])
+  REPLACE_STRTOK_R=0;           AC_SUBST([REPLACE_STRTOK_R])
+  UNDEFINE_STRTOK_R=0;          AC_SUBST([UNDEFINE_STRTOK_R])
 ])
diff --git a/lib/gl/m4/wchar.m4 b/lib/gl/m4/wchar.m4
index ce53a45..9f22e33 100644
--- a/lib/gl/m4/wchar.m4
+++ b/lib/gl/m4/wchar.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 dnl Written by Eric Blake.
 
-# wchar.m4 serial 25
+# wchar.m4 serial 26
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -45,6 +45,8 @@ wchar_t w;]],
     HAVE_WCHAR_H=0
   fi
   AC_SUBST([HAVE_WCHAR_H])
+  dnl Execute this unconditionally, because WCHAR_H may be set by other
+  dnl modules, after this code is executed.
   gl_CHECK_NEXT_HEADERS([wchar.h])
 ])
 
diff --git a/lib/gl/override/lib/gettext.h.diff 
b/lib/gl/override/lib/gettext.h.diff
index ec8f03f..a47642f 100644
--- a/lib/gl/override/lib/gettext.h.diff
+++ b/lib/gl/override/lib/gettext.h.diff
@@ -1,9 +1,79 @@
---- lib/gl/gettext.h.orig      2008-11-17 17:11:58.000000000 +0100
-+++ lib/gl/gettext.h   2008-11-17 17:12:03.000000000 +0100
-@@ -162,109 +162,4 @@
-     return translation;
- }
+--- lib/gl/gettext.h.orig      2009-12-16 00:52:01.000000000 +0100
++++ lib/gl/gettext.h   2009-12-16 00:53:49.000000000 +0100
+@@ -101,179 +101,4 @@
+    initializer for static 'char[]' or 'const char[]' variables.  */
+ #define gettext_noop(String) String
  
+-/* The separator between msgctxt and msgid in a .mo file.  */
+-#define GETTEXT_CONTEXT_GLUE "\004"
+-
+-/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+-   MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
+-   short and rarely need to change.
+-   The letter 'p' stands for 'particular' or 'special'.  */
+-#ifdef DEFAULT_TEXT_DOMAIN
+-# define pgettext(Msgctxt, Msgid) \
+-   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, LC_MESSAGES)
+-#else
+-# define pgettext(Msgctxt, Msgid) \
+-   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+-#endif
+-#define dpgettext(Domainname, Msgctxt, Msgid) \
+-  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
+-#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+-  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
Category)
+-#ifdef DEFAULT_TEXT_DOMAIN
+-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+-   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, MsgidPlural, N, LC_MESSAGES)
+-#else
+-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+-   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
+-#endif
+-#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+-  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
+-#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+-  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, Category)
+-
+-#ifdef __GNUC__
+-__inline
+-#else
+-#ifdef __cplusplus
+-inline
+-#endif
+-#endif
+-static const char *
+-pgettext_aux (const char *domain,
+-              const char *msg_ctxt_id, const char *msgid,
+-              int category)
+-{
+-  const char *translation = dcgettext (domain, msg_ctxt_id, category);
+-  if (translation == msg_ctxt_id)
+-    return msgid;
+-  else
+-    return translation;
+-}
+-
+-#ifdef __GNUC__
+-__inline
+-#else
+-#ifdef __cplusplus
+-inline
+-#endif
+-#endif
+-static const char *
+-npgettext_aux (const char *domain,
+-               const char *msg_ctxt_id, const char *msgid,
+-               const char *msgid_plural, unsigned long int n,
+-               int category)
+-{
+-  const char *translation =
+-    dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+-  if (translation == msg_ctxt_id || translation == msgid_plural)
+-    return (n == 1 ? msgid : msgid_plural);
+-  else
+-    return translation;
+-}
+-
 -/* The same thing extended for non-constant arguments.  Here MSGCTXT and MSGID
 -   can be arbitrary expressions.  But for string literals these macros are
 -   less efficient than those above.  */
@@ -32,8 +102,8 @@
 -#endif
 -static const char *
 -dcpgettext_expr (const char *domain,
--               const char *msgctxt, const char *msgid,
--               int category)
+-                 const char *msgctxt, const char *msgid,
+-                 int category)
 -{
 -  size_t msgctxt_len = strlen (msgctxt) + 1;
 -  size_t msgid_len = strlen (msgid) + 1;
@@ -55,10 +125,10 @@
 -      translation = dcgettext (domain, msg_ctxt_id, category);
 -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 -      if (msg_ctxt_id != buf)
--      free (msg_ctxt_id);
+-        free (msg_ctxt_id);
 -#endif
 -      if (translation != msg_ctxt_id)
--      return translation;
+-        return translation;
 -    }
 -  return msgid;
 -}
@@ -77,9 +147,9 @@
 -#endif
 -static const char *
 -dcnpgettext_expr (const char *domain,
--                const char *msgctxt, const char *msgid,
--                const char *msgid_plural, unsigned long int n,
--                int category)
+-                  const char *msgctxt, const char *msgid,
+-                  const char *msgid_plural, unsigned long int n,
+-                  int category)
 -{
 -  size_t msgctxt_len = strlen (msgctxt) + 1;
 -  size_t msgid_len = strlen (msgid) + 1;
@@ -101,10 +171,10 @@
 -      translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, 
category);
 -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 -      if (msg_ctxt_id != buf)
--      free (msg_ctxt_id);
+-        free (msg_ctxt_id);
 -#endif
 -      if (!(translation == msg_ctxt_id || translation == msgid_plural))
--      return translation;
+-        return translation;
 -    }
 -  return (n == 1 ? msgid : msgid_plural);
 -}
diff --git a/lib/gl/stdint.in.h b/lib/gl/stdint.in.h
index b63d431..81e6e77 100644
--- a/lib/gl/stdint.in.h
+++ b/lib/gl/stdint.in.h
@@ -102,8 +102,8 @@
   ((signed) \
    ? ~ _STDINT_MIN (signed, bits, zero) \
    : /* The expression for the unsigned case.  The subtraction of (signed) \
-       is a nop in the unsigned case and avoids "signed integer overflow" \
-       warnings in the signed case.  */ \
+        is a nop in the unsigned case and avoids "signed integer overflow" \
+        warnings in the signed case.  */ \
      ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
 /* 7.18.1.1. Exact-width integer types */
@@ -454,10 +454,10 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == 
sizeof (uintmax_t)) -
 #undef SIG_ATOMIC_MAX
 #define SIG_ATOMIC_MIN  \
    _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-               address@hidden@)
+                address@hidden@)
 #define SIG_ATOMIC_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-               address@hidden@)
+                address@hidden@)
 
 
 /* size_t limit */
diff --git a/lib/gl/striconv.c b/lib/gl/striconv.c
index 2c6c51f..6800702 100644
--- a/lib/gl/striconv.c
+++ b/lib/gl/striconv.c
@@ -42,7 +42,7 @@
 
 int
 mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
-             char **resultp, size_t *lengthp)
+              char **resultp, size_t *lengthp)
 {
 # define tmpbufsize 4096
   size_t length;
@@ -67,33 +67,33 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
 
     while (insize > 0)
       {
-       char *outptr = tmpbuf;
-       size_t outsize = tmpbufsize;
-       size_t res = iconv (cd,
-                           (ICONV_CONST char **) &inptr, &insize,
-                           &outptr, &outsize);
-
-       if (res == (size_t)(-1))
-         {
-           if (errno == E2BIG)
-             ;
-           else if (errno == EINVAL)
-             break;
-           else
-             return -1;
-         }
+        char *outptr = tmpbuf;
+        size_t outsize = tmpbufsize;
+        size_t res = iconv (cd,
+                            (ICONV_CONST char **) &inptr, &insize,
+                            &outptr, &outsize);
+
+        if (res == (size_t)(-1))
+          {
+            if (errno == E2BIG)
+              ;
+            else if (errno == EINVAL)
+              break;
+            else
+              return -1;
+          }
 # if !defined _LIBICONV_VERSION && !defined __GLIBC__
-       /* Irix iconv() inserts a NUL byte if it cannot convert.
-          NetBSD iconv() inserts a question mark if it cannot convert.
-          Only GNU libiconv and GNU libc are known to prefer to fail rather
-          than doing a lossy conversion.  */
-       else if (res > 0)
-         {
-           errno = EILSEQ;
-           return -1;
-         }
+        /* Irix iconv() inserts a NUL byte if it cannot convert.
+           NetBSD iconv() inserts a question mark if it cannot convert.
+           Only GNU libiconv and GNU libc are known to prefer to fail rather
+           than doing a lossy conversion.  */
+        else if (res > 0)
+          {
+            errno = EILSEQ;
+            return -1;
+          }
 # endif
-       count += outptr - tmpbuf;
+        count += outptr - tmpbuf;
       }
     /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
@@ -104,7 +104,7 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
       size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
 
       if (res == (size_t)(-1))
-       return -1;
+        return -1;
       count += outptr - tmpbuf;
     }
 # endif
@@ -123,10 +123,10 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
     {
       result = (char *) malloc (length);
       if (result == NULL)
-       {
-         errno = ENOMEM;
-         return -1;
-       }
+        {
+          errno = ENOMEM;
+          return -1;
+        }
     }
 
   /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
@@ -145,27 +145,27 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
 
     while (insize > 0)
       {
-       size_t res = iconv (cd,
-                           (ICONV_CONST char **) &inptr, &insize,
-                           &outptr, &outsize);
-
-       if (res == (size_t)(-1))
-         {
-           if (errno == EINVAL)
-             break;
-           else
-             goto fail;
-         }
+        size_t res = iconv (cd,
+                            (ICONV_CONST char **) &inptr, &insize,
+                            &outptr, &outsize);
+
+        if (res == (size_t)(-1))
+          {
+            if (errno == EINVAL)
+              break;
+            else
+              goto fail;
+          }
 # if !defined _LIBICONV_VERSION && !defined __GLIBC__
-       /* Irix iconv() inserts a NUL byte if it cannot convert.
-          NetBSD iconv() inserts a question mark if it cannot convert.
-          Only GNU libiconv and GNU libc are known to prefer to fail rather
-          than doing a lossy conversion.  */
-       else if (res > 0)
-         {
-           errno = EILSEQ;
-           goto fail;
-         }
+        /* Irix iconv() inserts a NUL byte if it cannot convert.
+           NetBSD iconv() inserts a question mark if it cannot convert.
+           Only GNU libiconv and GNU libc are known to prefer to fail rather
+           than doing a lossy conversion.  */
+        else if (res > 0)
+          {
+            errno = EILSEQ;
+            goto fail;
+          }
 # endif
       }
     /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
@@ -175,7 +175,7 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
       size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
 
       if (res == (size_t)(-1))
-       goto fail;
+        goto fail;
     }
 # endif
     if (outsize != 0)
@@ -191,9 +191,9 @@ mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
   {
     if (result != *resultp)
       {
-       int saved_errno = errno;
-       free (result);
-       errno = saved_errno;
+        int saved_errno = errno;
+        free (result);
+        errno = saved_errno;
       }
     return -1;
   }
@@ -224,7 +224,7 @@ str_cd_iconv (const char *src, iconv_t cd)
   if (retval < 0)
     {
       if (result != NULL)
-       abort ();
+        abort ();
       return NULL;
     }
 
@@ -234,7 +234,7 @@ str_cd_iconv (const char *src, iconv_t cd)
   if (final_result == NULL)
     {
       if (result != NULL)
-       free (result);
+        free (result);
       errno = ENOMEM;
       return NULL;
     }
@@ -285,81 +285,81 @@ str_cd_iconv (const char *src, iconv_t cd)
 
     for (;;)
       {
-       /* Here inptr + inbytes_remaining = src + strlen (src),
-               outptr + outbytes_remaining = result + result_size - 1.  */
-       size_t res = iconv (cd,
-                           (ICONV_CONST char **) &inptr, &inbytes_remaining,
-                           &outptr, &outbytes_remaining);
-
-       if (res == (size_t)(-1))
-         {
-           if (errno == EINVAL)
-             break;
-           else if (errno == E2BIG)
-             {
-               size_t used = outptr - result;
-               size_t newsize = result_size * 2;
-               char *newresult;
-
-               if (!(newsize > result_size))
-                 {
-                   errno = ENOMEM;
-                   goto failed;
-                 }
-               newresult = (char *) realloc (result, newsize);
-               if (newresult == NULL)
-                 {
-                   errno = ENOMEM;
-                   goto failed;
-                 }
-               result = newresult;
-               result_size = newsize;
-               outptr = result + used;
-               outbytes_remaining = result_size - 1 - used;
-             }
-           else
-             goto failed;
-         }
-       else
-         break;
+        /* Here inptr + inbytes_remaining = src + strlen (src),
+                outptr + outbytes_remaining = result + result_size - 1.  */
+        size_t res = iconv (cd,
+                            (ICONV_CONST char **) &inptr, &inbytes_remaining,
+                            &outptr, &outbytes_remaining);
+
+        if (res == (size_t)(-1))
+          {
+            if (errno == EINVAL)
+              break;
+            else if (errno == E2BIG)
+              {
+                size_t used = outptr - result;
+                size_t newsize = result_size * 2;
+                char *newresult;
+
+                if (!(newsize > result_size))
+                  {
+                    errno = ENOMEM;
+                    goto failed;
+                  }
+                newresult = (char *) realloc (result, newsize);
+                if (newresult == NULL)
+                  {
+                    errno = ENOMEM;
+                    goto failed;
+                  }
+                result = newresult;
+                result_size = newsize;
+                outptr = result + used;
+                outbytes_remaining = result_size - 1 - used;
+              }
+            else
+              goto failed;
+          }
+        else
+          break;
       }
     /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
 # if defined _LIBICONV_VERSION \
      || !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
     for (;;)
       {
-       /* Here outptr + outbytes_remaining = result + result_size - 1.  */
-       size_t res = iconv (cd, NULL, NULL, &outptr, &outbytes_remaining);
-
-       if (res == (size_t)(-1))
-         {
-           if (errno == E2BIG)
-             {
-               size_t used = outptr - result;
-               size_t newsize = result_size * 2;
-               char *newresult;
-
-               if (!(newsize > result_size))
-                 {
-                   errno = ENOMEM;
-                   goto failed;
-                 }
-               newresult = (char *) realloc (result, newsize);
-               if (newresult == NULL)
-                 {
-                   errno = ENOMEM;
-                   goto failed;
-                 }
-               result = newresult;
-               result_size = newsize;
-               outptr = result + used;
-               outbytes_remaining = result_size - 1 - used;
-             }
-           else
-             goto failed;
-         }
-       else
-         break;
+        /* Here outptr + outbytes_remaining = result + result_size - 1.  */
+        size_t res = iconv (cd, NULL, NULL, &outptr, &outbytes_remaining);
+
+        if (res == (size_t)(-1))
+          {
+            if (errno == E2BIG)
+              {
+                size_t used = outptr - result;
+                size_t newsize = result_size * 2;
+                char *newresult;
+
+                if (!(newsize > result_size))
+                  {
+                    errno = ENOMEM;
+                    goto failed;
+                  }
+                newresult = (char *) realloc (result, newsize);
+                if (newresult == NULL)
+                  {
+                    errno = ENOMEM;
+                    goto failed;
+                  }
+                result = newresult;
+                result_size = newsize;
+                outptr = result + used;
+                outbytes_remaining = result_size - 1 - used;
+              }
+            else
+              goto failed;
+          }
+        else
+          break;
       }
 # endif
 
@@ -375,7 +375,7 @@ str_cd_iconv (const char *src, iconv_t cd)
       char *smaller_result = (char *) realloc (result, length);
 
       if (smaller_result != NULL)
-       result = smaller_result;
+        result = smaller_result;
     }
 
   return result;
@@ -401,7 +401,7 @@ str_iconv (const char *src, const char *from_codeset, const 
char *to_codeset)
       char *result = strdup (src);
 
       if (result == NULL)
-       errno = ENOMEM;
+        errno = ENOMEM;
       return result;
     }
   else
@@ -413,44 +413,44 @@ str_iconv (const char *src, const char *from_codeset, 
const char *to_codeset)
       /* Avoid glibc-2.1 bug with EUC-KR.  */
 # if (__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) && !defined 
_LIBICONV_VERSION
       if (c_strcasecmp (from_codeset, "EUC-KR") == 0
-         || c_strcasecmp (to_codeset, "EUC-KR") == 0)
-       {
-         errno = EINVAL;
-         return NULL;
-       }
+          || c_strcasecmp (to_codeset, "EUC-KR") == 0)
+        {
+          errno = EINVAL;
+          return NULL;
+        }
 # endif
       cd = iconv_open (to_codeset, from_codeset);
       if (cd == (iconv_t) -1)
-       return NULL;
+        return NULL;
 
       result = str_cd_iconv (src, cd);
 
       if (result == NULL)
-       {
-         /* Close cd, but preserve the errno from str_cd_iconv.  */
-         int saved_errno = errno;
-         iconv_close (cd);
-         errno = saved_errno;
-       }
+        {
+          /* Close cd, but preserve the errno from str_cd_iconv.  */
+          int saved_errno = errno;
+          iconv_close (cd);
+          errno = saved_errno;
+        }
       else
-       {
-         if (iconv_close (cd) < 0)
-           {
-             /* Return NULL, but free the allocated memory, and while doing
-                that, preserve the errno from iconv_close.  */
-             int saved_errno = errno;
-             free (result);
-             errno = saved_errno;
-             return NULL;
-           }
-       }
+        {
+          if (iconv_close (cd) < 0)
+            {
+              /* Return NULL, but free the allocated memory, and while doing
+                 that, preserve the errno from iconv_close.  */
+              int saved_errno = errno;
+              free (result);
+              errno = saved_errno;
+              return NULL;
+            }
+        }
       return result;
 #else
       /* This is a different error code than if iconv_open existed but didn't
-        support from_codeset and to_codeset, so that the caller can emit
-        an error message such as
-          "iconv() is not supported. Installing GNU libiconv and
-           then reinstalling this package would fix this."  */
+         support from_codeset and to_codeset, so that the caller can emit
+         an error message such as
+           "iconv() is not supported. Installing GNU libiconv and
+            then reinstalling this package would fix this."  */
       errno = ENOSYS;
       return NULL;
 #endif
diff --git a/lib/gl/striconv.h b/lib/gl/striconv.h
index 3f1b107..4446e8d 100644
--- a/lib/gl/striconv.h
+++ b/lib/gl/striconv.h
@@ -43,7 +43,7 @@ extern "C" {
    in *LENGTHP.  *RESULTP is set to a freshly allocated memory block, or is
    unchanged if no dynamic memory allocation was necessary.  */
 extern int mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
-                        char **resultp, size_t *lengthp);
+                         char **resultp, size_t *lengthp);
 
 /* Convert an entire string from one encoding to another, using iconv.
    The original string is the NUL-terminated string starting at SRC.
@@ -65,7 +65,7 @@ extern char * str_cd_iconv (const char *src, iconv_t cd);
    Return value: the freshly allocated resulting NUL-terminated string if
    successful, otherwise NULL and errno set.  */
 extern char * str_iconv (const char *src,
-                        const char *from_codeset, const char *to_codeset);
+                         const char *from_codeset, const char *to_codeset);
 
 
 #ifdef __cplusplus
diff --git a/lib/gl/string.in.h b/lib/gl/string.in.h
index 4b6d47f..0b78cd6 100644
--- a/lib/gl/string.in.h
+++ b/lib/gl/string.in.h
@@ -45,6 +45,8 @@
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 
 #ifdef __cplusplus
 extern "C" {
@@ -56,7 +58,7 @@ extern "C" {
 # if @REPLACE_MEMCHR@
 #  define memchr rpl_memchr
 extern void *memchr (void const *__s, int __c, size_t __n)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memchr
@@ -73,8 +75,8 @@ extern void *memchr (void const *__s, int __c, size_t __n)
 # endif
 # if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@
 extern void *memmem (void const *__haystack, size_t __haystack_len,
-                    void const *__needle, size_t __needle_len)
-  __attribute__ ((__pure__));
+                     void const *__needle, size_t __needle_len)
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memmem
@@ -90,7 +92,8 @@ extern void *memmem (void const *__haystack, size_t 
__haystack_len,
 #if @GNULIB_MEMPCPY@
 # if ! @HAVE_MEMPCPY@
 extern void *mempcpy (void *restrict __dest, void const *restrict __src,
-                     size_t __n);
+                      size_t __n)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mempcpy
@@ -104,7 +107,7 @@ extern void *mempcpy (void *restrict __dest, void const 
*restrict __src,
 #if @GNULIB_MEMRCHR@
 # if ! @HAVE_DECL_MEMRCHR@
 extern void *memrchr (void const *, int, size_t)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memrchr
@@ -120,7 +123,7 @@ extern void *memrchr (void const *, int, size_t)
 #if @GNULIB_RAWMEMCHR@
 # if ! @HAVE_RAWMEMCHR@
 extern void *rawmemchr (void const *__s, int __c_in)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef rawmemchr
@@ -133,7 +136,8 @@ extern void *rawmemchr (void const *__s, int __c_in)
 /* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
 #if @GNULIB_STPCPY@
 # if ! @HAVE_STPCPY@
-extern char *stpcpy (char *restrict __dst, char const *restrict __src);
+extern char *stpcpy (char *restrict __dst, char const *restrict __src)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef stpcpy
@@ -149,7 +153,8 @@ extern char *stpcpy (char *restrict __dst, char const 
*restrict __src);
 # if ! @HAVE_STPNCPY@
 #  define stpncpy gnu_stpncpy
 extern char *stpncpy (char *restrict __dst, char const *restrict __src,
-                     size_t __n);
+                      size_t __n)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef stpncpy
@@ -174,7 +179,7 @@ extern char *stpncpy (char *restrict __dst, char const 
*restrict __src,
 #if @GNULIB_STRCHRNUL@
 # if ! @HAVE_STRCHRNUL@
 extern char *strchrnul (char const *__s, int __c_in)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strchrnul
@@ -191,7 +196,7 @@ extern char *strchrnul (char const *__s, int __c_in)
 #  define strdup rpl_strdup
 # endif
 # if !(@HAVE_DECL_STRDUP@ || defined strdup) || @REPLACE_STRDUP@
-extern char *strdup (char const *__s);
+extern char *strdup (char const *__s) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strdup
@@ -208,7 +213,7 @@ extern char *strdup (char const *__s);
 #  define strndup rpl_strndup
 # endif
 # if @REPLACE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
-extern char *strndup (char const *__string, size_t __n);
+extern char *strndup (char const *__string, size_t __n) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strndup
@@ -224,7 +229,7 @@ extern char *strndup (char const *__string, size_t __n);
 #if @GNULIB_STRNLEN@
 # if ! @HAVE_DECL_STRNLEN@
 extern size_t strnlen (char const *__string, size_t __maxlen)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strnlen
@@ -251,7 +256,7 @@ extern size_t strnlen (char const *__string, size_t 
__maxlen)
 #if @GNULIB_STRPBRK@
 # if ! @HAVE_STRPBRK@
 extern char *strpbrk (char const *__s, char const *__accept)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
 # endif
 # if defined GNULIB_POSIXCHECK
 /* strpbrk() assumes the second argument is a list of single-byte characters.
@@ -313,7 +318,8 @@ extern char *strpbrk (char const *__s, char const *__accept)
    See also strtok_r().  */
 #if @GNULIB_STRSEP@
 # if ! @HAVE_STRSEP@
-extern char *strsep (char **restrict __stringp, char const *restrict __delim);
+extern char *strsep (char **restrict __stringp, char const *restrict __delim)
+     _GL_ARG_NONNULL ((1, 2));
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef strsep
@@ -334,8 +340,8 @@ extern char *strsep (char **restrict __stringp, char const 
*restrict __delim);
 #if @GNULIB_STRSTR@
 # if @REPLACE_STRSTR@
 #  define strstr rpl_strstr
-char *strstr (const char *haystack, const char *needle)
-  __attribute__ ((__pure__));
+extern char *strstr (const char *haystack, const char *needle)
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 /* strstr() does not work with multibyte strings if the locale encoding is
@@ -360,7 +366,7 @@ char *strstr (const char *haystack, const char *needle)
 # endif
 # if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@
 extern char *strcasestr (const char *haystack, const char *needle)
-  __attribute__ ((__pure__));
+     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 /* strcasestr() does not work with multibyte strings:
@@ -379,12 +385,12 @@ extern char *strcasestr (const char *haystack, const char 
*needle)
 /* Parse S into tokens separated by characters in DELIM.
    If S is NULL, the saved pointer in SAVE_PTR is used as
    the next starting point.  For example:
-       char s[] = "-abc-=-def";
-       char *sp;
-       x = strtok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
-       x = strtok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
-       x = strtok_r(NULL, "=", &sp);   // x = NULL
-               // s = "abc\0-def\0"
+        char s[] = "-abc-=-def";
+        char *sp;
+        x = strtok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
+        x = strtok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
+        x = strtok_r(NULL, "=", &sp);   // x = NULL
+                // s = "abc\0-def\0"
 
    This is a variant of strtok() that is multithread-safe.
 
@@ -407,7 +413,8 @@ extern char *strcasestr (const char *haystack, const char 
*needle)
 # endif
 # if ! @HAVE_DECL_STRTOK_R@ || @REPLACE_STRTOK_R@
 extern char *strtok_r (char *restrict s, char const *restrict delim,
-                      char **restrict save_ptr);
+                       char **restrict save_ptr)
+     _GL_ARG_NONNULL ((2, 3));
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef strtok_r
@@ -432,13 +439,13 @@ extern char *strtok_r (char *restrict s, char const 
*restrict delim,
 #if @GNULIB_MBSLEN@
 /* Return the number of multibyte characters in the character string STRING.
    This considers multibyte characters, unlike strlen, which counts bytes.  */
-extern size_t mbslen (const char *string);
+extern size_t mbslen (const char *string) _GL_ARG_NONNULL ((1));
 #endif
 
 #if @GNULIB_MBSNLEN@
 /* Return the number of multibyte characters in the character string starting
    at STRING and ending at STRING + LEN.  */
-extern size_t mbsnlen (const char *string, size_t len);
+extern size_t mbsnlen (const char *string, size_t len) _GL_ARG_NONNULL ((1));
 #endif
 
 #if @GNULIB_MBSCHR@
@@ -447,7 +454,7 @@ extern size_t mbsnlen (const char *string, size_t len);
    Unlike strchr(), this function works correctly in multibyte locales with
    encodings such as GB18030.  */
 # define mbschr rpl_mbschr /* avoid collision with HP-UX function */
-extern char * mbschr (const char *string, int c);
+extern char * mbschr (const char *string, int c) _GL_ARG_NONNULL ((1));
 #endif
 
 #if @GNULIB_MBSRCHR@
@@ -456,7 +463,7 @@ extern char * mbschr (const char *string, int c);
    Unlike strrchr(), this function works correctly in multibyte locales with
    encodings such as GB18030.  */
 # define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
-extern char * mbsrchr (const char *string, int c);
+extern char * mbsrchr (const char *string, int c) _GL_ARG_NONNULL ((1));
 #endif
 
 #if @GNULIB_MBSSTR@
@@ -464,7 +471,8 @@ extern char * mbsrchr (const char *string, int c);
    string HAYSTACK.  Return NULL if NEEDLE is not found in HAYSTACK.
    Unlike strstr(), this function works correctly in multibyte locales with
    encodings different from UTF-8.  */
-extern char * mbsstr (const char *haystack, const char *needle);
+extern char * mbsstr (const char *haystack, const char *needle)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSCASECMP@
@@ -474,7 +482,8 @@ extern char * mbsstr (const char *haystack, const char 
*needle);
    Note: This function may, in multibyte locales, return 0 for strings of
    different lengths!
    Unlike strcasecmp(), this function works correctly in multibyte locales.  */
-extern int mbscasecmp (const char *s1, const char *s2);
+extern int mbscasecmp (const char *s1, const char *s2)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSNCASECMP@
@@ -487,7 +496,8 @@ extern int mbscasecmp (const char *s1, const char *s2);
    of different lengths!
    Unlike strncasecmp(), this function works correctly in multibyte locales.
    But beware that N is not a byte count but a character count!  */
-extern int mbsncasecmp (const char *s1, const char *s2, size_t n);
+extern int mbsncasecmp (const char *s1, const char *s2, size_t n)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSPCASECMP@
@@ -500,7 +510,8 @@ extern int mbsncasecmp (const char *s1, const char *s2, 
size_t n);
    smaller length than PREFIX!
    Unlike strncasecmp(), this function works correctly in multibyte
    locales.  */
-extern char * mbspcasecmp (const char *string, const char *prefix);
+extern char * mbspcasecmp (const char *string, const char *prefix)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSCASESTR@
@@ -509,7 +520,8 @@ extern char * mbspcasecmp (const char *string, const char 
*prefix);
    Note: This function may, in multibyte locales, return success even if
    strlen (haystack) < strlen (needle) !
    Unlike strcasestr(), this function works correctly in multibyte locales.  */
-extern char * mbscasestr (const char *haystack, const char *needle);
+extern char * mbscasestr (const char *haystack, const char *needle)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSCSPN@
@@ -518,7 +530,8 @@ extern char * mbscasestr (const char *haystack, const char 
*needle);
    beginning of the string to this occurrence, or to the end of the string
    if none exists.
    Unlike strcspn(), this function works correctly in multibyte locales.  */
-extern size_t mbscspn (const char *string, const char *accept);
+extern size_t mbscspn (const char *string, const char *accept)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSPBRK@
@@ -527,7 +540,8 @@ extern size_t mbscspn (const char *string, const char 
*accept);
    exists.
    Unlike strpbrk(), this function works correctly in multibyte locales.  */
 # define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
-extern char * mbspbrk (const char *string, const char *accept);
+extern char * mbspbrk (const char *string, const char *accept)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSSPN@
@@ -536,7 +550,8 @@ extern char * mbspbrk (const char *string, const char 
*accept);
    beginning of the string to this occurrence, or to the end of the string
    if none exists.
    Unlike strspn(), this function works correctly in multibyte locales.  */
-extern size_t mbsspn (const char *string, const char *reject);
+extern size_t mbsspn (const char *string, const char *reject)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSSEP@
@@ -554,7 +569,8 @@ extern size_t mbsspn (const char *string, const char 
*reject);
    Caveat: The identity of the delimiting character is lost.
 
    See also mbstok_r().  */
-extern char * mbssep (char **stringp, const char *delim);
+extern char * mbssep (char **stringp, const char *delim)
+     _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSTOK_R@
@@ -562,19 +578,20 @@ extern char * mbssep (char **stringp, const char *delim);
    the character string DELIM.
    If STRING is NULL, the saved pointer in SAVE_PTR is used as
    the next starting point.  For example:
-       char s[] = "-abc-=-def";
-       char *sp;
-       x = mbstok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
-       x = mbstok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
-       x = mbstok_r(NULL, "=", &sp);   // x = NULL
-               // s = "abc\0-def\0"
+        char s[] = "-abc-=-def";
+        char *sp;
+        x = mbstok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
+        x = mbstok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
+        x = mbstok_r(NULL, "=", &sp);   // x = NULL
+                // s = "abc\0-def\0"
 
    Caveat: It modifies the original string.
    Caveat: These functions cannot be used on constant strings.
    Caveat: The identity of the delimiting character is lost.
 
    See also mbssep().  */
-extern char * mbstok_r (char *string, const char *delim, char **save_ptr);
+extern char * mbstok_r (char *string, const char *delim, char **save_ptr)
+     _GL_ARG_NONNULL ((2, 3));
 #endif
 
 /* Map any int, typically from errno, into an error message.  */
@@ -609,7 +626,7 @@ extern char *strsignal (int __sig);
 
 #if @GNULIB_STRVERSCMP@
 # if address@hidden@
-extern int strverscmp (const char *, const char *);
+extern int strverscmp (const char *, const char *) _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strverscmp
diff --git a/lib/gl/strverscmp.c b/lib/gl/strverscmp.c
index 84b4ab8..2b758db 100644
--- a/lib/gl/strverscmp.c
+++ b/lib/gl/strverscmp.c
@@ -117,8 +117,8 @@ __strverscmp (const char *s1, const char *s2)
 
     case LEN:
       while (ISDIGIT (*p1++))
-       if (!ISDIGIT (*p2++))
-         return 1;
+        if (!ISDIGIT (*p2++))
+          return 1;
 
       return ISDIGIT (*p2) ? -1 : diff;
 
diff --git a/lib/gl/wchar.in.h b/lib/gl/wchar.in.h
index 9f5b963..bb37465 100644
--- a/lib/gl/wchar.in.h
+++ b/lib/gl/wchar.in.h
@@ -74,6 +74,8 @@
 
 /* The definition of GL_LINK_WARNING is copied here.  */
 
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -197,7 +199,8 @@ extern size_t mbrlen (const char *s, size_t n, mbstate_t 
*ps);
 #  define mbsrtowcs rpl_mbsrtowcs
 # endif
 # if address@hidden@ || @REPLACE_MBSRTOWCS@
-extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, 
mbstate_t *ps);
+extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, 
mbstate_t *ps)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbsrtowcs
@@ -215,7 +218,8 @@ extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, 
size_t len, mbstate_t
 #  define mbsnrtowcs rpl_mbsnrtowcs
 # endif
 # if address@hidden@ || @REPLACE_MBSNRTOWCS@
-extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, 
size_t len, mbstate_t *ps);
+extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, 
size_t len, mbstate_t *ps)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbsnrtowcs
@@ -251,7 +255,8 @@ extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
 #  define wcsrtombs rpl_wcsrtombs
 # endif
 # if address@hidden@ || @REPLACE_WCSRTOMBS@
-extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, 
mbstate_t *ps);
+extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, 
mbstate_t *ps)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsrtombs
@@ -269,7 +274,8 @@ extern size_t wcsrtombs (char *dest, const wchar_t **srcp, 
size_t len, mbstate_t
 #  define wcsnrtombs rpl_wcsnrtombs
 # endif
 # if address@hidden@ || @REPLACE_WCSNRTOMBS@
-extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, 
size_t len, mbstate_t *ps);
+extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, 
size_t len, mbstate_t *ps)
+     _GL_ARG_NONNULL ((2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsnrtombs
diff --git a/lib/gltests/Makefile.am b/lib/gltests/Makefile.am
index a6d6297..e367b84 100644
--- a/lib/gltests/Makefile.am
+++ b/lib/gltests/Makefile.am
@@ -80,7 +80,18 @@ EXTRA_DIST += intprops.h
 
 ## begin gnulib module link-warning
 
-LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
+BUILT_SOURCES += link-warning.h
+# The link-warning.h that gets inserted into generated .h files is the same as
+# build-aux/link-warning.h, except that it has the copyright header cut off.
+link-warning.h: $(top_srcdir)/build-aux/link-warning.h
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       sed -n -e '/GL_LINK_WARNING/,$$p' \
+         < $(top_srcdir)/build-aux/link-warning.h \
+         > address@hidden && \
+       mv address@hidden $@
+MOSTLYCLEANFILES += link-warning.h link-warning.h-t
+
+LINK_WARNING_H=link-warning.h
 
 EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h
 
diff --git a/lib/gltests/intprops.h b/lib/gltests/intprops.h
index 325c397..a0f4669 100644
--- a/lib/gltests/intprops.h
+++ b/lib/gltests/intprops.h
@@ -47,14 +47,14 @@
    your host.  */
 # define TYPE_MINIMUM(t) \
   ((t) (! TYPE_SIGNED (t) \
-       ? (t) 0 \
-       : TYPE_SIGNED_MAGNITUDE (t) \
-       ? ~ (t) 0 \
-       : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+        ? (t) 0 \
+        : TYPE_SIGNED_MAGNITUDE (t) \
+        ? ~ (t) 0 \
+        : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
 # define TYPE_MAXIMUM(t) \
   ((t) (! TYPE_SIGNED (t) \
-       ? (t) -1 \
-       : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+        ? (t) -1 \
+        : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
 
 /* Return zero if T can be determined to be an unsigned type.
    Otherwise, return 1.
diff --git a/lib/gltests/test-c-ctype.c b/lib/gltests/test-c-ctype.c
index 6d7fe1b..e04de2e 100644
--- a/lib/gltests/test-c-ctype.c
+++ b/lib/gltests/test-c-ctype.c
@@ -25,15 +25,15 @@
 #include <stdlib.h>
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 static void
@@ -46,81 +46,81 @@ test_all (void)
       ASSERT (c_isascii (c) == (c >= 0 && c < 0x80));
 
       switch (c)
-       {
-       case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-       case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-       case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-       case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-       case 'Y': case 'Z':
-       case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-       case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-       case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-       case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-       case 'y': case 'z':
-       case '0': case '1': case '2': case '3': case '4': case '5':
-       case '6': case '7': case '8': case '9':
-         ASSERT (c_isalnum (c) == 1);
-         break;
-       default:
-         ASSERT (c_isalnum (c) == 0);
-         break;
-       }
+        {
+        case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+        case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+        case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+        case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+        case 'Y': case 'Z':
+        case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+        case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+        case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+        case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+        case 'y': case 'z':
+        case '0': case '1': case '2': case '3': case '4': case '5':
+        case '6': case '7': case '8': case '9':
+          ASSERT (c_isalnum (c) == 1);
+          break;
+        default:
+          ASSERT (c_isalnum (c) == 0);
+          break;
+        }
 
       switch (c)
-       {
-       case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-       case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-       case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-       case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-       case 'Y': case 'Z':
-       case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-       case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-       case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-       case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-       case 'y': case 'z':
-         ASSERT (c_isalpha (c) == 1);
-         break;
-       default:
-         ASSERT (c_isalpha (c) == 0);
-         break;
-       }
+        {
+        case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+        case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+        case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+        case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+        case 'Y': case 'Z':
+        case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+        case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+        case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+        case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+        case 'y': case 'z':
+          ASSERT (c_isalpha (c) == 1);
+          break;
+        default:
+          ASSERT (c_isalpha (c) == 0);
+          break;
+        }
 
       switch (c)
-       {
-       case '\t': case ' ':
-         ASSERT (c_isblank (c) == 1);
-         break;
-       default:
-         ASSERT (c_isblank (c) == 0);
-         break;
-       }
+        {
+        case '\t': case ' ':
+          ASSERT (c_isblank (c) == 1);
+          break;
+        default:
+          ASSERT (c_isblank (c) == 0);
+          break;
+        }
 
       ASSERT (c_iscntrl (c) == ((c >= 0 && c < 0x20) || c == 0x7f));
 
       switch (c)
-       {
-       case '0': case '1': case '2': case '3': case '4': case '5':
-       case '6': case '7': case '8': case '9':
-         ASSERT (c_isdigit (c) == 1);
-         break;
-       default:
-         ASSERT (c_isdigit (c) == 0);
-         break;
-       }
+        {
+        case '0': case '1': case '2': case '3': case '4': case '5':
+        case '6': case '7': case '8': case '9':
+          ASSERT (c_isdigit (c) == 1);
+          break;
+        default:
+          ASSERT (c_isdigit (c) == 0);
+          break;
+        }
 
       switch (c)
-       {
-       case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-       case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-       case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-       case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-       case 'y': case 'z':
-         ASSERT (c_islower (c) == 1);
-         break;
-       default:
-         ASSERT (c_islower (c) == 0);
-         break;
-       }
+        {
+        case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+        case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+        case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+        case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+        case 'y': case 'z':
+          ASSERT (c_islower (c) == 1);
+          break;
+        default:
+          ASSERT (c_islower (c) == 0);
+          break;
+        }
 
       ASSERT (c_isgraph (c) == ((c >= 0x20 && c < 0x7f) && c != ' '));
 
@@ -129,257 +129,257 @@ test_all (void)
       ASSERT (c_ispunct (c) == (c_isgraph (c) && !c_isalnum (c)));
 
       switch (c)
-       {
-       case ' ': case '\t': case '\n': case '\v': case '\f': case '\r':
-         ASSERT (c_isspace (c) == 1);
-         break;
-       default:
-         ASSERT (c_isspace (c) == 0);
-         break;
-       }
+        {
+        case ' ': case '\t': case '\n': case '\v': case '\f': case '\r':
+          ASSERT (c_isspace (c) == 1);
+          break;
+        default:
+          ASSERT (c_isspace (c) == 0);
+          break;
+        }
 
       switch (c)
-       {
-       case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-       case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-       case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-       case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-       case 'Y': case 'Z':
-         ASSERT (c_isupper (c) == 1);
-         break;
-       default:
-         ASSERT (c_isupper (c) == 0);
-         break;
-       }
+        {
+        case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+        case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+        case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+        case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+        case 'Y': case 'Z':
+          ASSERT (c_isupper (c) == 1);
+          break;
+        default:
+          ASSERT (c_isupper (c) == 0);
+          break;
+        }
 
       switch (c)
-       {
-       case '0': case '1': case '2': case '3': case '4': case '5':
-       case '6': case '7': case '8': case '9':
-       case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-       case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-         ASSERT (c_isxdigit (c) == 1);
-         break;
-       default:
-         ASSERT (c_isxdigit (c) == 0);
-         break;
-       }
+        {
+        case '0': case '1': case '2': case '3': case '4': case '5':
+        case '6': case '7': case '8': case '9':
+        case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+        case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+          ASSERT (c_isxdigit (c) == 1);
+          break;
+        default:
+          ASSERT (c_isxdigit (c) == 0);
+          break;
+        }
 
       switch (c)
-       {
-       case 'A':
-         ASSERT (c_tolower (c) == 'a');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'B':
-         ASSERT (c_tolower (c) == 'b');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'C':
-         ASSERT (c_tolower (c) == 'c');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'D':
-         ASSERT (c_tolower (c) == 'd');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'E':
-         ASSERT (c_tolower (c) == 'e');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'F':
-         ASSERT (c_tolower (c) == 'f');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'G':
-         ASSERT (c_tolower (c) == 'g');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'H':
-         ASSERT (c_tolower (c) == 'h');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'I':
-         ASSERT (c_tolower (c) == 'i');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'J':
-         ASSERT (c_tolower (c) == 'j');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'K':
-         ASSERT (c_tolower (c) == 'k');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'L':
-         ASSERT (c_tolower (c) == 'l');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'M':
-         ASSERT (c_tolower (c) == 'm');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'N':
-         ASSERT (c_tolower (c) == 'n');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'O':
-         ASSERT (c_tolower (c) == 'o');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'P':
-         ASSERT (c_tolower (c) == 'p');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'Q':
-         ASSERT (c_tolower (c) == 'q');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'R':
-         ASSERT (c_tolower (c) == 'r');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'S':
-         ASSERT (c_tolower (c) == 's');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'T':
-         ASSERT (c_tolower (c) == 't');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'U':
-         ASSERT (c_tolower (c) == 'u');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'V':
-         ASSERT (c_tolower (c) == 'v');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'W':
-         ASSERT (c_tolower (c) == 'w');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'X':
-         ASSERT (c_tolower (c) == 'x');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'Y':
-         ASSERT (c_tolower (c) == 'y');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'Z':
-         ASSERT (c_tolower (c) == 'z');
-         ASSERT (c_toupper (c) == c);
-         break;
-       case 'a':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'A');
-         break;
-       case 'b':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'B');
-         break;
-       case 'c':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'C');
-         break;
-       case 'd':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'D');
-         break;
-       case 'e':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'E');
-         break;
-       case 'f':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'F');
-         break;
-       case 'g':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'G');
-         break;
-       case 'h':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'H');
-         break;
-       case 'i':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'I');
-         break;
-       case 'j':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'J');
-         break;
-       case 'k':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'K');
-         break;
-       case 'l':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'L');
-         break;
-       case 'm':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'M');
-         break;
-       case 'n':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'N');
-         break;
-       case 'o':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'O');
-         break;
-       case 'p':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'P');
-         break;
-       case 'q':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'Q');
-         break;
-       case 'r':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'R');
-         break;
-       case 's':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'S');
-         break;
-       case 't':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'T');
-         break;
-       case 'u':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'U');
-         break;
-       case 'v':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'V');
-         break;
-       case 'w':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'W');
-         break;
-       case 'x':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'X');
-         break;
-       case 'y':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'Y');
-         break;
-       case 'z':
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == 'Z');
-         break;
-       default:
-         ASSERT (c_tolower (c) == c);
-         ASSERT (c_toupper (c) == c);
-         break;
-       }
+        {
+        case 'A':
+          ASSERT (c_tolower (c) == 'a');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'B':
+          ASSERT (c_tolower (c) == 'b');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'C':
+          ASSERT (c_tolower (c) == 'c');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'D':
+          ASSERT (c_tolower (c) == 'd');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'E':
+          ASSERT (c_tolower (c) == 'e');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'F':
+          ASSERT (c_tolower (c) == 'f');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'G':
+          ASSERT (c_tolower (c) == 'g');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'H':
+          ASSERT (c_tolower (c) == 'h');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'I':
+          ASSERT (c_tolower (c) == 'i');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'J':
+          ASSERT (c_tolower (c) == 'j');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'K':
+          ASSERT (c_tolower (c) == 'k');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'L':
+          ASSERT (c_tolower (c) == 'l');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'M':
+          ASSERT (c_tolower (c) == 'm');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'N':
+          ASSERT (c_tolower (c) == 'n');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'O':
+          ASSERT (c_tolower (c) == 'o');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'P':
+          ASSERT (c_tolower (c) == 'p');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'Q':
+          ASSERT (c_tolower (c) == 'q');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'R':
+          ASSERT (c_tolower (c) == 'r');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'S':
+          ASSERT (c_tolower (c) == 's');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'T':
+          ASSERT (c_tolower (c) == 't');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'U':
+          ASSERT (c_tolower (c) == 'u');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'V':
+          ASSERT (c_tolower (c) == 'v');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'W':
+          ASSERT (c_tolower (c) == 'w');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'X':
+          ASSERT (c_tolower (c) == 'x');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'Y':
+          ASSERT (c_tolower (c) == 'y');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'Z':
+          ASSERT (c_tolower (c) == 'z');
+          ASSERT (c_toupper (c) == c);
+          break;
+        case 'a':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'A');
+          break;
+        case 'b':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'B');
+          break;
+        case 'c':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'C');
+          break;
+        case 'd':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'D');
+          break;
+        case 'e':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'E');
+          break;
+        case 'f':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'F');
+          break;
+        case 'g':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'G');
+          break;
+        case 'h':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'H');
+          break;
+        case 'i':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'I');
+          break;
+        case 'j':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'J');
+          break;
+        case 'k':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'K');
+          break;
+        case 'l':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'L');
+          break;
+        case 'm':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'M');
+          break;
+        case 'n':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'N');
+          break;
+        case 'o':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'O');
+          break;
+        case 'p':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'P');
+          break;
+        case 'q':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'Q');
+          break;
+        case 'r':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'R');
+          break;
+        case 's':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'S');
+          break;
+        case 't':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'T');
+          break;
+        case 'u':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'U');
+          break;
+        case 'v':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'V');
+          break;
+        case 'w':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'W');
+          break;
+        case 'x':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'X');
+          break;
+        case 'y':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'Y');
+          break;
+        case 'z':
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == 'Z');
+          break;
+        default:
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == c);
+          break;
+        }
     }
 }
 
diff --git a/lib/gltests/test-c-strcasecmp.c b/lib/gltests/test-c-strcasecmp.c
index 16244b9..e0c2368 100644
--- a/lib/gltests/test-c-strcasecmp.c
+++ b/lib/gltests/test-c-strcasecmp.c
@@ -26,15 +26,15 @@
 #include <string.h>
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 int
@@ -44,7 +44,7 @@ main (int argc, char *argv[])
     {
       /* configure should already have checked that the locale is supported.  
*/
       if (setlocale (LC_ALL, "") == NULL)
-       return 1;
+        return 1;
     }
 
   ASSERT (c_strcasecmp ("paragraph", "Paragraph") == 0);
diff --git a/lib/gltests/test-c-strncasecmp.c b/lib/gltests/test-c-strncasecmp.c
index 7d6dbf5..fb5f220 100644
--- a/lib/gltests/test-c-strncasecmp.c
+++ b/lib/gltests/test-c-strncasecmp.c
@@ -26,15 +26,15 @@
 #include <string.h>
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 int
@@ -44,7 +44,7 @@ main (int argc, char *argv[])
     {
       /* configure should already have checked that the locale is supported.  
*/
       if (setlocale (LC_ALL, "") == NULL)
-       return 1;
+        return 1;
     }
 
   ASSERT (c_strncasecmp ("paragraph", "Paragraph", 1000000) == 0);
diff --git a/lib/gltests/test-iconv.c b/lib/gltests/test-iconv.c
index 8bac176..e7e5742 100644
--- a/lib/gltests/test-iconv.c
+++ b/lib/gltests/test-iconv.c
@@ -28,15 +28,15 @@
 #include <string.h>
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 int
@@ -61,8 +61,8 @@ main ()
     char *outptr = buf;
     size_t outbytesleft = sizeof (buf);
     size_t res = iconv (cd_88591_to_utf8,
-                       (ICONV_CONST char **) &inptr, &inbytesleft,
-                       &outptr, &outbytesleft);
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
     ASSERT (res == 0 && inbytesleft == 0);
     ASSERT (outptr == buf + strlen (expected));
     ASSERT (memcmp (buf, expected, strlen (expected)) == 0);
@@ -77,8 +77,8 @@ main ()
     char *outptr = buf;
     size_t outbytesleft = 1;
     size_t res = iconv (cd_88591_to_utf8,
-                       (ICONV_CONST char **) &inptr, &inbytesleft,
-                       &outptr, &outbytesleft);
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
     ASSERT (res == (size_t)(-1) && errno == E2BIG);
     ASSERT (inbytesleft == 1);
     ASSERT (outbytesleft == 1);
@@ -96,8 +96,8 @@ main ()
     char *outptr = buf;
     size_t outbytesleft = sizeof (buf);
     size_t res = iconv (cd_utf8_to_88591,
-                       (ICONV_CONST char **) &inptr, &inbytesleft,
-                       &outptr, &outbytesleft);
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
     ASSERT (res == 0 && inbytesleft == 0);
     ASSERT (outptr == buf + strlen (expected));
     ASSERT (memcmp (buf, expected, strlen (expected)) == 0);
@@ -112,17 +112,17 @@ main ()
     char *outptr = buf;
     size_t outbytesleft = sizeof (buf);
     size_t res = iconv (cd_utf8_to_88591,
-                       (ICONV_CONST char **) &inptr, &inbytesleft,
-                       &outptr, &outbytesleft);
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
     if (res == (size_t)(-1))
       {
         ASSERT (errno == EILSEQ);
-       ASSERT (inbytesleft == strlen (input) && outptr == buf);
+        ASSERT (inbytesleft == strlen (input) && outptr == buf);
       }
     else
       {
-       ASSERT (res == 1);
-       ASSERT (inbytesleft == 0);
+        ASSERT (res == 1);
+        ASSERT (inbytesleft == 0);
       }
   }
 
@@ -135,8 +135,8 @@ main ()
     char *outptr = buf;
     size_t outbytesleft = sizeof (buf);
     size_t res = iconv (cd_utf8_to_88591,
-                       (ICONV_CONST char **) &inptr, &inbytesleft,
-                       &outptr, &outbytesleft);
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
     ASSERT (res == (size_t)(-1) && errno == EINVAL);
     ASSERT (inbytesleft == 1 && outptr == buf);
   }
diff --git a/lib/gltests/test-striconv.c b/lib/gltests/test-striconv.c
index f39f142..0dc0449 100644
--- a/lib/gltests/test-striconv.c
+++ b/lib/gltests/test-striconv.c
@@ -30,15 +30,15 @@
 #include <string.h>
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 int
@@ -62,7 +62,7 @@ main ()
     char *result = NULL;
     size_t length = 0;
     int retval = mem_cd_iconv (input, strlen (input), cd_88591_to_utf8,
-                              &result, &length);
+                               &result, &length);
     ASSERT (retval == 0);
     ASSERT (length == strlen (expected));
     ASSERT (result != NULL && memcmp (result, expected, strlen (expected)) == 
0);
@@ -76,7 +76,7 @@ main ()
     char *result = NULL;
     size_t length = 0;
     int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591,
-                              &result, &length);
+                               &result, &length);
     ASSERT (retval == 0);
     ASSERT (length == strlen (expected));
     ASSERT (result != NULL && memcmp (result, expected, strlen (expected)) == 
0);
@@ -89,7 +89,7 @@ main ()
     char *result = NULL;
     size_t length = 0;
     int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591,
-                              &result, &length);
+                               &result, &length);
     ASSERT (retval == -1 && errno == EILSEQ);
     ASSERT (result == NULL);
   }
@@ -100,7 +100,7 @@ main ()
     char *result = NULL;
     size_t length = 0;
     int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591,
-                              &result, &length);
+                               &result, &length);
     ASSERT (retval == 0);
     ASSERT (length == 0);
     free (result);
diff --git a/lib/gltests/test-strverscmp.c b/lib/gltests/test-strverscmp.c
index a98695b..220f2d6 100644
--- a/lib/gltests/test-strverscmp.c
+++ b/lib/gltests/test-strverscmp.c
@@ -25,15 +25,15 @@
 #include <stdlib.h>
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 int
diff --git a/lib/gltests/verify.h b/lib/gltests/verify.h
index fac53f6..3fbb639 100644
--- a/lib/gltests/verify.h
+++ b/lib/gltests/verify.h
@@ -110,8 +110,8 @@
 
        #if 4 <= __GNUC__
        # define verify(R) \
-          extern int (* verify_function__ (void)) \
-                     [__builtin_constant_p (R) && (R) ? 1 : -1]
+           extern int (* verify_function__ (void)) \
+                      [__builtin_constant_p (R) && (R) ? 1 : -1]
        #endif
 
    * In C++, any struct definition inside sizeof is invalid.
diff --git a/maint.mk b/maint.mk
index 34d66e1..be061a6 100644
--- a/maint.mk
+++ b/maint.mk
@@ -63,6 +63,25 @@ my_distdir = $(PACKAGE)-$(VERSION)
 # Old releases are stored here.
 release_archive_dir ?= ../release
 
+# Override gnu_rel_host and url_dir_list in cfg.mk if these are not right.
+# Use alpha.gnu.org for alpha and beta releases.
+# Use ftp.gnu.org for stable releases.
+gnu_ftp_host-alpha = alpha.gnu.org
+gnu_ftp_host-beta = alpha.gnu.org
+gnu_ftp_host-stable = ftp.gnu.org
+gnu_rel_host ?= $(gnu_ftp_host-$(RELEASE_TYPE))
+
+ifeq ($(gnu_rel_host),ftp.gnu.org)
+url_dir_list ?= http://ftpmirror.gnu.org/$(PACKAGE)
+else
+url_dir_list ?= ftp://$(gnu_rel_host)/gnu/$(PACKAGE)
+endif
+
+# Override this in cfg.mk if you are using a different format in your
+# NEWS file.
+today = $(shell date +%Y-%m-%d)
+news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)'
+
 # Prevent programs like 'sort' from considering distinct strings to be equal.
 # Doing it here saves us from having to set LC_ALL elsewhere in this file.
 export LC_ALL = C
@@ -157,8 +176,17 @@ sc_prohibit_strcmp:
                1>&2; exit 1; } || :
 
 # Pass EXIT_*, not number, to usage, exit, and error (when exiting)
+# Convert all uses automatically, via these two commands:
+# git grep -l '\<exit *(1)' \
+#  | grep -vEf .x-sc_prohibit_magic_number_exit \
+#  | xargs --no-run-if-empty \
+#      perl -pi -e 's/(^|[^.])\b(exit ?)\(1\)/$1$2(EXIT_FAILURE)/'
+# git grep -l '\<exit *(0)' \
+#  | grep -vEf .x-sc_prohibit_magic_number_exit \
+#  | xargs --no-run-if-empty \
+#      perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/'
 sc_prohibit_magic_number_exit:
-       @re='\<(usage|exit) ?\([0-9]|\<error ?\([1-9][0-9]*,'           \
+       @re='(^|[^.])\<(usage|exit) ?\([0-9]|\<error ?\([1-9][0-9]*,'   \
        msg='use EXIT_* values rather than magic number'                \
          $(_prohibit_regexp)
 
@@ -545,13 +573,12 @@ sc_makefile_check:
            $$($(VC_LIST_EXCEPT) | grep -E '(^|/)Makefile\.am$$')       \
          && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
-news-date-check: NEWS
-       today=`date +%Y-%m-%d`;                                         \
-       if head $(srcdir)/NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
+news-check: NEWS
+       if head $(srcdir)/NEWS | grep -E $(news-check-regexp)           \
            >/dev/null; then                                            \
          :;                                                            \
        else                                                            \
-         echo "version or today's date is not in NEWS" 1>&2;           \
+         echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2;      \
          exit 1;                                                       \
        fi
 
@@ -655,17 +682,6 @@ vc-diff-check:
          rm vc-diffs;                                          \
        fi
 
-# Use this to make sure we don't run these programs when building
-# from a virgin tgz file, below.
-null_AM_MAKEFLAGS = \
-  ACLOCAL=false \
-  AUTOCONF=false \
-  AUTOMAKE=false \
-  AUTOHEADER=false \
-  MAKEINFO=false
-
-built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
-
 rel-files = $(DIST_ARCHIVES)
 
 gnulib_dir ?= $(srcdir)/gnulib
@@ -731,15 +747,24 @@ alpha beta stable: $(local-check) writable-files 
no-submodule-changes
               || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
          || :
        $(MAKE) vc-diff-check
-       $(MAKE) news-date-check
+       $(MAKE) news-check
        $(MAKE) distcheck
        $(MAKE) dist XZ_OPT=-9ev
-       $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
+       $(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
+       $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
+
+# Override this in cfg.mk if you follow different procedures.
+release-prep-hook ?= release-prep
+
+.PHONY: release-prep
+release-prep:
+       case $$RELEASE_TYPE in alpha|beta|stable) ;; \
+         *) echo "invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit 1;; esac
+       $(MAKE) -s announcement > /tmp/announce-$(my_distdir)
        if test -d $(release_archive_dir); then                 \
          ln $(rel-files) $(release_archive_dir);               \
          chmod a-w $(rel-files);                               \
        fi
-       $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
        echo $(VERSION) > $(prev_version_file)
        $(MAKE) update-NEWS-hash
        perl -pi -e '$$. == 3 and print "$(noteworthy)\n\n\n"' NEWS


hooks/post-receive
-- 
GNU libidn




reply via email to

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