guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 01/03: Update Gnulib to v0.1-1157-gb03f418.


From: Andy Wingo
Subject: [Guile-commits] 01/03: Update Gnulib to v0.1-1157-gb03f418.
Date: Wed, 15 Feb 2017 16:13:24 -0500 (EST)

wingo pushed a commit to branch master
in repository guile.

commit 7e641595cd9b45ce7339e21c20a8ab81af9278f6
Author: Andy Wingo <address@hidden>
Date:   Wed Feb 15 21:41:24 2017 +0100

    Update Gnulib to v0.1-1157-gb03f418.
---
 GNUmakefile                      |   2 +-
 build-aux/announce-gen           |   2 +-
 build-aux/config.rpath           |   2 +-
 build-aux/gendocs.sh             |   6 +-
 build-aux/git-version-gen        |   6 +-
 build-aux/gitlog-to-changelog    |   2 +-
 build-aux/gnu-web-doc-update     |   2 +-
 build-aux/gnupload               |   2 +-
 build-aux/snippet/arg-nonnull.h  |   2 +-
 build-aux/snippet/c++defs.h      |  89 +++--
 build-aux/snippet/warn-on-use.h  |   2 +-
 build-aux/useless-if-before-free |   7 +-
 build-aux/vc-list-files          |   2 +-
 doc/gendocs_template             |   2 +-
 doc/gendocs_template_min         |   2 +-
 lib/Makefile.am                  |  68 +++-
 lib/accept.c                     |   2 +-
 lib/alignof.h                    |   2 +-
 lib/alloca.in.h                  |   4 +-
 lib/arpa_inet.in.h               |   2 +-
 lib/asnprintf.c                  |   2 +-
 lib/assure.h                     |   2 +-
 lib/basename-lgpl.c              |   2 +-
 lib/binary-io.h                  |   2 +-
 lib/bind.c                       |   2 +-
 lib/btowc.c                      |   2 +-
 lib/byteswap.in.h                |   2 +-
 lib/c-ctype.h                    |  22 +-
 lib/c-strcase.h                  |   2 +-
 lib/c-strcasecmp.c               |   2 +-
 lib/c-strcaseeq.h                |   2 +-
 lib/c-strncasecmp.c              |   2 +-
 lib/canonicalize-lgpl.c          |  39 +-
 lib/ceil.c                       |   2 +-
 lib/close.c                      |   2 +-
 lib/config.charset               |   2 +-
 lib/connect.c                    |   2 +-
 lib/copysign.c                   |   2 +-
 lib/dirent.in.h                  |   2 +-
 lib/dirfd.c                      |   2 +-
 lib/dirname-lgpl.c               |   2 +-
 lib/dirname.h                    |   2 +-
 lib/dosname.h                    |   2 +-
 lib/dup2.c                       |   2 +-
 lib/duplocale.c                  |   2 +-
 lib/errno.in.h                   |   2 +-
 lib/fcntl.in.h                   |   2 +-
 lib/fd-hook.c                    |   2 +-
 lib/fd-hook.h                    |   2 +-
 lib/flexmember.h                 |  42 +++
 lib/float+.h                     |   2 +-
 lib/float.c                      |   2 +-
 lib/float.in.h                   |   2 +-
 lib/flock.c                      |   2 +-
 lib/floor.c                      |   2 +-
 lib/frexp.c                      |   2 +-
 lib/fstat.c                      |   2 +-
 lib/fsync.c                      |   2 +-
 lib/full-read.c                  |   2 +-
 lib/full-read.h                  |   2 +-
 lib/full-write.c                 |   2 +-
 lib/full-write.h                 |   2 +-
 lib/gai_strerror.c               |   2 +-
 lib/getaddrinfo.c                |   2 +-
 lib/getlogin.c                   |   2 +-
 lib/getpeername.c                |   2 +-
 lib/getsockname.c                |   2 +-
 lib/getsockopt.c                 |   2 +-
 lib/gettext.h                    |   2 +-
 lib/gettimeofday.c               |   2 +-
 lib/hard-locale.c                |   2 +-
 lib/hard-locale.h                |   2 +-
 lib/iconv.c                      |   2 +-
 lib/iconv.in.h                   |   2 +-
 lib/iconv_close.c                |   2 +-
 lib/iconv_open.c                 |   2 +-
 lib/iconveh.h                    |   2 +-
 lib/inet_ntop.c                  |   2 +-
 lib/inet_pton.c                  |   2 +-
 lib/intprops.h                   |  57 +--
 lib/isfinite.c                   |   2 +-
 lib/isinf.c                      |   2 +-
 lib/isnan.c                      |   2 +-
 lib/isnand-nolibm.h              |   2 +-
 lib/isnand.c                     |   2 +-
 lib/isnanf-nolibm.h              |   2 +-
 lib/isnanf.c                     |   2 +-
 lib/isnanl-nolibm.h              |   2 +-
 lib/isnanl.c                     |   2 +-
 lib/itold.c                      |   2 +-
 lib/langinfo.in.h                |   2 +-
 lib/limits.in.h                  |  63 ++++
 lib/link.c                       |   2 +-
 lib/listen.c                     |   2 +-
 lib/localcharset.c               |   4 +-
 lib/localcharset.h               |   2 +-
 lib/locale.in.h                  |   2 +-
 lib/localeconv.c                 |   2 +-
 lib/log.c                        |   2 +-
 lib/log1p.c                      |   2 +-
 lib/lstat.c                      |   2 +-
 lib/malloc.c                     |   2 +-
 lib/malloca.c                    |   2 +-
 lib/malloca.h                    |  15 +-
 lib/math.in.h                    | 201 ++++++++---
 lib/mbrtowc.c                    |   2 +-
 lib/mbsinit.c                    |   2 +-
 lib/mbtowc-impl.h                |   2 +-
 lib/mbtowc.c                     |   2 +-
 lib/memchr.c                     |   2 +-
 lib/mkdir.c                      |   2 +-
 lib/mkostemp.c                   |   2 +-
 lib/mktime-internal.h            |   2 +-
 lib/mktime.c                     |   4 +-
 lib/msvc-inval.c                 |   2 +-
 lib/msvc-inval.h                 |   2 +-
 lib/msvc-nothrow.c               |   2 +-
 lib/msvc-nothrow.h               |   2 +-
 lib/netdb.in.h                   |   2 +-
 lib/netinet_in.in.h              |   2 +-
 lib/nl_langinfo.c                |  39 +-
 lib/nproc.c                      |   2 +-
 lib/nproc.h                      |   2 +-
 lib/open.c                       |   2 +-
 lib/pathmax.h                    |   2 +-
 lib/pipe.c                       |   2 +-
 lib/pipe2.c                      |   2 +-
 lib/poll.c                       |   2 +-
 lib/poll.in.h                    |   2 +-
 lib/printf-args.c                |   2 +-
 lib/printf-args.h                |   2 +-
 lib/printf-parse.c               |   2 +-
 lib/printf-parse.h               |   2 +-
 lib/putenv.c                     |   2 +-
 lib/raise.c                      |   2 +-
 lib/read.c                       |   2 +-
 lib/readlink.c                   |   2 +-
 lib/recv.c                       |   2 +-
 lib/recvfrom.c                   |   2 +-
 lib/ref-add.sin                  |   2 +-
 lib/ref-del.sin                  |   2 +-
 lib/regcomp.c                    |   2 +-
 lib/regex.c                      |   2 +-
 lib/regex.h                      |   8 +-
 lib/regex_internal.c             |   2 +-
 lib/regex_internal.h             |  10 +-
 lib/regexec.c                    |   8 +-
 lib/rename.c                     |   2 +-
 lib/rmdir.c                      |   2 +-
 lib/round.c                      |   2 +-
 lib/safe-read.c                  |   2 +-
 lib/safe-read.h                  |   2 +-
 lib/safe-write.c                 |   2 +-
 lib/safe-write.h                 |   2 +-
 lib/same-inode.h                 |   8 +-
 lib/secure_getenv.c              |   2 +-
 lib/select.c                     |   2 +-
 lib/send.c                       |   2 +-
 lib/sendto.c                     |   2 +-
 lib/setenv.c                     |   2 +-
 lib/setsockopt.c                 |   2 +-
 lib/shutdown.c                   |   2 +-
 lib/signal.in.h                  |   2 +-
 lib/signbitd.c                   |   2 +-
 lib/signbitf.c                   |   2 +-
 lib/signbitl.c                   |   2 +-
 lib/size_max.h                   |   2 +-
 lib/snprintf.c                   |   2 +-
 lib/socket.c                     |   2 +-
 lib/sockets.c                    |   2 +-
 lib/sockets.h                    |   8 +-
 lib/stat-time.h                  |   4 +-
 lib/stat.c                       |   2 +-
 lib/stdalign.in.h                |   2 +-
 lib/stdbool.in.h                 |   2 +-
 lib/stddef.in.h                  |   2 +-
 lib/stdint.in.h                  | 758 +++++++++++++++++++++------------------
 lib/stdio.in.h                   |  22 +-
 lib/stdlib.in.h                  |  17 +-
 lib/strdup.c                     |   2 +-
 lib/streq.h                      |   2 +-
 lib/strftime.c                   | 174 +++++----
 lib/strftime.h                   |   2 +-
 lib/striconveh.c                 |   2 +-
 lib/striconveh.h                 |   2 +-
 lib/string.in.h                  |  18 +-
 lib/stripslash.c                 |   2 +-
 lib/sys_file.in.h                |   2 +-
 lib/sys_select.in.h              |   2 +-
 lib/sys_socket.in.h              |   7 +-
 lib/sys_stat.in.h                |   2 +-
 lib/sys_time.in.h                |   9 +-
 lib/sys_times.in.h               |   2 +-
 lib/sys_types.in.h               |   2 +-
 lib/sys_uio.in.h                 |   2 +-
 lib/tempname.c                   |   2 +-
 lib/tempname.h                   |   2 +-
 lib/time-internal.h              |   6 +-
 lib/time.in.h                    |   4 +-
 lib/time_r.c                     |   2 +-
 lib/time_rz.c                    |   5 +-
 lib/timegm.c                     |   2 +-
 lib/times.c                      |   2 +-
 lib/trunc.c                      |   2 +-
 lib/unistd.in.h                  |   8 +-
 lib/unsetenv.c                   |   2 +-
 lib/vasnprintf.c                 |   4 +-
 lib/vasnprintf.h                 |   2 +-
 lib/verify.h                     |   9 +-
 lib/vsnprintf.c                  |   2 +-
 lib/w32sock.h                    |   2 +-
 lib/wchar.in.h                   |   9 +-
 lib/wcrtomb.c                    |   2 +-
 lib/wctype.in.h                  |  23 +-
 lib/write.c                      |   2 +-
 lib/xalloc-oversized.h           |  60 ++++
 lib/xsize.h                      |   2 +-
 m4/00gnulib.m4                   |   2 +-
 m4/absolute-header.m4            |   2 +-
 m4/alloca.m4                     |   2 +-
 m4/arpa_inet_h.m4                |   2 +-
 m4/autobuild.m4                  |   2 +-
 m4/btowc.m4                      |   2 +-
 m4/builtin-expect.m4             |  49 +++
 m4/byteswap.m4                   |   2 +-
 m4/canonicalize.m4               |   2 +-
 m4/ceil.m4                       |   2 +-
 m4/check-math-lib.m4             |   2 +-
 m4/clock_time.m4                 |   2 +-
 m4/close.m4                      |   2 +-
 m4/configmake.m4                 |   2 +-
 m4/copysign.m4                   |   2 +-
 m4/dirent_h.m4                   |   2 +-
 m4/dirfd.m4                      |   2 +-
 m4/dirname.m4                    |   2 +-
 m4/double-slash-root.m4          |   2 +-
 m4/dup2.m4                       |   2 +-
 m4/duplocale.m4                  |   2 +-
 m4/eealloc.m4                    |   2 +-
 m4/environ.m4                    |   2 +-
 m4/errno_h.m4                    |   2 +-
 m4/exponentd.m4                  |   2 +-
 m4/exponentf.m4                  |   2 +-
 m4/exponentl.m4                  |   2 +-
 m4/extensions.m4                 |  46 ++-
 m4/extern-inline.m4              |   2 +-
 m4/fcntl-o.m4                    |   2 +-
 m4/fcntl_h.m4                    |   2 +-
 m4/flexmember.m4                 |  10 +-
 m4/float_h.m4                    |   2 +-
 m4/flock.m4                      |   2 +-
 m4/floor.m4                      |   2 +-
 m4/fpieee.m4                     |   2 +-
 m4/frexp.m4                      |   2 +-
 m4/fstat.m4                      |   2 +-
 m4/fsync.m4                      |   2 +-
 m4/func.m4                       |   2 +-
 m4/getaddrinfo.m4                |   6 +-
 m4/getlogin.m4                   |  22 +-
 m4/gettimeofday.m4               |   2 +-
 m4/glibc21.m4                    |   2 +-
 m4/gnulib-cache.m4               |   2 +-
 m4/gnulib-common.m4              |   2 +-
 m4/gnulib-comp.m4                |  29 +-
 m4/gnulib-tool.m4                |   2 +-
 m4/hard-locale.m4                |   2 +-
 m4/hostent.m4                    |   2 +-
 m4/iconv.m4                      |  24 +-
 m4/iconv_h.m4                    |   2 +-
 m4/iconv_open-utf.m4             |   2 +-
 m4/iconv_open.m4                 |   2 +-
 m4/include_next.m4               |   2 +-
 m4/inet_ntop.m4                  |   2 +-
 m4/inet_pton.m4                  |   2 +-
 m4/intmax_t.m4                   |   2 +-
 m4/inttypes_h.m4                 |   2 +-
 m4/isfinite.m4                   |   2 +-
 m4/isinf.m4                      |   2 +-
 m4/isnan.m4                      |   2 +-
 m4/isnand.m4                     |   2 +-
 m4/isnanf.m4                     |   2 +-
 m4/isnanl.m4                     |   2 +-
 m4/langinfo_h.m4                 |   2 +-
 m4/largefile.m4                  |   2 +-
 m4/ld-version-script.m4          |   2 +-
 m4/ldexp.m4                      |   2 +-
 m4/lib-ld.m4                     |   2 +-
 m4/lib-link.m4                   |   2 +-
 m4/lib-prefix.m4                 |   2 +-
 m4/libunistring.m4               |   2 +-
 m4/limits-h.m4                   |  31 ++
 m4/link.m4                       |   3 +-
 m4/localcharset.m4               |   2 +-
 m4/locale-fr.m4                  |   2 +-
 m4/locale-ja.m4                  |   2 +-
 m4/locale-zh.m4                  |   2 +-
 m4/locale_h.m4                   |   2 +-
 m4/localeconv.m4                 |   2 +-
 m4/log.m4                        |   2 +-
 m4/log1p.m4                      |   2 +-
 m4/longlong.m4                   |   2 +-
 m4/lstat.m4                      |   2 +-
 m4/malloc.m4                     |   2 +-
 m4/malloca.m4                    |   2 +-
 m4/math_h.m4                     |  16 +-
 m4/mathfunc.m4                   |   2 +-
 m4/mbrtowc.m4                    |  14 +-
 m4/mbsinit.m4                    |   2 +-
 m4/mbstate_t.m4                  |   2 +-
 m4/mbtowc.m4                     |   2 +-
 m4/memchr.m4                     |   2 +-
 m4/mkdir.m4                      |   2 +-
 m4/mkostemp.m4                   |   2 +-
 m4/mktime.m4                     |   2 +-
 m4/mmap-anon.m4                  |   2 +-
 m4/mode_t.m4                     |   2 +-
 m4/msvc-inval.m4                 |   2 +-
 m4/msvc-nothrow.m4               |   2 +-
 m4/multiarch.m4                  |   2 +-
 m4/netdb_h.m4                    |   2 +-
 m4/netinet_in_h.m4               |   2 +-
 m4/nl_langinfo.m4                |   2 +-
 m4/nocrash.m4                    |   2 +-
 m4/nproc.m4                      |   7 +-
 m4/off_t.m4                      |   2 +-
 m4/open.m4                       |   2 +-
 m4/pathmax.m4                    |   2 +-
 m4/pipe.m4                       |   2 +-
 m4/pipe2.m4                      |   2 +-
 m4/poll.m4                       |   2 +-
 m4/poll_h.m4                     |   2 +-
 m4/printf.m4                     |   4 +-
 m4/putenv.m4                     |   2 +-
 m4/raise.m4                      |   2 +-
 m4/read.m4                       |   2 +-
 m4/readlink.m4                   |   2 +-
 m4/regex.m4                      |   2 +-
 m4/rename.m4                     |   2 +-
 m4/rmdir.m4                      |   2 +-
 m4/round.m4                      |   2 +-
 m4/safe-read.m4                  |   2 +-
 m4/safe-write.m4                 |   2 +-
 m4/secure_getenv.m4              |   2 +-
 m4/select.m4                     |   2 +-
 m4/servent.m4                    |   2 +-
 m4/setenv.m4                     |   2 +-
 m4/signal_h.m4                   |   2 +-
 m4/signbit.m4                    |   2 +-
 m4/size_max.m4                   |   2 +-
 m4/snprintf.m4                   |  12 +-
 m4/socketlib.m4                  |   2 +-
 m4/sockets.m4                    |   2 +-
 m4/socklen.m4                    |   2 +-
 m4/sockpfaf.m4                   |   2 +-
 m4/ssize_t.m4                    |   2 +-
 m4/stat-time.m4                  |   2 +-
 m4/stat.m4                       |   2 +-
 m4/stdalign.m4                   |   2 +-
 m4/stdbool.m4                    |  30 +-
 m4/stddef_h.m4                   |   2 +-
 m4/stdint.m4                     |  66 +++-
 m4/stdint_h.m4                   |   2 +-
 m4/stdio_h.m4                    |  14 +-
 m4/stdlib_h.m4                   |   7 +-
 m4/strdup.m4                     |   2 +-
 m4/strftime.m4                   |   2 +-
 m4/string_h.m4                   |   2 +-
 m4/sys_file_h.m4                 |   2 +-
 m4/sys_select_h.m4               |   2 +-
 m4/sys_socket_h.m4               |   2 +-
 m4/sys_stat_h.m4                 |   2 +-
 m4/sys_time_h.m4                 |   2 +-
 m4/sys_times_h.m4                |   2 +-
 m4/sys_types_h.m4                |  29 +-
 m4/sys_uio_h.m4                  |   2 +-
 m4/tempname.m4                   |   2 +-
 m4/time_h.m4                     |   2 +-
 m4/time_r.m4                     |   2 +-
 m4/time_rz.m4                    |   2 +-
 m4/timegm.m4                     |   2 +-
 m4/times.m4                      |   2 +-
 m4/tm_gmtoff.m4                  |   2 +-
 m4/trunc.m4                      |   2 +-
 m4/unistd_h.m4                   |   5 +-
 m4/vasnprintf.m4                 |   2 +-
 m4/visibility.m4                 |   2 +-
 m4/vsnprintf.m4                  |  12 +-
 m4/warn-on-use.m4                |   2 +-
 m4/warnings.m4                   |   2 +-
 m4/wchar_h.m4                    |  16 +-
 m4/wchar_t.m4                    |   2 +-
 m4/wcrtomb.m4                    |   2 +-
 m4/wctype_h.m4                   |   2 +-
 m4/wint_t.m4                     |  36 +-
 m4/write.m4                      |   2 +-
 m4/xsize.m4                      |   2 +-
 maint.mk                         | 105 +++---
 397 files changed, 2004 insertions(+), 1104 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index a869da5..a2f8111 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -5,7 +5,7 @@
 # It is necessary if you want to build targets usually of interest
 # only to the maintainer.
 
-# Copyright (C) 2001, 2003, 2006-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2006-2017 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
diff --git a/build-aux/announce-gen b/build-aux/announce-gen
index b461174..e789b13 100755
--- a/build-aux/announce-gen
+++ b/build-aux/announce-gen
@@ -9,7 +9,7 @@ my $VERSION = '2016-01-12 23:09'; # UTC
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 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
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
index 98183ff..af3c415 100755
--- a/build-aux/config.rpath
+++ b/build-aux/config.rpath
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2016 Free Software Foundation, Inc.
+#   Copyright 1996-2017 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <address@hidden>, 1996
 #
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index fef6280..3b71b36 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,9 +2,9 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2016-05-20.09
+scriptversion=2016-12-31.18
 
-# Copyright 2003-2016 Free Software Foundation, Inc.
+# Copyright 2003-2017 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
@@ -72,7 +72,7 @@ texarg="-t @finalout"
 
 version="gendocs.sh $scriptversion
 
-Copyright 2016 Free Software Foundation, Inc.
+Copyright 2017 Free Software Foundation, Inc.
 There is NO warranty.  You may redistribute this software
 under the terms of the GNU General Public License.
 For more information about these matters, see the files named COPYING."
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 9e5e4fb..c1c18c0 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -1,8 +1,8 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2016-05-08.18; # UTC
+scriptversion=2017-01-09.19; # UTC
 
-# Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007-2017 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
@@ -206,7 +206,7 @@ v=`echo "$v" |sed "s/^$prefix//"`
 # string we're using came from git.  I.e., skip the test if it's "UNKNOWN"
 # or if it came from .tarball-version.
 if test "x$v_from_git" != x; then
-  # Don't declare a version "dirty" merely because a time stamp has changed.
+  # Don't declare a version "dirty" merely because a timestamp has changed.
   git update-index --refresh > /dev/null 2>&1
 
   dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 83bafdf..cf16425 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -9,7 +9,7 @@ my $VERSION = '2016-03-22 21:49'; # UTC
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2008-2017 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
diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update
index 271e693..a8ed609 100755
--- a/build-aux/gnu-web-doc-update
+++ b/build-aux/gnu-web-doc-update
@@ -4,7 +4,7 @@
 
 VERSION=2016-01-12.23; # UTC
 
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 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
diff --git a/build-aux/gnupload b/build-aux/gnupload
index 8d0299d..d4d95ee 100755
--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -3,7 +3,7 @@
 
 scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 2004-2016 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 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
diff --git a/build-aux/snippet/arg-nonnull.h b/build-aux/snippet/arg-nonnull.h
index 584649f..1e62cc8 100644
--- a/build-aux/snippet/arg-nonnull.h
+++ b/build-aux/snippet/arg-nonnull.h
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific arguments must not be NULL.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/build-aux/snippet/c++defs.h b/build-aux/snippet/c++defs.h
index 813f2e2..f03f359 100644
--- a/build-aux/snippet/c++defs.h
+++ b/build-aux/snippet/c++defs.h
@@ -1,5 +1,5 @@
 /* C++ compatible function declaration macros.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2017 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
@@ -17,6 +17,15 @@
 #ifndef _GL_CXXDEFS_H
 #define _GL_CXXDEFS_H
 
+/* Begin/end the GNULIB_NAMESPACE namespace.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
+# define _GL_END_NAMESPACE }
+#else
+# define _GL_BEGIN_NAMESPACE
+# define _GL_END_NAMESPACE
+#endif
+
 /* The three most frequent use cases of these macros are:
 
    * For providing a substitute for a function that is missing on some
@@ -111,14 +120,25 @@
    that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
    Example:
      _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
- */
+
+   Wrapping rpl_func in an object with an inline conversion operator
+   avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
+   actually used in the program.  */
 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
   _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
 #if defined __cplusplus && defined GNULIB_NAMESPACE
 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
     namespace GNULIB_NAMESPACE                                \
     {                                                         \
-      rettype (*const func) parameters = ::rpl_func;          \
+      static const struct _gl_ ## func ## _wrapper            \
+      {                                                       \
+        typedef rettype (*type) parameters;                   \
+                                                              \
+        inline operator type () const                         \
+        {                                                     \
+          return ::rpl_func;                                  \
+        }                                                     \
+      } func = {};                                            \
     }                                                         \
     _GL_EXTERN_C int _gl_cxxalias_dummy
 #else
@@ -135,8 +155,15 @@
 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
     namespace GNULIB_NAMESPACE                                     \
     {                                                              \
-      rettype (*const func) parameters =                           \
-        reinterpret_cast<rettype(*)parameters>(::rpl_func);        \
+      static const struct _gl_ ## func ## _wrapper                 \
+      {                                                            \
+        typedef rettype (*type) parameters;                        \
+                                                                   \
+        inline operator type () const                              \
+        {                                                          \
+          return reinterpret_cast<type>(::rpl_func);               \
+        }                                                          \
+      } func = {};                                                 \
     }                                                              \
     _GL_EXTERN_C int _gl_cxxalias_dummy
 #else
@@ -150,19 +177,24 @@
    is defined.
    Example:
      _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
- */
+
+   Wrapping func in an object with an inline conversion operator
+   avoids a reference to func unless GNULIB_NAMESPACE::func is
+   actually used in the program.  */
 #if defined __cplusplus && defined GNULIB_NAMESPACE
-  /* If we were to write
-       rettype (*const func) parameters = ::func;
-     like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
-     better (remove an indirection through a 'static' pointer variable),
-     but then the _GL_CXXALIASWARN macro below would cause a warning not only
-     for uses of ::func but also for uses of GNULIB_NAMESPACE::func.  */
-# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
-    namespace GNULIB_NAMESPACE                     \
-    {                                              \
-      static rettype (*func) parameters = ::func;  \
-    }                                              \
+# define _GL_CXXALIAS_SYS(func,rettype,parameters)            \
+    namespace GNULIB_NAMESPACE                                \
+    {                                                         \
+      static const struct _gl_ ## func ## _wrapper            \
+      {                                                       \
+        typedef rettype (*type) parameters;                   \
+                                                              \
+        inline operator type () const                         \
+        {                                                     \
+          return ::func;                                      \
+        }                                                     \
+      } func = {};                                            \
+    }                                                         \
     _GL_EXTERN_C int _gl_cxxalias_dummy
 #else
 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
@@ -178,8 +210,15 @@
 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
     namespace GNULIB_NAMESPACE                          \
     {                                                   \
-      static rettype (*func) parameters =               \
-        reinterpret_cast<rettype(*)parameters>(::func); \
+      static const struct _gl_ ## func ## _wrapper      \
+      {                                                 \
+        typedef rettype (*type) parameters;             \
+                                                        \
+        inline operator type () const                   \
+        {                                               \
+          return reinterpret_cast<type>(::func);        \
+        }                                               \
+      } func = {};                                      \
     }                                                   \
     _GL_EXTERN_C int _gl_cxxalias_dummy
 #else
@@ -202,9 +241,15 @@
 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
     namespace GNULIB_NAMESPACE                                                \
     {                                                                         \
-      static rettype (*func) parameters =                                     \
-        reinterpret_cast<rettype(*)parameters>(                               \
-          (rettype2(*)parameters2)(::func));                                  \
+      static const struct _gl_ ## func ## _wrapper                            \
+      {                                                                       \
+        typedef rettype (*type) parameters;                                   \
+                                                                              \
+        inline operator type () const                                         \
+        {                                                                     \
+          return reinterpret_cast<type>((rettype2 (*) parameters2)(::func));  \
+        }                                                                     \
+      } func = {};                                                            \
     }                                                                         \
     _GL_EXTERN_C int _gl_cxxalias_dummy
 #else
diff --git a/build-aux/snippet/warn-on-use.h b/build-aux/snippet/warn-on-use.h
index 2948b47..3c0eb57 100644
--- a/build-aux/snippet/warn-on-use.h
+++ b/build-aux/snippet/warn-on-use.h
@@ -1,5 +1,5 @@
 /* A C macro for emitting warnings if a function is used.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2017 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
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
index 1899b1f..4e3f3a2 100755
--- a/build-aux/useless-if-before-free
+++ b/build-aux/useless-if-before-free
@@ -4,13 +4,13 @@ eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"'
 # Detect instances of "if (p) free (p);".
 # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
 
-my $VERSION = '2016-01-12 23:13'; # UTC
+my $VERSION = '2016-08-01 17:47'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2008-2017 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
@@ -129,6 +129,9 @@ sub is_NULL ($)
           $err = EXIT_ERROR, next;
       while (defined (my $line = <FH>))
         {
+          # Skip non-matching lines early to save time
+          $line =~ /\bif\b/
+            or next;
           while ($line =~
               /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\)
               #  1          2                  3
diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files
index c5c420a..2d17eaf 100755
--- a/build-aux/vc-list-files
+++ b/build-aux/vc-list-files
@@ -4,7 +4,7 @@
 # Print a version string.
 scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 2006-2016 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 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
diff --git a/doc/gendocs_template b/doc/gendocs_template
index fea0ebc..178f6cb 100644
--- a/doc/gendocs_template
+++ b/doc/gendocs_template
@@ -77,7 +77,7 @@ the FSF.  Broken links and other corrections or suggestions 
can be sent
 to <a href="mailto:%%EMAIL%%";>&lt;%%EMAIL%%&gt;</a>.</p>
 </div>
 
-<p>Copyright &copy; 2016 Free Software Foundation, Inc.</p>
+<p>Copyright &copy; 2017 Free Software Foundation, Inc.</p>
 
 <p>This page is licensed under a <a rel="license"
 href="http://creativecommons.org/licenses/by-nd/3.0/us/";>Creative
diff --git a/doc/gendocs_template_min b/doc/gendocs_template_min
index 935c135..112fa3b 100644
--- a/doc/gendocs_template_min
+++ b/doc/gendocs_template_min
@@ -80,7 +80,7 @@ the FSF.  Broken links and other corrections or suggestions 
can be sent
 to <a href="mailto:%%EMAIL%%";>&lt;%%EMAIL%%&gt;</a>.</p>
 </div>
 
-<p>Copyright &copy; 2016 Free Software Foundation, Inc.</p>
+<p>Copyright &copy; 2017 Free Software Foundation, Inc.</p>
 
 <p>This page is licensed under a <a rel="license"
 href="http://creativecommons.org/licenses/by-nd/3.0/us/";>Creative
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 666dc00..5da186f 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -63,6 +63,7 @@ libgnu_la_LDFLAGS += $(ISNANL_LIBM)
 libgnu_la_LDFLAGS += $(LDEXP_LIBM)
 libgnu_la_LDFLAGS += $(LIBSOCKET)
 libgnu_la_LDFLAGS += $(LIB_CLOCK_GETTIME)
+libgnu_la_LDFLAGS += $(LIB_GETLOGIN)
 libgnu_la_LDFLAGS += $(LIB_POLL)
 libgnu_la_LDFLAGS += $(LIB_SELECT)
 libgnu_la_LDFLAGS += $(LOG1P_LIBM)
@@ -516,6 +517,15 @@ EXTRA_DIST += fd-hook.h
 
 ## end   gnulib module fd-hook
 
+## begin gnulib module flexmember
+
+if gl_GNULIB_ENABLED_flexmember
+
+endif
+EXTRA_DIST += flexmember.h
+
+## end   gnulib module flexmember
+
 ## begin gnulib module float
 
 BUILT_SOURCES += $(FLOAT_H)
@@ -960,6 +970,34 @@ EXTRA_DIST += libunistring.valgrind
 
 ## end   gnulib module libunistring
 
+## begin gnulib module limits-h
+
+BUILT_SOURCES += $(LIMITS_H)
+
+# We need the following in order to create <limits.h> when the system
+# doesn't have one that is compatible with GNU.
+if GL_GENERATE_LIMITS_H
+limits.h: limits.in.h $(top_builddir)/config.status
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
+             < $(srcdir)/limits.in.h; \
+       } > address@hidden && \
+       mv address@hidden $@
+else
+limits.h: $(top_builddir)/config.status
+       rm -f $@
+endif
+MOSTLYCLEANFILES += limits.h limits.h-t
+
+EXTRA_DIST += limits.in.h
+
+## end   gnulib module limits-h
+
 ## begin gnulib module link
 
 
@@ -1368,11 +1406,18 @@ math.h: math.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
              -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
          | \
-         sed -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \
+         sed -e 's|@''REPLACE_ACOSF''@|$(REPLACE_ACOSF)|g' \
+             -e 's|@''REPLACE_ASINF''@|$(REPLACE_ASINF)|g' \
+             -e 's|@''REPLACE_ATANF''@|$(REPLACE_ATANF)|g' \
+             -e 's|@''REPLACE_ATAN2F''@|$(REPLACE_ATAN2F)|g' \
+             -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \
              -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \
              -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
              -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
              -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
+             -e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \
+             -e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \
+             -e 's|@''REPLACE_EXPF''@|$(REPLACE_EXPF)|g' \
              -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
              -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
              -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \
@@ -1428,7 +1473,12 @@ math.h: math.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
              -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
              -e 
's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
+             -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \
+             -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \
+             -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \
              -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \
+             -e 's|@''REPLACE_TANF''@|$(REPLACE_TANF)|g' \
+             -e 's|@''REPLACE_TANHF''@|$(REPLACE_TANHF)|g' \
              -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \
              -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \
              -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
@@ -2172,6 +2222,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+             -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
              -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
              -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
              -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
@@ -2193,6 +2244,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status
              -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
              -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
              -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' 
\
              < $(srcdir)/stdint.in.h; \
        } > address@hidden && \
        mv address@hidden $@
@@ -2397,6 +2449,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) \
              -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
              -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
              -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+             -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \
              -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
              -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
              -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
@@ -3058,7 +3111,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
-             -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
              -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
@@ -3080,6 +3132,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
              -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
              -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' 
\
+             -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
              -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
              -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
@@ -3200,6 +3253,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
+             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' 
\
              -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
              -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
              -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
@@ -3333,6 +3387,7 @@ wctype.h: wctype.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(WARN_ON_USE_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' 
\
              -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
              -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
              -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
@@ -3367,6 +3422,13 @@ EXTRA_libgnu_la_SOURCES += write.c
 
 ## end   gnulib module write
 
+## begin gnulib module xalloc-oversized
+
+
+EXTRA_DIST += xalloc-oversized.h
+
+## end   gnulib module xalloc-oversized
+
 ## begin gnulib module xsize
 
 if gl_GNULIB_ENABLED_xsize
diff --git a/lib/accept.c b/lib/accept.c
index 694d13b..1aee71f 100644
--- a/lib/accept.c
+++ b/lib/accept.c
@@ -1,6 +1,6 @@
 /* accept.c --- wrappers for Windows accept function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/alignof.h b/lib/alignof.h
index 944e935..53583b8 100644
--- a/lib/alignof.h
+++ b/lib/alignof.h
@@ -1,5 +1,5 @@
 /* Determine alignment of types.
-   Copyright (C) 2003-2004, 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2004, 2006, 2009-2017 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
diff --git a/lib/alloca.in.h b/lib/alloca.in.h
index c50e0c9..f6d41db 100644
--- a/lib/alloca.in.h
+++ b/lib/alloca.in.h
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2016 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2017 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -51,6 +51,8 @@ extern "C"
 void *_alloca (unsigned short);
 #  pragma intrinsic (_alloca)
 #  define alloca _alloca
+# elif defined __MVS__
+#  include <stdlib.h>
 # else
 #  include <stddef.h>
 #  ifdef  __cplusplus
diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h
index f9d9e64..6efde0a 100644
--- a/lib/arpa_inet.in.h
+++ b/lib/arpa_inet.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <arpa/inet.h>.
 
-   Copyright (C) 2005-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2017 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
diff --git a/lib/asnprintf.c b/lib/asnprintf.c
index cd20a80..1e8819c 100644
--- a/lib/asnprintf.c
+++ b/lib/asnprintf.c
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009-2017 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
diff --git a/lib/assure.h b/lib/assure.h
index bb0cb45..cef2a73 100644
--- a/lib/assure.h
+++ b/lib/assure.h
@@ -1,6 +1,6 @@
 /* Run-time assert-like macros.
 
-   Copyright (C) 2014-2016 Free Software Foundation, Inc.
+   Copyright (C) 2014-2017 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
diff --git a/lib/basename-lgpl.c b/lib/basename-lgpl.c
index d91fbfa..0e6b0a1 100644
--- a/lib/basename-lgpl.c
+++ b/lib/basename-lgpl.c
@@ -1,6 +1,6 @@
 /* basename.c -- return the last element in a file name
 
-   Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2016 Free Software
+   Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/binary-io.h b/lib/binary-io.h
index ffdae02..9aeebb7 100644
--- a/lib/binary-io.h
+++ b/lib/binary-io.h
@@ -1,5 +1,5 @@
 /* Binary mode I/O.
-   Copyright (C) 2001, 2003, 2005, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2005, 2008-2017 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
diff --git a/lib/bind.c b/lib/bind.c
index 8111351..666e800 100644
--- a/lib/bind.c
+++ b/lib/bind.c
@@ -1,6 +1,6 @@
 /* bind.c --- wrappers for Windows bind function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/btowc.c b/lib/btowc.c
index f49bc9a..bfc694e 100644
--- a/lib/btowc.c
+++ b/lib/btowc.c
@@ -1,5 +1,5 @@
 /* Convert unibyte character to wide character.
-   Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/byteswap.in.h b/lib/byteswap.in.h
index c73e1a8..026f5fc 100644
--- a/lib/byteswap.in.h
+++ b/lib/byteswap.in.h
@@ -1,5 +1,5 @@
 /* byteswap.h - Byte swapping
-   Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc.
    Written by Oskar Liljeblad <address@hidden>, 2005.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/c-ctype.h b/lib/c-ctype.h
index 177e8c2..a789222 100644
--- a/lib/c-ctype.h
+++ b/lib/c-ctype.h
@@ -5,7 +5,7 @@
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
-   Copyright (C) 2000-2003, 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2006, 2008-2017 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
@@ -115,16 +115,16 @@ extern "C" {
 
 /* Cases for lowercase hex letters, and lowercase letters, all offset by N.  */
 
-#define _C_CTYPE_LOWER_A_THRU_F_N(n) \
-   case 'a' + (n): case 'b' + (n): case 'c' + (n): case 'd' + (n): \
-   case 'e' + (n): case 'f' + (n)
-#define _C_CTYPE_LOWER_N(n) \
-   _C_CTYPE_LOWER_A_THRU_F_N(n): \
-   case 'g' + (n): case 'h' + (n): case 'i' + (n): case 'j' + (n): \
-   case 'k' + (n): case 'l' + (n): case 'm' + (n): case 'n' + (n): \
-   case 'o' + (n): case 'p' + (n): case 'q' + (n): case 'r' + (n): \
-   case 's' + (n): case 't' + (n): case 'u' + (n): case 'v' + (n): \
-   case 'w' + (n): case 'x' + (n): case 'y' + (n): case 'z' + (n)
+#define _C_CTYPE_LOWER_A_THRU_F_N(N) \
+   case 'a' + (N): case 'b' + (N): case 'c' + (N): case 'd' + (N): \
+   case 'e' + (N): case 'f' + (N)
+#define _C_CTYPE_LOWER_N(N) \
+   _C_CTYPE_LOWER_A_THRU_F_N(N): \
+   case 'g' + (N): case 'h' + (N): case 'i' + (N): case 'j' + (N): \
+   case 'k' + (N): case 'l' + (N): case 'm' + (N): case 'n' + (N): \
+   case 'o' + (N): case 'p' + (N): case 'q' + (N): case 'r' + (N): \
+   case 's' + (N): case 't' + (N): case 'u' + (N): case 'v' + (N): \
+   case 'w' + (N): case 'x' + (N): case 'y' + (N): case 'z' + (N)
 
 /* Cases for hex letters, digits, lower, punct, and upper.  */
 
diff --git a/lib/c-strcase.h b/lib/c-strcase.h
index 5a5ef81..3f7d9b0 100644
--- a/lib/c-strcase.h
+++ b/lib/c-strcase.h
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison functions in C locale.
-   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2016 Free Software
+   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/c-strcasecmp.c b/lib/c-strcasecmp.c
index 1b3e574..6eba826 100644
--- a/lib/c-strcasecmp.c
+++ b/lib/c-strcasecmp.c
@@ -1,5 +1,5 @@
 /* c-strcasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2017 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
diff --git a/lib/c-strcaseeq.h b/lib/c-strcaseeq.h
index f9a5d86..7c303f5 100644
--- a/lib/c-strcaseeq.h
+++ b/lib/c-strcaseeq.h
@@ -1,5 +1,5 @@
 /* Optimized case-insensitive string comparison in C locale.
-   Copyright (C) 2001-2002, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2017 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
diff --git a/lib/c-strncasecmp.c b/lib/c-strncasecmp.c
index c6436e0..5431aaf 100644
--- a/lib/c-strncasecmp.c
+++ b/lib/c-strncasecmp.c
@@ -1,5 +1,5 @@
 /* c-strncasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2017 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
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index 23b9d6a..e570696 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -1,5 +1,5 @@
 /* Return the canonical absolute name of a given file.
-   Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   Copyright (C) 1996-2017 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
@@ -83,7 +83,23 @@
 # define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
 #endif
 
+/* Define this independently so that stdint.h is not a prerequisite.  */
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
+
 #if !FUNC_REALPATH_WORKS || defined _LIBC
+
+static void
+alloc_failed (void)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  /* Avoid errno problem without using the malloc or realloc modules; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00025.html  */
+  errno = ENOMEM;
+#endif
+}
+
 /* Return the canonical absolute name of file NAME.  A canonical name
    does not contain any ".", ".." components nor any repeated path
    separators ('/') or symlinks.  All path components must exist.  If
@@ -135,9 +151,7 @@ __realpath (const char *name, char *resolved)
       rpath = malloc (path_max);
       if (rpath == NULL)
         {
-          /* It's easier to set errno to ENOMEM than to rely on the
-             'malloc-posix' gnulib module.  */
-          errno = ENOMEM;
+          alloc_failed ();
           return NULL;
         }
     }
@@ -185,7 +199,6 @@ __realpath (const char *name, char *resolved)
 #else
       struct stat st;
 #endif
-      int n;
 
       /* Skip sequence of multiple path-separators.  */
       while (ISSLASH (*start))
@@ -238,9 +251,7 @@ __realpath (const char *name, char *resolved)
               new_rpath = (char *) realloc (rpath, new_size);
               if (new_rpath == NULL)
                 {
-                  /* It's easier to set errno to ENOMEM than to rely on the
-                     'realloc-posix' gnulib module.  */
-                  errno = ENOMEM;
+                  alloc_failed ();
                   goto error;
                 }
               rpath = new_rpath;
@@ -268,6 +279,7 @@ __realpath (const char *name, char *resolved)
             {
               char *buf;
               size_t len;
+              ssize_t n;
 
               if (++num_links > MAXSYMLINKS)
                 {
@@ -278,7 +290,7 @@ __realpath (const char *name, char *resolved)
               buf = malloca (path_max);
               if (!buf)
                 {
-                  errno = ENOMEM;
+                  __set_errno (ENOMEM);
                   goto error;
                 }
 
@@ -287,7 +299,7 @@ __realpath (const char *name, char *resolved)
                 {
                   int saved_errno = errno;
                   freea (buf);
-                  errno = saved_errno;
+                  __set_errno (saved_errno);
                   goto error;
                 }
               buf[n] = '\0';
@@ -298,13 +310,14 @@ __realpath (const char *name, char *resolved)
                   if (!extra_buf)
                     {
                       freea (buf);
-                      errno = ENOMEM;
+                      __set_errno (ENOMEM);
                       goto error;
                     }
                 }
 
               len = strlen (end);
-              if ((long int) (n + len) >= path_max)
+              /* Check that n + len + 1 doesn't overflow and is <= path_max. */
+              if (n >= SIZE_MAX - len || n + len >= path_max)
                 {
                   freea (buf);
                   __set_errno (ENAMETOOLONG);
@@ -370,7 +383,7 @@ error:
       freea (extra_buf);
     if (resolved == NULL)
       free (rpath);
-    errno = saved_errno;
+    __set_errno (saved_errno);
   }
   return NULL;
 }
diff --git a/lib/ceil.c b/lib/ceil.c
index ac96407..d253d48 100644
--- a/lib/ceil.c
+++ b/lib/ceil.c
@@ -1,5 +1,5 @@
 /* Round towards positive infinity.
-   Copyright (C) 2007, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2010-2017 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
diff --git a/lib/close.c b/lib/close.c
index 730d674..bb635c3 100644
--- a/lib/close.c
+++ b/lib/close.c
@@ -1,5 +1,5 @@
 /* close replacement.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/config.charset b/lib/config.charset
index 05773dd..83cf4ec 100644
--- a/lib/config.charset
+++ b/lib/config.charset
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Output a system dependent table of character encoding aliases.
 #
-#   Copyright (C) 2000-2004, 2006-2016 Free Software Foundation, Inc.
+#   Copyright (C) 2000-2004, 2006-2017 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
diff --git a/lib/connect.c b/lib/connect.c
index 1c7dddd..d3a2e12 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -1,6 +1,6 @@
 /* connect.c --- wrappers for Windows connect function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/copysign.c b/lib/copysign.c
index 5a172bf..a0d2b68 100644
--- a/lib/copysign.c
+++ b/lib/copysign.c
@@ -1,5 +1,5 @@
 /* Copy sign into another 'double' number.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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
diff --git a/lib/dirent.in.h b/lib/dirent.in.h
index ab872a7..e5a31e3 100644
--- a/lib/dirent.in.h
+++ b/lib/dirent.in.h
@@ -1,5 +1,5 @@
 /* A GNU-like <dirent.h>.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2017 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
diff --git a/lib/dirfd.c b/lib/dirfd.c
index 4e41830..2082bdb 100644
--- a/lib/dirfd.c
+++ b/lib/dirfd.c
@@ -1,6 +1,6 @@
 /* dirfd.c -- return the file descriptor associated with an open DIR*
 
-   Copyright (C) 2001, 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2006, 2008-2017 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
diff --git a/lib/dirname-lgpl.c b/lib/dirname-lgpl.c
index 6740f20..4fb9ba8 100644
--- a/lib/dirname-lgpl.c
+++ b/lib/dirname-lgpl.c
@@ -1,6 +1,6 @@
 /* dirname.c -- return all but the last element in a file name
 
-   Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2016 Free Software
+   Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/dirname.h b/lib/dirname.h
index d74ea71..99a3e9b 100644
--- a/lib/dirname.h
+++ b/lib/dirname.h
@@ -1,6 +1,6 @@
 /*  Take file names apart into directory and base names.
 
-    Copyright (C) 1998, 2001, 2003-2006, 2009-2016 Free Software Foundation,
+    Copyright (C) 1998, 2001, 2003-2006, 2009-2017 Free Software Foundation,
     Inc.
 
     This program is free software: you can redistribute it and/or modify
diff --git a/lib/dosname.h b/lib/dosname.h
index d451076..774623f 100644
--- a/lib/dosname.h
+++ b/lib/dosname.h
@@ -1,6 +1,6 @@
 /* File names on MS-DOS/Windows systems.
 
-   Copyright (C) 2000-2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2001, 2004-2006, 2009-2017 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
diff --git a/lib/dup2.c b/lib/dup2.c
index bb33eac..0871eda 100644
--- a/lib/dup2.c
+++ b/lib/dup2.c
@@ -1,6 +1,6 @@
 /* Duplicate an open file descriptor to a specified file descriptor.
 
-   Copyright (C) 1999, 2004-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2004-2007, 2009-2017 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
diff --git a/lib/duplocale.c b/lib/duplocale.c
index c9f9e49..eb7b8d3 100644
--- a/lib/duplocale.c
+++ b/lib/duplocale.c
@@ -1,5 +1,5 @@
 /* Duplicate a locale object.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/errno.in.h b/lib/errno.in.h
index 3e1b5b5..48c5d93 100644
--- a/lib/errno.in.h
+++ b/lib/errno.in.h
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index d4e34fe..dc8d734 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -1,6 +1,6 @@
 /* Like <fcntl.h>, but with non-working flags defined to 0.
 
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2017 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
diff --git a/lib/fd-hook.c b/lib/fd-hook.c
index 7404aaa..627863a 100644
--- a/lib/fd-hook.c
+++ b/lib/fd-hook.c
@@ -1,5 +1,5 @@
 /* Hook for making making file descriptor functions close(), ioctl() 
extensible.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2009.
 
    This program is free software: you can redistribute it and/or modify it
diff --git a/lib/fd-hook.h b/lib/fd-hook.h
index b56f132..246ca77 100644
--- a/lib/fd-hook.h
+++ b/lib/fd-hook.h
@@ -1,5 +1,5 @@
 /* Hook for making making file descriptor functions close(), ioctl() 
extensible.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/flexmember.h b/lib/flexmember.h
new file mode 100644
index 0000000..3ef4f98
--- /dev/null
+++ b/lib/flexmember.h
@@ -0,0 +1,42 @@
+/* Sizes of structs with flexible array members.
+
+   Copyright 2016-2017 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
+   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 Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+   Written by Paul Eggert.  */
+
+#include <stddef.h>
+
+/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below.
+   On older platforms without _Alignof, use a pessimistic bound that is
+   safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1.
+   On newer platforms, use _Alignof to get a tighter bound.  */
+
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1))
+#else
+# define FLEXALIGNOF(type) _Alignof (type)
+#endif
+
+/* Upper bound on the size of a struct of type TYPE with a flexible
+   array member named MEMBER that is followed by N bytes of other data.
+   This is not simply sizeof (TYPE) + N, since it may require
+   alignment on unusually picky C11 platforms, and
+   FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms.
+   Yield a value less than N if and only if arithmetic overflow occurs.  */
+
+#define FLEXSIZEOF(type, member, n) \
+   ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \
+    & ~ (FLEXALIGNOF (type) - 1))
diff --git a/lib/float+.h b/lib/float+.h
index 14b8120..41c3d57 100644
--- a/lib/float+.h
+++ b/lib/float+.h
@@ -1,5 +1,5 @@
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2007.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/float.c b/lib/float.c
index 1d1d54f..4856781 100644
--- a/lib/float.c
+++ b/lib/float.c
@@ -1,5 +1,5 @@
 /* Auxiliary definitions for <float.h>.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/float.in.h b/lib/float.in.h
index 20989c0..2b06253 100644
--- a/lib/float.in.h
+++ b/lib/float.in.h
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/flock.c b/lib/flock.c
index 53f7ae5..7698e43 100644
--- a/lib/flock.c
+++ b/lib/flock.c
@@ -6,7 +6,7 @@
 
    Written by Richard W.M. Jones <rjones.at.redhat.com>
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
diff --git a/lib/floor.c b/lib/floor.c
index 3225f40..5305fb3 100644
--- a/lib/floor.c
+++ b/lib/floor.c
@@ -1,5 +1,5 @@
 /* Round towards negative infinity.
-   Copyright (C) 2007, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2010-2017 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
diff --git a/lib/frexp.c b/lib/frexp.c
index a1a23aa..8bcf890 100644
--- a/lib/frexp.c
+++ b/lib/frexp.c
@@ -1,5 +1,5 @@
 /* Split a double into fraction and mantissa.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/fstat.c b/lib/fstat.c
index f93f60f..4832548 100644
--- a/lib/fstat.c
+++ b/lib/fstat.c
@@ -1,5 +1,5 @@
 /* fstat() replacement.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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
diff --git a/lib/fsync.c b/lib/fsync.c
index b107dfc..8304751 100644
--- a/lib/fsync.c
+++ b/lib/fsync.c
@@ -7,7 +7,7 @@
 
    Written by Richard W.M. Jones <rjones.at.redhat.com>
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
diff --git a/lib/full-read.c b/lib/full-read.c
index 0b1a8f3..97ac45f 100644
--- a/lib/full-read.c
+++ b/lib/full-read.c
@@ -1,5 +1,5 @@
 /* An interface to read that retries after partial reads and interrupts.
-   Copyright (C) 2002-2003, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2009-2017 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
diff --git a/lib/full-read.h b/lib/full-read.h
index dbf4cd6..d127763 100644
--- a/lib/full-read.h
+++ b/lib/full-read.h
@@ -1,6 +1,6 @@
 /* An interface to read() that reads all it is asked to read.
 
-   Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2017 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
diff --git a/lib/full-write.c b/lib/full-write.c
index 9419d70..75fd857 100644
--- a/lib/full-write.c
+++ b/lib/full-write.c
@@ -1,6 +1,6 @@
 /* An interface to read and write that retries (if necessary) until complete.
 
-   Copyright (C) 1993-1994, 1997-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 1997-2006, 2009-2017 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
diff --git a/lib/full-write.h b/lib/full-write.h
index 3715bec..0029249 100644
--- a/lib/full-write.h
+++ b/lib/full-write.h
@@ -1,6 +1,6 @@
 /* An interface to write() that writes all it is asked to write.
 
-   Copyright (C) 2002-2003, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2009-2017 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
diff --git a/lib/gai_strerror.c b/lib/gai_strerror.c
index 6acc859..20d5513 100644
--- a/lib/gai_strerror.c
+++ b/lib/gai_strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2016 Free Software
+/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2017 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <address@hidden>, 1997.
diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c
index 33d731f..361dbc2 100644
--- a/lib/getaddrinfo.c
+++ b/lib/getaddrinfo.c
@@ -1,5 +1,5 @@
 /* Get address information (partial implementation).
-   Copyright (C) 1997, 2001-2002, 2004-2016 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2001-2002, 2004-2017 Free Software Foundation, Inc.
    Contributed by Simon Josefsson <address@hidden>.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/getlogin.c b/lib/getlogin.c
index 27efb2b..47c586a 100644
--- a/lib/getlogin.c
+++ b/lib/getlogin.c
@@ -1,6 +1,6 @@
 /* Provide a working getlogin for systems which lack it.
 
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2017 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
diff --git a/lib/getpeername.c b/lib/getpeername.c
index a1d207d..e36e57b 100644
--- a/lib/getpeername.c
+++ b/lib/getpeername.c
@@ -1,6 +1,6 @@
 /* getpeername.c --- wrappers for Windows getpeername function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/getsockname.c b/lib/getsockname.c
index 3fc8089..08d0ead 100644
--- a/lib/getsockname.c
+++ b/lib/getsockname.c
@@ -1,6 +1,6 @@
 /* getsockname.c --- wrappers for Windows getsockname function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/getsockopt.c b/lib/getsockopt.c
index 6242dee..eabbd24 100644
--- a/lib/getsockopt.c
+++ b/lib/getsockopt.c
@@ -1,6 +1,6 @@
 /* getsockopt.c --- wrappers for Windows getsockopt function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/gettext.h b/lib/gettext.h
index a22c9fa..da14fdc 100644
--- a/lib/gettext.h
+++ b/lib/gettext.h
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2016 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
index 83c72d9..b4375fe 100644
--- a/lib/gettimeofday.c
+++ b/lib/gettimeofday.c
@@ -1,6 +1,6 @@
 /* Provide gettimeofday for systems that don't have it or for which it's 
broken.
 
-   Copyright (C) 2001-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2007, 2009-2017 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
diff --git a/lib/hard-locale.c b/lib/hard-locale.c
index 6addf45..845282d 100644
--- a/lib/hard-locale.c
+++ b/lib/hard-locale.c
@@ -1,6 +1,6 @@
 /* hard-locale.c -- Determine whether a locale is hard.
 
-   Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2016 Free Software
+   Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/hard-locale.h b/lib/hard-locale.h
index a4a4c06..b7cd5d1 100644
--- a/lib/hard-locale.h
+++ b/lib/hard-locale.h
@@ -1,6 +1,6 @@
 /* Determine whether a locale is hard.
 
-   Copyright (C) 1999, 2003-2004, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2003-2004, 2009-2017 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
diff --git a/lib/iconv.c b/lib/iconv.c
index 97e61bd..c0f1a83 100644
--- a/lib/iconv.c
+++ b/lib/iconv.c
@@ -1,5 +1,5 @@
 /* Character set conversion.
-   Copyright (C) 1999-2001, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2001, 2007, 2009-2017 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
diff --git a/lib/iconv.in.h b/lib/iconv.in.h
index eb55e2b..0864267 100644
--- a/lib/iconv.in.h
+++ b/lib/iconv.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <iconv.h>.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/iconv_close.c b/lib/iconv_close.c
index e15cde1..823cf45 100644
--- a/lib/iconv_close.c
+++ b/lib/iconv_close.c
@@ -1,5 +1,5 @@
 /* Character set conversion.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2017 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
diff --git a/lib/iconv_open.c b/lib/iconv_open.c
index 434fa95..48a28db 100644
--- a/lib/iconv_open.c
+++ b/lib/iconv_open.c
@@ -1,5 +1,5 @@
 /* Character set conversion.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2017 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
diff --git a/lib/iconveh.h b/lib/iconveh.h
index 1bac9a8..c074a8c 100644
--- a/lib/iconveh.h
+++ b/lib/iconveh.h
@@ -1,5 +1,5 @@
 /* Character set conversion handler type.
-   Copyright (C) 2001-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index 37d93f8..b30a266 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -1,6 +1,6 @@
 /* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
 
-   Copyright (C) 2005-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2017 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
diff --git a/lib/inet_pton.c b/lib/inet_pton.c
index fac8fd4..8e8b8c1 100644
--- a/lib/inet_pton.c
+++ b/lib/inet_pton.c
@@ -1,6 +1,6 @@
 /* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
 
-   Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2008-2017 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
diff --git a/lib/intprops.h b/lib/intprops.h
index feb02c3..eb06b69 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2017 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
@@ -47,12 +47,16 @@
 
 /* Minimum and maximum values for integer types and expressions.  */
 
+/* The width in bits of the integer type or expression T.
+   Padding bits are not supported; this is checked at compile-time below.  */
+#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
+
 /* The maximum and minimum values for the integer type T.  */
 #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
 #define TYPE_MAXIMUM(t)                                                 \
   ((t) (! TYPE_SIGNED (t)                                               \
         ? (t) -1                                                        \
-        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
 
 /* The maximum and minimum values for the type of the expression E,
    after integer promotion.  E should not have side effects.  */
@@ -65,7 +69,13 @@
    ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
    : _GL_INT_NEGATE_CONVERT (e, 1))
 #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
-  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
+  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
+
+/* Work around OpenVMS incompatibility with C99.  */
+#if !defined LLONG_MAX && defined __INT64_MAX
+# define LLONG_MAX __INT64_MAX
+# define LLONG_MIN __INT64_MIN
+#endif
 
 /* This include file assumes that signed types are two's complement without
    padding bits; the above macros have undefined behavior otherwise.
@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
 verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
 verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
 #endif
+/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined.  */
+#ifdef UINT_WIDTH
+verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
+#endif
 
 /* Does the __typeof__ keyword work?  This could be done by
    'configure', but for now it's easier to do it by hand.  */
-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+#if (2 <= __GNUC__ \
+     || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
      || (0x5110 <= __SUNPRO_C && !__STDC__))
 # define _GL_HAVE___TYPEOF__ 1
 #else
@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
    signed, this macro may overestimate the true bound by one byte when
    applied to unsigned types of size 2, 4, 16, ... bytes.  */
 #define INT_STRLEN_BOUND(t)                                     \
-  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
-                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
+  (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
    + _GL_SIGNED_TYPE_OR_EXPR (t))
 
 /* Bound on buffer size needed to represent an integer type or expression T,
@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
    ? (a) < (min) >> (b)                                 \
    : (max) >> (b) < (a))
 
-/* True if __builtin_add_overflow (A, B, P) works when P is null.  */
-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
+/* True if __builtin_add_overflow (A, B, P) works when P is non-null.  */
+#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
+
+/* True if __builtin_add_overflow_p (A, B, C) works.  */
+#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
 
 /* The _GL*_OVERFLOW macros have the same restrictions as the
    *_RANGE_OVERFLOW macros, except that they do not assume that operands
    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
    that the result (e.g., A + B) has that type.  */
-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
-# define _GL_ADD_OVERFLOW(a, b, min, max)
-   __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
-   __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
-   __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
+#if _GL_HAS_BUILTIN_OVERFLOW_P
+# define _GL_ADD_OVERFLOW(a, b, min, max)                               \
+   __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                          \
+   __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                          \
+   __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
 #else
 # define _GL_ADD_OVERFLOW(a, b, min, max)                                \
    ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
 #define INT_SUBTRACT_OVERFLOW(a, b) \
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+#if _GL_HAS_BUILTIN_OVERFLOW_P
 # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
 #else
 # define INT_NEGATE_OVERFLOW(a) \
@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
 #define INT_MULTIPLY_WRAPV(a, b, r) \
   _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
 
-#ifndef __has_builtin
-# define __has_builtin(x) 0
-#endif
-
 /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
    https://llvm.org/bugs/show_bug.cgi?id=25390
@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
    the operation.  BUILTIN is the builtin operation, and OVERFLOW the
    overflow predicate.  Return 1 if the result overflows.  See above
    for restrictions.  */
-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
+#if _GL_HAS_BUILTIN_OVERFLOW
 # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
 #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
 # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
 # else
 #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
     _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
-                     long int, LONG_MIN, LONG_MAX))
+                     long int, LONG_MIN, LONG_MAX)
 # endif
 #endif
 
diff --git a/lib/isfinite.c b/lib/isfinite.c
index 431518e..d689bb2 100644
--- a/lib/isfinite.c
+++ b/lib/isfinite.c
@@ -1,5 +1,5 @@
 /* Test for finite value (zero, subnormal, or normal, and not infinite or NaN).
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/isinf.c b/lib/isinf.c
index fa9565a..8dd72a3 100644
--- a/lib/isinf.c
+++ b/lib/isinf.c
@@ -1,5 +1,5 @@
 /* Test for positive or negative infinity.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/isnan.c b/lib/isnan.c
index e9a8614..519f3dc 100644
--- a/lib/isnan.c
+++ b/lib/isnan.c
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/isnand-nolibm.h b/lib/isnand-nolibm.h
index c30ae24..1b1c329 100644
--- a/lib/isnand-nolibm.h
+++ b/lib/isnand-nolibm.h
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/isnand.c b/lib/isnand.c
index 2e25f35..906faf1 100644
--- a/lib/isnand.c
+++ b/lib/isnand.c
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/isnanf-nolibm.h b/lib/isnanf-nolibm.h
index 8166b9b..9e55c6c 100644
--- a/lib/isnanf-nolibm.h
+++ b/lib/isnanf-nolibm.h
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/isnanf.c b/lib/isnanf.c
index 6c82c5e..2831654 100644
--- a/lib/isnanf.c
+++ b/lib/isnanf.c
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2017 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
diff --git a/lib/isnanl-nolibm.h b/lib/isnanl-nolibm.h
index 517547d..1667e55 100644
--- a/lib/isnanl-nolibm.h
+++ b/lib/isnanl-nolibm.h
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/isnanl.c b/lib/isnanl.c
index 77404b7..fe733bc 100644
--- a/lib/isnanl.c
+++ b/lib/isnanl.c
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2017 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
diff --git a/lib/itold.c b/lib/itold.c
index 57f5e95..facf4ae 100644
--- a/lib/itold.c
+++ b/lib/itold.c
@@ -1,5 +1,5 @@
 /* Replacement for 'int' to 'long double' conversion routine.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/langinfo.in.h b/lib/langinfo.in.h
index 42c7cef..689e82c 100644
--- a/lib/langinfo.in.h
+++ b/lib/langinfo.in.h
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <langinfo.h>.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/limits.in.h b/lib/limits.in.h
new file mode 100644
index 0000000..7ff33ab
--- /dev/null
+++ b/lib/limits.in.h
@@ -0,0 +1,63 @@
+/* A GNU-like <limits.h>.
+
+   Copyright 2016-2017 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 the Free Software Foundation; either version 2, 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 Lesser General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef address@hidden@_LIMITS_H
+
+#if __GNUC__ >= 3
address@hidden@
+#endif
address@hidden@
+
+/* The include_next requires a split double-inclusion guard.  */
address@hidden@ @NEXT_LIMITS_H@
+
+#ifndef address@hidden@_LIMITS_H
+#define address@hidden@_LIMITS_H
+
+/* The number of usable bits in an unsigned or signed integer type
+   with minimum value MIN and maximum value MAX, as an int expression
+   suitable in #if.  Cover all known practical hosts.  This
+   implementation exploits the fact that MAX is 1 less than a power of
+   2, and merely counts the number of 1 bits in MAX; "COBn" means
+   "count the number of 1 bits in the low-order n bits").  */
+#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
+#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
+#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
+#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
+#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
+#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
+#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
+
+/* Macros specified by ISO/IEC TS 18661-1:2014.  */
+
+#if (! defined ULLONG_WIDTH                                             \
+     && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
+# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
+# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
+# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
+# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
+# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
+# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
+# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
+# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
+# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
+# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
+# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
+#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
+
+#endif /* address@hidden@_LIMITS_H */
+#endif /* address@hidden@_LIMITS_H */
diff --git a/lib/link.c b/lib/link.c
index 9cd840c..625d2e8 100644
--- a/lib/link.c
+++ b/lib/link.c
@@ -1,6 +1,6 @@
 /* Emulate link on platforms that lack it, namely native Windows platforms.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/listen.c b/lib/listen.c
index 014e82f..284415a 100644
--- a/lib/listen.c
+++ b/lib/listen.c
@@ -1,6 +1,6 @@
 /* listen.c --- wrappers for Windows listen function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/localcharset.c b/lib/localcharset.c
index 7ce17e6..4be72d6 100644
--- a/lib/localcharset.c
+++ b/lib/localcharset.c
@@ -1,6 +1,6 @@
 /* Determine a canonical name for the current locale's character encoding.
 
-   Copyright (C) 2000-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2017 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
@@ -507,7 +507,7 @@ locale_charset (void)
     current_locale = setlocale (LC_CTYPE, NULL);
 
   pdot = strrchr (current_locale, '.');
-  if (pdot)
+  if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf))
     sprintf (buf, "CP%s", pdot + 1);
   else
     {
diff --git a/lib/localcharset.h b/lib/localcharset.h
index 49de10a..641ecea 100644
--- a/lib/localcharset.h
+++ b/lib/localcharset.h
@@ -1,5 +1,5 @@
 /* Determine a canonical name for the current locale's character encoding.
-   Copyright (C) 2000-2003, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2009-2017 Free Software Foundation, Inc.
    This file is part of the GNU CHARSET Library.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/locale.in.h b/lib/locale.in.h
index f7b19ca..50ccae6 100644
--- a/lib/locale.in.h
+++ b/lib/locale.in.h
@@ -1,5 +1,5 @@
 /* A POSIX <locale.h>.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/localeconv.c b/lib/localeconv.c
index 609dbb6..c38035f 100644
--- a/lib/localeconv.c
+++ b/lib/localeconv.c
@@ -1,5 +1,5 @@
 /* Query locale dependent information for formatting numbers.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2017 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
diff --git a/lib/log.c b/lib/log.c
index 547201f..2ec8cb9 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -1,5 +1,5 @@
 /* Logarithm.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2017 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
diff --git a/lib/log1p.c b/lib/log1p.c
index bc4127b..d266290 100644
--- a/lib/log1p.c
+++ b/lib/log1p.c
@@ -1,5 +1,5 @@
 /* Natural logarithm of 1 plus argument.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2017 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
diff --git a/lib/lstat.c b/lib/lstat.c
index 0a01416..f4cdb2a 100644
--- a/lib/lstat.c
+++ b/lib/lstat.c
@@ -1,6 +1,6 @@
 /* Work around a bug of lstat on some systems
 
-   Copyright (C) 1997-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 1997-2006, 2008-2017 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
diff --git a/lib/malloc.c b/lib/malloc.c
index ea63740..6b5e53e 100644
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -1,6 +1,6 @@
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997-1998, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2017 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
diff --git a/lib/malloca.c b/lib/malloca.c
index 942c60f..c0ff335 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2003.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/malloca.h b/lib/malloca.h
index 90fc3a6..3b61ca2 100644
--- a/lib/malloca.h
+++ b/lib/malloca.h
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2003.
 
    This program is free software; you can redistribute it and/or modify
@@ -21,6 +21,9 @@
 #include <alloca.h>
 #include <stddef.h>
 #include <stdlib.h>
+#include <stdint.h>
+
+#include "xalloc-oversized.h"
 
 
 #ifdef __cplusplus
@@ -73,15 +76,7 @@ extern void freea (void *p);
    It allocates an array of N objects, each with S bytes of memory,
    on the stack.  S must be positive and N must be nonnegative.
    The array must be freed using freea() before the function returns.  */
-#if 1
-/* Cf. the definition of xalloc_oversized.  */
-# define nmalloca(n, s) \
-    ((n) > (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) \
-     ? NULL \
-     : malloca ((n) * (s)))
-#else
-extern void * nmalloca (size_t n, size_t s);
-#endif
+#define nmalloca(n, s) (xalloc_oversized (n, s) ? NULL : malloca ((n) * (s)))
 
 
 #ifdef __cplusplus
diff --git a/lib/math.in.h b/lib/math.in.h
index b3832c1..53d385e 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <math.h>.
 
-   Copyright (C) 2002-2003, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2007-2017 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
@@ -63,6 +63,7 @@ _gl_cxx_ ## func ## l (long double l)                         
      \
   return func (l);                                                  \
 }
 # define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func) \
+_GL_BEGIN_NAMESPACE                                                 \
 inline int                                                          \
 func (float f)                                                      \
 {                                                                   \
@@ -77,7 +78,8 @@ inline int                                                    
      \
 func (long double l)                                                \
 {                                                                   \
   return _gl_cxx_ ## func ## l (l);                                 \
-}
+}                                                                   \
+_GL_END_NAMESPACE
 #endif
 
 /* Helper macros to define a portability warning for the
@@ -210,11 +212,20 @@ _NaN ()
 
 
 #if @GNULIB_ACOSF@
-# if address@hidden@
-#  undef acosf
+# if @REPLACE_ACOSF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef acosf
+#   define acosf rpl_acosf
+#  endif
+_GL_FUNCDECL_RPL (acosf, float, (float x));
+_GL_CXXALIAS_RPL (acosf, float, (float x));
+# else
+#  if address@hidden@
+#   undef acosf
 _GL_FUNCDECL_SYS (acosf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (acosf, float, (float x));
+# endif
 _GL_CXXALIASWARN (acosf);
 #elif defined GNULIB_POSIXCHECK
 # undef acosf
@@ -241,11 +252,20 @@ _GL_WARN_ON_USE (acosl, "acosl is unportable - "
 
 
 #if @GNULIB_ASINF@
-# if address@hidden@
-#  undef asinf
+# if @REPLACE_ASINF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef asinf
+#   define asinf rpl_asinf
+#  endif
+_GL_FUNCDECL_RPL (asinf, float, (float x));
+_GL_CXXALIAS_RPL (asinf, float, (float x));
+# else
+#  if address@hidden@
+#   undef asinf
 _GL_FUNCDECL_SYS (asinf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (asinf, float, (float x));
+# endif
 _GL_CXXALIASWARN (asinf);
 #elif defined GNULIB_POSIXCHECK
 # undef asinf
@@ -272,11 +292,20 @@ _GL_WARN_ON_USE (asinl, "asinl is unportable - "
 
 
 #if @GNULIB_ATANF@
-# if address@hidden@
-#  undef atanf
+# if @REPLACE_ATANF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef atanf
+#   define atanf rpl_atanf
+#  endif
+_GL_FUNCDECL_RPL (atanf, float, (float x));
+_GL_CXXALIAS_RPL (atanf, float, (float x));
+# else
+#  if address@hidden@
+#   undef atanf
 _GL_FUNCDECL_SYS (atanf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (atanf, float, (float x));
+# endif
 _GL_CXXALIASWARN (atanf);
 #elif defined GNULIB_POSIXCHECK
 # undef atanf
@@ -303,11 +332,20 @@ _GL_WARN_ON_USE (atanl, "atanl is unportable - "
 
 
 #if @GNULIB_ATAN2F@
-# if address@hidden@
-#  undef atan2f
+# if @REPLACE_ATAN2F@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef atan2f
+#   define atan2f rpl_atan2f
+#  endif
+_GL_FUNCDECL_RPL (atan2f, float, (float y, float x));
+_GL_CXXALIAS_RPL (atan2f, float, (float y, float x));
+# else
+#  if address@hidden@
+#   undef atan2f
 _GL_FUNCDECL_SYS (atan2f, float, (float y, float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (atan2f, float, (float y, float x));
+# endif
 _GL_CXXALIASWARN (atan2f);
 #elif defined GNULIB_POSIXCHECK
 # undef atan2f
@@ -406,6 +444,7 @@ _GL_WARN_ON_USE (ceilf, "ceilf is unportable - "
 #if @GNULIB_CEIL@
 # if @REPLACE_CEIL@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ceil
 #   define ceil rpl_ceil
 #  endif
 _GL_FUNCDECL_RPL (ceil, double, (double x));
@@ -485,11 +524,20 @@ _GL_WARN_ON_USE (copysign, "copysignl is unportable - "
 
 
 #if @GNULIB_COSF@
-# if address@hidden@
-#  undef cosf
+# if @REPLACE_COSF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef cosf
+#   define cosf rpl_cosf
+#  endif
+_GL_FUNCDECL_RPL (cosf, float, (float x));
+_GL_CXXALIAS_RPL (cosf, float, (float x));
+# else
+#  if address@hidden@
+#   undef cosf
 _GL_FUNCDECL_SYS (cosf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (cosf, float, (float x));
+# endif
 _GL_CXXALIASWARN (cosf);
 #elif defined GNULIB_POSIXCHECK
 # undef cosf
@@ -516,11 +564,20 @@ _GL_WARN_ON_USE (cosl, "cosl is unportable - "
 
 
 #if @GNULIB_COSHF@
-# if address@hidden@
-#  undef coshf
+# if @REPLACE_COSHF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef coshf
+#   define coshf rpl_coshf
+#  endif
+_GL_FUNCDECL_RPL (coshf, float, (float x));
+_GL_CXXALIAS_RPL (coshf, float, (float x));
+# else
+#  if address@hidden@
+#   undef coshf
 _GL_FUNCDECL_SYS (coshf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (coshf, float, (float x));
+# endif
 _GL_CXXALIASWARN (coshf);
 #elif defined GNULIB_POSIXCHECK
 # undef coshf
@@ -532,11 +589,20 @@ _GL_WARN_ON_USE (coshf, "coshf is unportable - "
 
 
 #if @GNULIB_EXPF@
-# if address@hidden@
-#  undef expf
+# if @REPLACE_EXPF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef expf
+#   define expf rpl_expf
+#  endif
+_GL_FUNCDECL_RPL (expf, float, (float x));
+_GL_CXXALIAS_RPL (expf, float, (float x));
+# else
+#  if address@hidden@
+#   undef expf
 _GL_FUNCDECL_SYS (expf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (expf, float, (float x));
+# endif
 _GL_CXXALIASWARN (expf);
 #elif defined GNULIB_POSIXCHECK
 # undef expf
@@ -753,6 +819,7 @@ _GL_WARN_ON_USE (floorf, "floorf is unportable - "
 #if @GNULIB_FLOOR@
 # if @REPLACE_FLOOR@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef floor
 #   define floor rpl_floor
 #  endif
 _GL_FUNCDECL_RPL (floor, double, (double x));
@@ -973,6 +1040,7 @@ _GL_WARN_ON_USE (frexpf, "frexpf is unportable - "
 #if @GNULIB_FREXP@
 # if @REPLACE_FREXP@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef frexp
 #   define frexp rpl_frexp
 #  endif
 _GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL 
((2)));
@@ -980,7 +1048,7 @@ _GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
 # else
 _GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
 # endif
-_GL_CXXALIASWARN (frexp);
+_GL_CXXALIASWARN1 (frexp, double, (double x, int *expptr));
 #elif defined GNULIB_POSIXCHECK
 # undef frexp
 /* Assume frexp is always declared.  */
@@ -1822,11 +1890,20 @@ _GL_WARN_ON_USE (roundl, "roundl is unportable - "
 
 
 #if @GNULIB_SINF@
-# if address@hidden@
-#  undef sinf
+# if @REPLACE_SINF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef sinf
+#   define sinf rpl_sinf
+#  endif
+_GL_FUNCDECL_RPL (sinf, float, (float x));
+_GL_CXXALIAS_RPL (sinf, float, (float x));
+# else
+#  if address@hidden@
+ #  undef sinf
 _GL_FUNCDECL_SYS (sinf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (sinf, float, (float x));
+# endif
 _GL_CXXALIASWARN (sinf);
 #elif defined GNULIB_POSIXCHECK
 # undef sinf
@@ -1853,11 +1930,20 @@ _GL_WARN_ON_USE (sinl, "sinl is unportable - "
 
 
 #if @GNULIB_SINHF@
-# if address@hidden@
-#  undef sinhf
+# if @REPLACE_SINHF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef sinhf
+#   define sinhf rpl_sinhf
+#  endif
+_GL_FUNCDECL_RPL (sinhf, float, (float x));
+_GL_CXXALIAS_RPL (sinhf, float, (float x));
+# else
+#  if address@hidden@
+#   undef sinhf
 _GL_FUNCDECL_SYS (sinhf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (sinhf, float, (float x));
+# endif
 _GL_CXXALIASWARN (sinhf);
 #elif defined GNULIB_POSIXCHECK
 # undef sinhf
@@ -1869,11 +1955,20 @@ _GL_WARN_ON_USE (sinhf, "sinhf is unportable - "
 
 
 #if @GNULIB_SQRTF@
-# if address@hidden@
-#  undef sqrtf
+# if @REPLACE_SQRTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef sqrtf
+#   define sqrtf rpl_sqrtf
+#  endif
+_GL_FUNCDECL_RPL (sqrtf, float, (float x));
+_GL_CXXALIAS_RPL (sqrtf, float, (float x));
+# else
+#  if address@hidden@
+#   undef sqrtf
 _GL_FUNCDECL_SYS (sqrtf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (sqrtf, float, (float x));
+# endif
 _GL_CXXALIASWARN (sqrtf);
 #elif defined GNULIB_POSIXCHECK
 # undef sqrtf
@@ -1909,11 +2004,20 @@ _GL_WARN_ON_USE (sqrtl, "sqrtl is unportable - "
 
 
 #if @GNULIB_TANF@
-# if address@hidden@
-#  undef tanf
+# if @REPLACE_TANF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef tanf
+#   define tanf rpl_tanf
+#  endif
+_GL_FUNCDECL_RPL (tanf, float, (float x));
+_GL_CXXALIAS_RPL (tanf, float, (float x));
+# else
+#  if address@hidden@
+#   undef tanf
 _GL_FUNCDECL_SYS (tanf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (tanf, float, (float x));
+# endif
 _GL_CXXALIASWARN (tanf);
 #elif defined GNULIB_POSIXCHECK
 # undef tanf
@@ -1940,11 +2044,20 @@ _GL_WARN_ON_USE (tanl, "tanl is unportable - "
 
 
 #if @GNULIB_TANHF@
-# if address@hidden@
-#  undef tanhf
+# if @REPLACE_TANHF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef tanhf
+#   define tanhf rpl_tanhf
+#  endif
+_GL_FUNCDECL_RPL (tanhf, float, (float x));
+_GL_CXXALIAS_RPL (tanhf, float, (float x));
+# else
+#  if address@hidden@
+#   undef tanhf
 _GL_FUNCDECL_SYS (tanhf, float, (float x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (tanhf, float, (float x));
+# endif
 _GL_CXXALIASWARN (tanhf);
 #elif defined GNULIB_POSIXCHECK
 # undef tanhf
@@ -1958,6 +2071,7 @@ _GL_WARN_ON_USE (tanhf, "tanhf is unportable - "
 #if @GNULIB_TRUNCF@
 # if @REPLACE_TRUNCF@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef truncf
 #   define truncf rpl_truncf
 #  endif
 _GL_FUNCDECL_RPL (truncf, float, (float x));
@@ -1980,6 +2094,7 @@ _GL_WARN_ON_USE (truncf, "truncf is unportable - "
 #if @GNULIB_TRUNC@
 # if @REPLACE_TRUNC@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef trunc
 #   define trunc rpl_trunc
 #  endif
 _GL_FUNCDECL_RPL (trunc, double, (double x));
@@ -2039,7 +2154,7 @@ _GL_EXTERN_C int gl_isfinitel (long double x);
     gl_isfinitef (x))
 # endif
 # ifdef __cplusplus
-#  ifdef isfinite
+#  if defined isfinite || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
 #   undef isfinite
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite)
@@ -2066,7 +2181,7 @@ _GL_EXTERN_C int gl_isinfl (long double x);
     gl_isinff (x))
 # endif
 # ifdef __cplusplus
-#  ifdef isinf
+#  if defined isinf || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf)
 #   undef isinf
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf)
@@ -2184,7 +2299,7 @@ _GL_EXTERN_C int rpl_isnanl (long double x) 
_GL_ATTRIBUTE_CONST;
     __builtin_isnanf ((float)(x)))
 # endif
 # ifdef __cplusplus
-#  ifdef isnan
+#  if defined isnan || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
 #   undef isnan
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan)
@@ -2259,7 +2374,7 @@ _GL_EXTERN_C int gl_signbitl (long double arg);
     gl_signbitf (x))
 # endif
 # ifdef __cplusplus
-#  ifdef signbit
+#  if defined signbit || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit)
 #   undef signbit
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
diff --git a/lib/mbrtowc.c b/lib/mbrtowc.c
index 2e5a0b6..d19b1a0 100644
--- a/lib/mbrtowc.c
+++ b/lib/mbrtowc.c
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 1999-2002, 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2005-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/mbsinit.c b/lib/mbsinit.c
index 54ecc9e..4d0b118 100644
--- a/lib/mbsinit.c
+++ b/lib/mbsinit.c
@@ -1,5 +1,5 @@
 /* Test for initial conversion state.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/mbtowc-impl.h b/lib/mbtowc-impl.h
index 1566934..268f0e3 100644
--- a/lib/mbtowc-impl.h
+++ b/lib/mbtowc-impl.h
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/mbtowc.c b/lib/mbtowc.c
index 253fd22..fbed5dc 100644
--- a/lib/mbtowc.c
+++ b/lib/mbtowc.c
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/memchr.c b/lib/memchr.c
index f866c95..91c2b87 100644
--- a/lib/memchr.c
+++ b/lib/memchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2016
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2017
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (address@hidden),
diff --git a/lib/mkdir.c b/lib/mkdir.c
index 8a18545..1ac7650 100644
--- a/lib/mkdir.c
+++ b/lib/mkdir.c
@@ -1,7 +1,7 @@
 /* On some systems, mkdir ("foo/", 0700) fails because of the trailing
    slash.  On those systems, this wrapper removes the trailing slash.
 
-   Copyright (C) 2001, 2003, 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2006, 2008-2017 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
diff --git a/lib/mkostemp.c b/lib/mkostemp.c
index 25a63b7..d2190bd 100644
--- a/lib/mkostemp.c
+++ b/lib/mkostemp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2016 Free Software
+/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2017 Free Software
    Foundation, Inc.
    This file is derived from the one in the GNU C Library.
 
diff --git a/lib/mktime-internal.h b/lib/mktime-internal.h
index 0c9e204..bfde06f 100644
--- a/lib/mktime-internal.h
+++ b/lib/mktime-internal.h
@@ -1,6 +1,6 @@
 /* mktime variant that also uses an offset guess
 
-   Copyright 2016 Free Software Foundation, Inc.
+   Copyright 2016-2017 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
diff --git a/lib/mktime.c b/lib/mktime.c
index 9eb3e76..2efd44a 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -1,5 +1,5 @@
 /* Convert a 'struct tm' to a time_t value.
-   Copyright (C) 1993-2016 Free Software Foundation, Inc.
+   Copyright (C) 1993-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Eggert <address@hidden>.
 
@@ -153,7 +153,7 @@ isdst_differ (int a, int b)
 
 /* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) -
    (YEAR0-YDAY0 HOUR0:MIN0:SEC0) in seconds, assuming that the clocks
-   were not adjusted between the time stamps.
+   were not adjusted between the timestamps.
 
    The YEAR values uses the same numbering as TP->tm_year.  Values
    need not be in the usual range.  However, YEAR1 must not overflow
diff --git a/lib/msvc-inval.c b/lib/msvc-inval.c
index c649d5f..32818f7 100644
--- a/lib/msvc-inval.c
+++ b/lib/msvc-inval.c
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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
diff --git a/lib/msvc-inval.h b/lib/msvc-inval.h
index 32a44a3..8147f09 100644
--- a/lib/msvc-inval.h
+++ b/lib/msvc-inval.h
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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
diff --git a/lib/msvc-nothrow.c b/lib/msvc-nothrow.c
index 1c7b584..c8e483b 100644
--- a/lib/msvc-nothrow.c
+++ b/lib/msvc-nothrow.c
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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
diff --git a/lib/msvc-nothrow.h b/lib/msvc-nothrow.h
index f76f4de..52dbeb1 100644
--- a/lib/msvc-nothrow.h
+++ b/lib/msvc-nothrow.h
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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
diff --git a/lib/netdb.in.h b/lib/netdb.in.h
index 8361da8..d14d57b 100644
--- a/lib/netdb.in.h
+++ b/lib/netdb.in.h
@@ -1,5 +1,5 @@
 /* Provide a netdb.h header file for systems lacking it (read: MinGW).
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/netinet_in.in.h b/lib/netinet_in.in.h
index 4be15ab..51dc48b 100644
--- a/lib/netinet_in.in.h
+++ b/lib/netinet_in.in.h
@@ -1,5 +1,5 @@
 /* Substitute for <netinet/in.h>.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/nl_langinfo.c b/lib/nl_langinfo.c
index 5c3124f..441e75c 100644
--- a/lib/nl_langinfo.c
+++ b/lib/nl_langinfo.c
@@ -1,6 +1,6 @@
 /* nl_langinfo() replacement: query locale dependent information.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
@@ -34,7 +34,6 @@ static char *
 ctype_codeset (void)
 {
   static char buf[2 + 10 + 1];
-  size_t buflen = 0;
   char const *locale = setlocale (LC_CTYPE, NULL);
   char *codeset = buf;
   size_t codesetlen;
@@ -99,14 +98,14 @@ rpl_nl_langinfo (nl_item item)
 # endif
 # if GNULIB_defined_T_FMT_AMPM
     case T_FMT_AMPM:
-      return "%I:%M:%S %p";
+      return (char *) "%I:%M:%S %p";
 # endif
 # if GNULIB_defined_ERA
     case ERA:
       /* The format is not standardized.  In glibc it is a sequence of strings
          of the form "direction:offset:start_date:end_date:era_name:era_format"
          with an empty string at the end.  */
-      return "";
+      return (char *) "";
     case ERA_D_FMT:
       /* The %Ex conversion in strftime behaves like %x if the locale does not
          have an alternative time format.  */
@@ -125,13 +124,13 @@ rpl_nl_langinfo (nl_item item)
     case ALT_DIGITS:
       /* The format is not standardized.  In glibc it is a sequence of 10
          strings, appended in memory.  */
-      return "\0\0\0\0\0\0\0\0\0\0";
+      return (char *) "\0\0\0\0\0\0\0\0\0\0";
 # endif
 # if GNULIB_defined_YESEXPR || !FUNC_NL_LANGINFO_YESEXPR_WORKS
     case YESEXPR:
-      return "^[yY]";
+      return (char *) "^[yY]";
     case NOEXPR:
-      return "^[nN]";
+      return (char *) "^[nN]";
 # endif
     default:
       break;
@@ -163,9 +162,9 @@ nl_langinfo (nl_item item)
           return codeset;
       }
 # ifdef __BEOS__
-      return "UTF-8";
+      return (char *) "UTF-8";
 # else
-      return "ISO-8859-1";
+      return (char *) "ISO-8859-1";
 # endif
     /* nl_langinfo items of the LC_NUMERIC category */
     case RADIXCHAR:
@@ -178,23 +177,23 @@ nl_langinfo (nl_item item)
        TODO: Really use the locale.  */
     case D_T_FMT:
     case ERA_D_T_FMT:
-      return "%a %b %e %H:%M:%S %Y";
+      return (char *) "%a %b %e %H:%M:%S %Y";
     case D_FMT:
     case ERA_D_FMT:
-      return "%m/%d/%y";
+      return (char *) "%m/%d/%y";
     case T_FMT:
     case ERA_T_FMT:
-      return "%H:%M:%S";
+      return (char *) "%H:%M:%S";
     case T_FMT_AMPM:
-      return "%I:%M:%S %p";
+      return (char *) "%I:%M:%S %p";
     case AM_STR:
       if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm))
-        return "AM";
+        return (char *) "AM";
       return nlbuf;
     case PM_STR:
       tmm.tm_hour = 12;
       if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm))
-        return "PM";
+        return (char *) "PM";
       return nlbuf;
     case DAY_1:
     case DAY_2:
@@ -274,9 +273,9 @@ nl_langinfo (nl_item item)
         return nlbuf;
       }
     case ERA:
-      return "";
+      return (char *) "";
     case ALT_DIGITS:
-      return "\0\0\0\0\0\0\0\0\0\0";
+      return (char *) "\0\0\0\0\0\0\0\0\0\0";
     /* nl_langinfo items of the LC_MONETARY category.  */
     case CRNCYSTR:
       return localeconv () ->currency_symbol;
@@ -311,11 +310,11 @@ nl_langinfo (nl_item item)
     /* nl_langinfo items of the LC_MESSAGES category
        TODO: Really use the locale. */
     case YESEXPR:
-      return "^[yY]";
+      return (char *) "^[yY]";
     case NOEXPR:
-      return "^[nN]";
+      return (char *) "^[nN]";
     default:
-      return "";
+      return (char *) "";
     }
 }
 
diff --git a/lib/nproc.c b/lib/nproc.c
index e79094c..78e13e3 100644
--- a/lib/nproc.c
+++ b/lib/nproc.c
@@ -1,6 +1,6 @@
 /* Detect the number of processors.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/nproc.h b/lib/nproc.h
index 6f8b4ae..4f60219 100644
--- a/lib/nproc.h
+++ b/lib/nproc.h
@@ -1,6 +1,6 @@
 /* Detect the number of processors.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/open.c b/lib/open.c
index b815fcd..4dd5e2b 100644
--- a/lib/open.c
+++ b/lib/open.c
@@ -1,5 +1,5 @@
 /* Open a descriptor to a file.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/pathmax.h b/lib/pathmax.h
index e7b8c7c..0ebce81 100644
--- a/lib/pathmax.h
+++ b/lib/pathmax.h
@@ -1,5 +1,5 @@
 /* Define PATH_MAX somehow.  Requires sys/types.h.
-   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2016 Free Software
+   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/pipe.c b/lib/pipe.c
index 4eda943..349a859 100644
--- a/lib/pipe.c
+++ b/lib/pipe.c
@@ -1,5 +1,5 @@
 /* Create a pipe.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/pipe2.c b/lib/pipe2.c
index e4ec146..13e3dcf 100644
--- a/lib/pipe2.c
+++ b/lib/pipe2.c
@@ -1,5 +1,5 @@
 /* Create a pipe, with specific opening flags.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/poll.c b/lib/poll.c
index bf8dd1c..e700ac3 100644
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -1,7 +1,7 @@
 /* Emulation for poll(2)
    Contributed by Paolo Bonzini.
 
-   Copyright 2001-2003, 2006-2016 Free Software Foundation, Inc.
+   Copyright 2001-2003, 2006-2017 Free Software Foundation, Inc.
 
    This file is part of gnulib.
 
diff --git a/lib/poll.in.h b/lib/poll.in.h
index 7066229..e9b141d 100644
--- a/lib/poll.in.h
+++ b/lib/poll.in.h
@@ -1,7 +1,7 @@
 /* Header for poll(2) emulation
    Contributed by Paolo Bonzini.
 
-   Copyright 2001-2003, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright 2001-2003, 2007, 2009-2017 Free Software Foundation, Inc.
 
    This file is part of gnulib.
 
diff --git a/lib/printf-args.c b/lib/printf-args.c
index ff86625..42975fa 100644
--- a/lib/printf-args.c
+++ b/lib/printf-args.c
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/printf-args.h b/lib/printf-args.h
index 3b2fe7f..a7df286 100644
--- a/lib/printf-args.h
+++ b/lib/printf-args.h
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/printf-parse.c b/lib/printf-parse.c
index f19d17f..a3b2c9d 100644
--- a/lib/printf-parse.c
+++ b/lib/printf-parse.c
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2017 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
diff --git a/lib/printf-parse.h b/lib/printf-parse.h
index 4e753be..5715719 100644
--- a/lib/printf-parse.h
+++ b/lib/printf-parse.h
@@ -1,5 +1,5 @@
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2017 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/putenv.c b/lib/putenv.c
index 8db04d2..ba1cc07 100644
--- a/lib/putenv.c
+++ b/lib/putenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2016 Free Software
+/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2017 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C
diff --git a/lib/raise.c b/lib/raise.c
index 60a76c4..223c152 100644
--- a/lib/raise.c
+++ b/lib/raise.c
@@ -1,6 +1,6 @@
 /* Provide a non-threads replacement for the POSIX raise function.
 
-   Copyright (C) 2002-2003, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2006, 2009-2017 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
diff --git a/lib/read.c b/lib/read.c
index aea8bbc..5385cfd 100644
--- a/lib/read.c
+++ b/lib/read.c
@@ -1,5 +1,5 @@
 /* POSIX compatible read() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2011.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/readlink.c b/lib/readlink.c
index 53ee57d..d624fec 100644
--- a/lib/readlink.c
+++ b/lib/readlink.c
@@ -1,5 +1,5 @@
 /* Stub for readlink().
-   Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2017 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
diff --git a/lib/recv.c b/lib/recv.c
index a6e962f..d5b115d 100644
--- a/lib/recv.c
+++ b/lib/recv.c
@@ -1,6 +1,6 @@
 /* recv.c --- wrappers for Windows recv function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/recvfrom.c b/lib/recvfrom.c
index 2da508e..bf4b873 100644
--- a/lib/recvfrom.c
+++ b/lib/recvfrom.c
@@ -1,6 +1,6 @@
 /* recvfrom.c --- wrappers for Windows recvfrom function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/ref-add.sin b/lib/ref-add.sin
index 313d82e..bfd5b80 100644
--- a/lib/ref-add.sin
+++ b/lib/ref-add.sin
@@ -1,6 +1,6 @@
 # Add this package to a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009-2017 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
diff --git a/lib/ref-del.sin b/lib/ref-del.sin
index 46532d8..f281f21 100644
--- a/lib/ref-del.sin
+++ b/lib/ref-del.sin
@@ -1,6 +1,6 @@
 # Remove this package from a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009-2017 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
diff --git a/lib/regcomp.c b/lib/regcomp.c
index 6c4db27..9fd4fed 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 
diff --git a/lib/regex.c b/lib/regex.c
index f5b4655..d1de139 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 
diff --git a/lib/regex.h b/lib/regex.h
index 3ba64ac..e356b2c 100644
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -1,6 +1,6 @@
 /* Definitions for data structures and routines for the regular
    expression library.
-   Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2016 Free Software
+   Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2017 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -552,7 +552,7 @@ extern int re_compile_fastmap (struct re_pattern_buffer 
*__buffer);
    match, or -2 for an internal error.  Also return register
    information in REGS (if REGS and BUFFER->no_sub are nonzero).  */
 extern regoff_t re_search (struct re_pattern_buffer *__buffer,
-                          const char *__string, regoff_t __length,
+                          const char *__String, regoff_t __length,
                           regoff_t __start, regoff_t __range,
                           struct re_registers *__regs);
 
@@ -570,7 +570,7 @@ extern regoff_t re_search_2 (struct re_pattern_buffer 
*__buffer,
 /* Like 're_search', but return how many characters in STRING the regexp
    in BUFFER matched, starting at position START.  */
 extern regoff_t re_match (struct re_pattern_buffer *__buffer,
-                         const char *__string, regoff_t __length,
+                         const char *__String, regoff_t __length,
                          regoff_t __start, struct re_registers *__regs);
 
 
@@ -642,7 +642,7 @@ extern int regcomp (regex_t *_Restrict_ __preg,
                    int __cflags);
 
 extern int regexec (const regex_t *_Restrict_ __preg,
-                   const char *_Restrict_ __string, size_t __nmatch,
+                   const char *_Restrict_ __String, size_t __nmatch,
                    regmatch_t __pmatch[_Restrict_arr_],
                    int __eflags);
 
diff --git a/lib/regex_internal.c b/lib/regex_internal.c
index cd78b25..03f6895 100644
--- a/lib/regex_internal.c
+++ b/lib/regex_internal.c
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 56a315a..9bb0740 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 
@@ -33,6 +33,8 @@
 #include <stdbool.h>
 #include <stdint.h>
 
+#include "intprops.h"
+
 #ifdef _LIBC
 # include <libc-lock.h>
 # define lock_define(name) __libc_lock_define (, name)
@@ -113,11 +115,7 @@
 # define RE_ENABLE_I18N
 #endif
 
-#if __GNUC__ >= 3
-# define BE(expr, val) __builtin_expect (expr, val)
-#else
-# define BE(expr, val) (expr)
-#endif
+#define BE(expr, val) __builtin_expect (expr, val)
 
 /* Number of ASCII characters.  */
 #define ASCII_CHARS 0x80
diff --git a/lib/regexec.c b/lib/regexec.c
index afdc173..ef52b24 100644
--- a/lib/regexec.c
+++ b/lib/regexec.c
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <address@hidden>.
 
@@ -354,10 +354,12 @@ re_search_2_stub (struct re_pattern_buffer *bufp, const 
char *string1,
 {
   const char *str;
   regoff_t rval;
-  Idx len = length1 + length2;
+  Idx len;
   char *s = NULL;
 
-  if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1, 0))
+  if (BE ((length1 < 0 || length2 < 0 || stop < 0
+           || INT_ADD_WRAPV (length1, length2, &len)),
+          0))
     return -2;
 
   /* Concatenate the strings.  */
diff --git a/lib/rename.c b/lib/rename.c
index 53fde10..dfa1e3b 100644
--- a/lib/rename.c
+++ b/lib/rename.c
@@ -1,6 +1,6 @@
 /* Work around rename bugs in some systems.
 
-   Copyright (C) 2001-2003, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2006, 2009-2017 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
diff --git a/lib/rmdir.c b/lib/rmdir.c
index cd4d9c1..95d3f3d 100644
--- a/lib/rmdir.c
+++ b/lib/rmdir.c
@@ -1,6 +1,6 @@
 /* Work around rmdir bugs.
 
-   Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2016 Free Software
+   Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/round.c b/lib/round.c
index 7a595ad..86f24df 100644
--- a/lib/round.c
+++ b/lib/round.c
@@ -1,5 +1,5 @@
 /* Round toward nearest, breaking ties away from zero.
-   Copyright (C) 2007, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2010-2017 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
diff --git a/lib/safe-read.c b/lib/safe-read.c
index 57978af..bf9d7be 100644
--- a/lib/safe-read.c
+++ b/lib/safe-read.c
@@ -1,6 +1,6 @@
 /* An interface to read and write that retries after interrupts.
 
-   Copyright (C) 1993-1994, 1998, 2002-2006, 2009-2016 Free Software
+   Copyright (C) 1993-1994, 1998, 2002-2006, 2009-2017 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/safe-read.h b/lib/safe-read.h
index 6665f2d..09da317 100644
--- a/lib/safe-read.h
+++ b/lib/safe-read.h
@@ -1,5 +1,5 @@
 /* An interface to read() that retries after interrupts.
-   Copyright (C) 2002, 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006, 2009-2017 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
diff --git a/lib/safe-write.c b/lib/safe-write.c
index 96c5db2..c906694 100644
--- a/lib/safe-write.c
+++ b/lib/safe-write.c
@@ -1,5 +1,5 @@
 /* An interface to write that retries after interrupts.
-   Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2017 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
diff --git a/lib/safe-write.h b/lib/safe-write.h
index 3bae853..dfada8b 100644
--- a/lib/safe-write.h
+++ b/lib/safe-write.h
@@ -1,5 +1,5 @@
 /* An interface to write() that retries after interrupts.
-   Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2017 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
diff --git a/lib/same-inode.h b/lib/same-inode.h
index e19c68a..88a43c7 100644
--- a/lib/same-inode.h
+++ b/lib/same-inode.h
@@ -1,6 +1,6 @@
-/* Determine whether two stat buffers refer to the same file.
+/* Determine whether two stat buffers are known to refer to the same file.
 
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2017 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
@@ -24,6 +24,10 @@
      && (a).st_ino[1] == (b).st_ino[1] \
      && (a).st_ino[2] == (b).st_ino[2] \
      && (a).st_dev == (b).st_dev)
+# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* On MinGW, struct stat lacks necessary info, so always return 0.
+   Callers can use !a.st_ino to deduce that the information is unknown.  */
+#  define SAME_INODE(a, b) 0
 # else
 #  define SAME_INODE(a, b)    \
     ((a).st_ino == (b).st_ino \
diff --git a/lib/secure_getenv.c b/lib/secure_getenv.c
index 821cb09..b8c64c7 100644
--- a/lib/secure_getenv.c
+++ b/lib/secure_getenv.c
@@ -1,6 +1,6 @@
 /* Look up an environment variable, returning NULL in insecure situations.
 
-   Copyright 2013-2016 Free Software Foundation, Inc.
+   Copyright 2013-2017 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
diff --git a/lib/select.c b/lib/select.c
index 4f6accc..fe50a95 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -1,7 +1,7 @@
 /* Emulation for select(2)
    Contributed by Paolo Bonzini.
 
-   Copyright 2008-2016 Free Software Foundation, Inc.
+   Copyright 2008-2017 Free Software Foundation, Inc.
 
    This file is part of gnulib.
 
diff --git a/lib/send.c b/lib/send.c
index 3f1c567..d4a17a5 100644
--- a/lib/send.c
+++ b/lib/send.c
@@ -1,6 +1,6 @@
 /* send.c --- wrappers for Windows send function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/sendto.c b/lib/sendto.c
index 494f388..1941bec 100644
--- a/lib/sendto.c
+++ b/lib/sendto.c
@@ -1,6 +1,6 @@
 /* sendto.c --- wrappers for Windows sendto function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/setenv.c b/lib/setenv.c
index f67233b..be43c0c 100644
--- a/lib/setenv.c
+++ b/lib/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2003, 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2003, 2005-2017 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
diff --git a/lib/setsockopt.c b/lib/setsockopt.c
index 1e863a8..8d4c1f0 100644
--- a/lib/setsockopt.c
+++ b/lib/setsockopt.c
@@ -1,6 +1,6 @@
 /* setsockopt.c --- wrappers for Windows setsockopt function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/shutdown.c b/lib/shutdown.c
index b953971..16496dc 100644
--- a/lib/shutdown.c
+++ b/lib/shutdown.c
@@ -1,6 +1,6 @@
 /* shutdown.c --- wrappers for Windows shutdown function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/signal.in.h b/lib/signal.in.h
index 90f7d30..2a272cc 100644
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <signal.h>.
 
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2017 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
diff --git a/lib/signbitd.c b/lib/signbitd.c
index f584fe2..096af7d 100644
--- a/lib/signbitd.c
+++ b/lib/signbitd.c
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/signbitf.c b/lib/signbitf.c
index 7d35eda..09443b1 100644
--- a/lib/signbitf.c
+++ b/lib/signbitf.c
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2017 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
diff --git a/lib/signbitl.c b/lib/signbitl.c
index b12590d..c072bf8 100644
--- a/lib/signbitl.c
+++ b/lib/signbitl.c
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2017 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
diff --git a/lib/size_max.h b/lib/size_max.h
index 5b04b79..2f4a439 100644
--- a/lib/size_max.h
+++ b/lib/size_max.h
@@ -1,5 +1,5 @@
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/snprintf.c b/lib/snprintf.c
index 2205cb7..51ef374 100644
--- a/lib/snprintf.c
+++ b/lib/snprintf.c
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2017 Free Software Foundation, Inc.
    Written by Simon Josefsson and Paul Eggert.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/socket.c b/lib/socket.c
index af26982..1c3500a 100644
--- a/lib/socket.c
+++ b/lib/socket.c
@@ -1,6 +1,6 @@
 /* socket.c --- wrappers for Windows socket function
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/sockets.c b/lib/sockets.c
index ca65954..8aa2756 100644
--- a/lib/sockets.c
+++ b/lib/sockets.c
@@ -1,6 +1,6 @@
 /* sockets.c --- wrappers for Windows socket functions
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/sockets.h b/lib/sockets.h
index a1555a0..9698f32 100644
--- a/lib/sockets.h
+++ b/lib/sockets.h
@@ -1,6 +1,6 @@
 /* sockets.h - wrappers for Windows socket functions
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
@@ -27,13 +27,13 @@
 #define SOCKETS_2_2 0x0202
 
 int gl_sockets_startup (int version)
-#if !WINDOWS_SOCKETS
+#ifndef WINDOWS_SOCKETS
   _GL_ATTRIBUTE_CONST
 #endif
   ;
 
 int gl_sockets_cleanup (void)
-#if !WINDOWS_SOCKETS
+#ifndef WINDOWS_SOCKETS
   _GL_ATTRIBUTE_CONST
 #endif
   ;
@@ -41,7 +41,7 @@ int gl_sockets_cleanup (void)
 /* This function is useful it you create a socket using gnulib's
    Winsock wrappers but needs to pass on the socket handle to some
    other library that only accepts sockets. */
-#if WINDOWS_SOCKETS
+#ifdef WINDOWS_SOCKETS
 
 #include <sys/socket.h>
 
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 1399246..f761d27 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -1,6 +1,6 @@
 /* stat-related time functions.
 
-   Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2017 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
@@ -181,7 +181,7 @@ get_stat_birthtime (struct stat const *st)
      || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
   /* FreeBSD and NetBSD sometimes signal the absence of knowledge by
      using zero.  Attempt to work around this problem.  Alas, this can
-     report failure even for valid time stamps.  Also, NetBSD
+     report failure even for valid timestamps.  Also, NetBSD
      sometimes returns junk in the birth time fields; work around this
      bug if it is detected.  */
   if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000))
diff --git a/lib/stat.c b/lib/stat.c
index 83a9a6e..cf26178 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -1,5 +1,5 @@
 /* Work around platform bugs in stat.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
index 41913c0..2c00533 100644
--- a/lib/stdalign.in.h
+++ b/lib/stdalign.in.h
@@ -1,6 +1,6 @@
 /* A substitute for ISO C11 <stdalign.h>.
 
-   Copyright 2011-2016 Free Software Foundation, Inc.
+   Copyright 2011-2017 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
diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h
index 267215b..301df94 100644
--- a/lib/stdbool.in.h
+++ b/lib/stdbool.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2001.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/stddef.in.h b/lib/stddef.in.h
index 927bc2d..7b0ce95 100644
--- a/lib/stddef.in.h
+++ b/lib/stddef.in.h
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2017 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
diff --git a/lib/stdint.in.h b/lib/stdint.in.h
index d569847..11e8e13 100644
--- a/lib/stdint.in.h
+++ b/lib/stdint.in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2017 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
@@ -79,49 +79,60 @@
 #if ! defined address@hidden@_STDINT_H && ! defined 
_GL_JUST_INCLUDE_SYSTEM_STDINT_H
 #define address@hidden@_STDINT_H
 
+/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
+   LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH.  */
+#include <limits.h>
+
+/* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
+   wint_t.  */
+#if @GNULIB_OVERRIDES_WINT_T@
+# undef WINT_MIN
+# undef WINT_MAX
+# define WINT_MIN 0x0U
+# define WINT_MAX 0xffffffffU
+#endif
+
+#if ! @HAVE_C99_STDINT_H@
+
 /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
    AIX 5.2 <sys/types.h> isn't needed and causes troubles.
    Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
    relies on the system <stdint.h> definitions, so include
    <sys/types.h> after @address@hidden  */
-#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
-# include <sys/types.h>
-#endif
-
-/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
-   LONG_MIN, LONG_MAX, ULONG_MAX.  */
-#include <limits.h>
+# if @HAVE_SYS_TYPES_H@ && ! defined _AIX
+#  include <sys/types.h>
+# endif
 
-#if @HAVE_INTTYPES_H@
+# if @HAVE_INTTYPES_H@
   /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
      int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
      <inttypes.h> also defines intptr_t and uintptr_t.  */
-# include <inttypes.h>
-#elif @HAVE_SYS_INTTYPES_H@
+#  include <inttypes.h>
+# elif @HAVE_SYS_INTTYPES_H@
   /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
      the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX.  */
-# include <sys/inttypes.h>
-#endif
+#  include <sys/inttypes.h>
+# endif
 
-#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
+# if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
   /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
      int{8,16,32,64}_t and __BIT_TYPES_DEFINED__.  In libc5 >= 5.2.2 it is
      included by <sys/types.h>.  */
-# include <sys/bitypes.h>
-#endif
+#  include <sys/bitypes.h>
+# endif
 
-#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 
 /* Minimum and maximum values for an integer type under the usual assumption.
    Return an unspecified value if BITS == 0, adding a check to pacify
    picky compilers.  */
 
-#define _STDINT_MIN(signed, bits, zero) \
-  ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
+# define _STDINT_MIN(signed, bits, zero) \
+    ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
 
-#define _STDINT_MAX(signed, bits, zero) \
-  (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+# define _STDINT_MAX(signed, bits, zero) \
+    (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
 #if !GNULIB_defined_stdint_types
 
@@ -130,26 +141,26 @@
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits.  */
 
-#undef int8_t
-#undef uint8_t
+# undef int8_t
+# undef uint8_t
 typedef signed char gl_int8_t;
 typedef unsigned char gl_uint8_t;
-#define int8_t gl_int8_t
-#define uint8_t gl_uint8_t
+# define int8_t gl_int8_t
+# define uint8_t gl_uint8_t
 
-#undef int16_t
-#undef uint16_t
+# undef int16_t
+# undef uint16_t
 typedef short int gl_int16_t;
 typedef unsigned short int gl_uint16_t;
-#define int16_t gl_int16_t
-#define uint16_t gl_uint16_t
+# define int16_t gl_int16_t
+# define uint16_t gl_uint16_t
 
-#undef int32_t
-#undef uint32_t
+# undef int32_t
+# undef uint32_t
 typedef int gl_int32_t;
 typedef unsigned int gl_uint32_t;
-#define int32_t gl_int32_t
-#define uint32_t gl_uint32_t
+# define int32_t gl_int32_t
+# define uint32_t gl_uint32_t
 
 /* If the system defines INT64_MAX, assume int64_t works.  That way,
    if the underlying platform defines int64_t to be a 64-bit long long
@@ -157,54 +168,54 @@ typedef unsigned int gl_uint32_t;
    int, which would mess up C++ name mangling.  We must use #ifdef
    rather than #if, to avoid an error with HP-UX 10.20 cc.  */
 
-#ifdef INT64_MAX
-# define GL_INT64_T
-#else
+# ifdef INT64_MAX
+#  define GL_INT64_T
+# else
 /* Do not undefine int64_t if gnulib is not being used with 64-bit
    types, since otherwise it breaks platforms like Tandem/NSK.  */
-# if LONG_MAX >> 31 >> 31 == 1
-#  undef int64_t
+#  if LONG_MAX >> 31 >> 31 == 1
+#   undef int64_t
 typedef long int gl_int64_t;
-#  define int64_t gl_int64_t
-#  define GL_INT64_T
-# elif defined _MSC_VER
-#  undef int64_t
+#   define int64_t gl_int64_t
+#   define GL_INT64_T
+#  elif defined _MSC_VER
+#   undef int64_t
 typedef __int64 gl_int64_t;
-#  define int64_t gl_int64_t
-#  define GL_INT64_T
-# elif @HAVE_LONG_LONG_INT@
-#  undef int64_t
+#   define int64_t gl_int64_t
+#   define GL_INT64_T
+#  elif @HAVE_LONG_LONG_INT@
+#   undef int64_t
 typedef long long int gl_int64_t;
-#  define int64_t gl_int64_t
-#  define GL_INT64_T
+#   define int64_t gl_int64_t
+#   define GL_INT64_T
+#  endif
 # endif
-#endif
 
-#ifdef UINT64_MAX
-# define GL_UINT64_T
-#else
-# if ULONG_MAX >> 31 >> 31 >> 1 == 1
-#  undef uint64_t
-typedef unsigned long int gl_uint64_t;
-#  define uint64_t gl_uint64_t
+# ifdef UINT64_MAX
 #  define GL_UINT64_T
-# elif defined _MSC_VER
-#  undef uint64_t
+# else
+#  if ULONG_MAX >> 31 >> 31 >> 1 == 1
+#   undef uint64_t
+typedef unsigned long int gl_uint64_t;
+#   define uint64_t gl_uint64_t
+#   define GL_UINT64_T
+#  elif defined _MSC_VER
+#   undef uint64_t
 typedef unsigned __int64 gl_uint64_t;
-#  define uint64_t gl_uint64_t
-#  define GL_UINT64_T
-# elif @HAVE_UNSIGNED_LONG_LONG_INT@
-#  undef uint64_t
+#   define uint64_t gl_uint64_t
+#   define GL_UINT64_T
+#  elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#   undef uint64_t
 typedef unsigned long long int gl_uint64_t;
-#  define uint64_t gl_uint64_t
-#  define GL_UINT64_T
+#   define uint64_t gl_uint64_t
+#   define GL_UINT64_T
+#  endif
 # endif
-#endif
 
 /* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */
-#define _UINT8_T
-#define _UINT32_T
-#define _UINT64_T
+# define _UINT8_T
+# define _UINT32_T
+# define _UINT64_T
 
 
 /* 7.18.1.2. Minimum-width integer types */
@@ -213,26 +224,26 @@ typedef unsigned long long int gl_uint64_t;
    types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
    are the same as the corresponding N_t types.  */
 
-#undef int_least8_t
-#undef uint_least8_t
-#undef int_least16_t
-#undef uint_least16_t
-#undef int_least32_t
-#undef uint_least32_t
-#undef int_least64_t
-#undef uint_least64_t
-#define int_least8_t int8_t
-#define uint_least8_t uint8_t
-#define int_least16_t int16_t
-#define uint_least16_t uint16_t
-#define int_least32_t int32_t
-#define uint_least32_t uint32_t
-#ifdef GL_INT64_T
-# define int_least64_t int64_t
-#endif
-#ifdef GL_UINT64_T
-# define uint_least64_t uint64_t
-#endif
+# undef int_least8_t
+# undef uint_least8_t
+# undef int_least16_t
+# undef uint_least16_t
+# undef int_least32_t
+# undef uint_least32_t
+# undef int_least64_t
+# undef uint_least64_t
+# define int_least8_t int8_t
+# define uint_least8_t uint8_t
+# define int_least16_t int16_t
+# define uint_least16_t uint16_t
+# define int_least32_t int32_t
+# define uint_least32_t uint32_t
+# ifdef GL_INT64_T
+#  define int_least64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+#  define uint_least64_t uint64_t
+# endif
 
 /* 7.18.1.3. Fastest minimum-width integer types */
 
@@ -245,55 +256,55 @@ typedef unsigned long long int gl_uint64_t;
    uses types consistent with glibc, as that lessens the chance of
    incompatibility with older GNU hosts.  */
 
-#undef int_fast8_t
-#undef uint_fast8_t
-#undef int_fast16_t
-#undef uint_fast16_t
-#undef int_fast32_t
-#undef uint_fast32_t
-#undef int_fast64_t
-#undef uint_fast64_t
+# undef int_fast8_t
+# undef uint_fast8_t
+# undef int_fast16_t
+# undef uint_fast16_t
+# undef int_fast32_t
+# undef uint_fast32_t
+# undef int_fast64_t
+# undef uint_fast64_t
 typedef signed char gl_int_fast8_t;
 typedef unsigned char gl_uint_fast8_t;
 
-#ifdef __sun
+# ifdef __sun
 /* Define types compatible with SunOS 5.10, so that code compiled under
    earlier SunOS versions works with code compiled under SunOS 5.10.  */
 typedef int gl_int_fast32_t;
 typedef unsigned int gl_uint_fast32_t;
-#else
+# else
 typedef long int gl_int_fast32_t;
 typedef unsigned long int gl_uint_fast32_t;
-#endif
+# endif
 typedef gl_int_fast32_t gl_int_fast16_t;
 typedef gl_uint_fast32_t gl_uint_fast16_t;
 
-#define int_fast8_t gl_int_fast8_t
-#define uint_fast8_t gl_uint_fast8_t
-#define int_fast16_t gl_int_fast16_t
-#define uint_fast16_t gl_uint_fast16_t
-#define int_fast32_t gl_int_fast32_t
-#define uint_fast32_t gl_uint_fast32_t
-#ifdef GL_INT64_T
-# define int_fast64_t int64_t
-#endif
-#ifdef GL_UINT64_T
-# define uint_fast64_t uint64_t
-#endif
+# define int_fast8_t gl_int_fast8_t
+# define uint_fast8_t gl_uint_fast8_t
+# define int_fast16_t gl_int_fast16_t
+# define uint_fast16_t gl_uint_fast16_t
+# define int_fast32_t gl_int_fast32_t
+# define uint_fast32_t gl_uint_fast32_t
+# ifdef GL_INT64_T
+#  define int_fast64_t int64_t
+# endif
+# ifdef GL_UINT64_T
+#  define uint_fast64_t uint64_t
+# endif
 
 /* 7.18.1.4. Integer types capable of holding object pointers */
 
 /* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
    definitions of intptr_t and uintptr_t (which use int and unsigned)
    to avoid clashes with declarations of system functions like sbrk.  */
-#ifndef _INTPTR_T_DECLARED
-#undef intptr_t
-#undef uintptr_t
+# ifndef _INTPTR_T_DECLARED
+# undef intptr_t
+# undef uintptr_t
 typedef long int gl_intptr_t;
 typedef unsigned long int gl_uintptr_t;
-#define intptr_t gl_intptr_t
-#define uintptr_t gl_uintptr_t
-#endif
+# define intptr_t gl_intptr_t
+# define uintptr_t gl_uintptr_t
+# endif
 
 /* 7.18.1.5. Greatest-width integer types */
 
@@ -304,33 +315,33 @@ typedef unsigned long int gl_uintptr_t;
    similarly for UINTMAX_MAX and uintmax_t.  This avoids problems with
    assuming one type where another is used by the system.  */
 
-#ifndef INTMAX_MAX
-# undef INTMAX_C
-# undef intmax_t
-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# ifndef INTMAX_MAX
+#  undef INTMAX_C
+#  undef intmax_t
+#  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
 typedef long long int gl_intmax_t;
-#  define intmax_t gl_intmax_t
-# elif defined GL_INT64_T
-#  define intmax_t int64_t
-# else
+#   define intmax_t gl_intmax_t
+#  elif defined GL_INT64_T
+#   define intmax_t int64_t
+#  else
 typedef long int gl_intmax_t;
-#  define intmax_t gl_intmax_t
+#   define intmax_t gl_intmax_t
+#  endif
 # endif
-#endif
 
-#ifndef UINTMAX_MAX
-# undef UINTMAX_C
-# undef uintmax_t
-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# ifndef UINTMAX_MAX
+#  undef UINTMAX_C
+#  undef uintmax_t
+#  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
 typedef unsigned long long int gl_uintmax_t;
-#  define uintmax_t gl_uintmax_t
-# elif defined GL_UINT64_T
-#  define uintmax_t uint64_t
-# else
+#   define uintmax_t gl_uintmax_t
+#  elif defined GL_UINT64_T
+#   define uintmax_t uint64_t
+#  else
 typedef unsigned long int gl_uintmax_t;
-#  define uintmax_t gl_uintmax_t
+#   define uintmax_t gl_uintmax_t
+#  endif
 # endif
-#endif
 
 /* Verify that intmax_t and uintmax_t have the same size.  Too much code
    breaks if this is not the case.  If this check fails, the reason is likely
@@ -338,8 +349,8 @@ typedef unsigned long int gl_uintmax_t;
 typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
                                 ? 1 : -1];
 
-#define GNULIB_defined_stdint_types 1
-#endif /* !GNULIB_defined_stdint_types */
+# define GNULIB_defined_stdint_types 1
+# endif /* !GNULIB_defined_stdint_types */
 
 /* 7.18.2. Limits of specified-width integer types */
 
@@ -348,37 +359,37 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits.  */
 
-#undef INT8_MIN
-#undef INT8_MAX
-#undef UINT8_MAX
-#define INT8_MIN  (~ INT8_MAX)
-#define INT8_MAX  127
-#define UINT8_MAX  255
-
-#undef INT16_MIN
-#undef INT16_MAX
-#undef UINT16_MAX
-#define INT16_MIN  (~ INT16_MAX)
-#define INT16_MAX  32767
-#define UINT16_MAX  65535
-
-#undef INT32_MIN
-#undef INT32_MAX
-#undef UINT32_MAX
-#define INT32_MIN  (~ INT32_MAX)
-#define INT32_MAX  2147483647
-#define UINT32_MAX  4294967295U
-
-#if defined GL_INT64_T && ! defined INT64_MAX
+# undef INT8_MIN
+# undef INT8_MAX
+# undef UINT8_MAX
+# define INT8_MIN  (~ INT8_MAX)
+# define INT8_MAX  127
+# define UINT8_MAX  255
+
+# undef INT16_MIN
+# undef INT16_MAX
+# undef UINT16_MAX
+# define INT16_MIN  (~ INT16_MAX)
+# define INT16_MAX  32767
+# define UINT16_MAX  65535
+
+# undef INT32_MIN
+# undef INT32_MAX
+# undef UINT32_MAX
+# define INT32_MIN  (~ INT32_MAX)
+# define INT32_MAX  2147483647
+# define UINT32_MAX  4294967295U
+
+# if defined GL_INT64_T && ! defined INT64_MAX
 /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
    evaluates the latter incorrectly in preprocessor expressions.  */
-# define INT64_MIN  (- INTMAX_C (1) << 63)
-# define INT64_MAX  INTMAX_C (9223372036854775807)
-#endif
+#  define INT64_MIN  (- INTMAX_C (1) << 63)
+#  define INT64_MAX  INTMAX_C (9223372036854775807)
+# endif
 
-#if defined GL_UINT64_T && ! defined UINT64_MAX
-# define UINT64_MAX  UINTMAX_C (18446744073709551615)
-#endif
+# if defined GL_UINT64_T && ! defined UINT64_MAX
+#  define UINT64_MAX  UINTMAX_C (18446744073709551615)
+# endif
 
 /* 7.18.2.2. Limits of minimum-width integer types */
 
@@ -386,38 +397,38 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
    types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
    are the same as the corresponding N_t types.  */
 
-#undef INT_LEAST8_MIN
-#undef INT_LEAST8_MAX
-#undef UINT_LEAST8_MAX
-#define INT_LEAST8_MIN  INT8_MIN
-#define INT_LEAST8_MAX  INT8_MAX
-#define UINT_LEAST8_MAX  UINT8_MAX
-
-#undef INT_LEAST16_MIN
-#undef INT_LEAST16_MAX
-#undef UINT_LEAST16_MAX
-#define INT_LEAST16_MIN  INT16_MIN
-#define INT_LEAST16_MAX  INT16_MAX
-#define UINT_LEAST16_MAX  UINT16_MAX
-
-#undef INT_LEAST32_MIN
-#undef INT_LEAST32_MAX
-#undef UINT_LEAST32_MAX
-#define INT_LEAST32_MIN  INT32_MIN
-#define INT_LEAST32_MAX  INT32_MAX
-#define UINT_LEAST32_MAX  UINT32_MAX
-
-#undef INT_LEAST64_MIN
-#undef INT_LEAST64_MAX
-#ifdef GL_INT64_T
-# define INT_LEAST64_MIN  INT64_MIN
-# define INT_LEAST64_MAX  INT64_MAX
-#endif
+# undef INT_LEAST8_MIN
+# undef INT_LEAST8_MAX
+# undef UINT_LEAST8_MAX
+# define INT_LEAST8_MIN  INT8_MIN
+# define INT_LEAST8_MAX  INT8_MAX
+# define UINT_LEAST8_MAX  UINT8_MAX
+
+# undef INT_LEAST16_MIN
+# undef INT_LEAST16_MAX
+# undef UINT_LEAST16_MAX
+# define INT_LEAST16_MIN  INT16_MIN
+# define INT_LEAST16_MAX  INT16_MAX
+# define UINT_LEAST16_MAX  UINT16_MAX
+
+# undef INT_LEAST32_MIN
+# undef INT_LEAST32_MAX
+# undef UINT_LEAST32_MAX
+# define INT_LEAST32_MIN  INT32_MIN
+# define INT_LEAST32_MAX  INT32_MAX
+# define UINT_LEAST32_MAX  UINT32_MAX
+
+# undef INT_LEAST64_MIN
+# undef INT_LEAST64_MAX
+# ifdef GL_INT64_T
+#  define INT_LEAST64_MIN  INT64_MIN
+#  define INT_LEAST64_MAX  INT64_MAX
+# endif
 
-#undef UINT_LEAST64_MAX
-#ifdef GL_UINT64_T
-# define UINT_LEAST64_MAX  UINT64_MAX
-#endif
+# undef UINT_LEAST64_MAX
+# ifdef GL_UINT64_T
+#  define UINT_LEAST64_MAX  UINT64_MAX
+# endif
 
 /* 7.18.2.3. Limits of fastest minimum-width integer types */
 
@@ -425,117 +436,117 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
    types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
    are taken from the same list of types.  */
 
-#undef INT_FAST8_MIN
-#undef INT_FAST8_MAX
-#undef UINT_FAST8_MAX
-#define INT_FAST8_MIN  SCHAR_MIN
-#define INT_FAST8_MAX  SCHAR_MAX
-#define UINT_FAST8_MAX  UCHAR_MAX
-
-#undef INT_FAST16_MIN
-#undef INT_FAST16_MAX
-#undef UINT_FAST16_MAX
-#define INT_FAST16_MIN  INT_FAST32_MIN
-#define INT_FAST16_MAX  INT_FAST32_MAX
-#define UINT_FAST16_MAX  UINT_FAST32_MAX
-
-#undef INT_FAST32_MIN
-#undef INT_FAST32_MAX
-#undef UINT_FAST32_MAX
-#ifdef __sun
-# define INT_FAST32_MIN  INT_MIN
-# define INT_FAST32_MAX  INT_MAX
-# define UINT_FAST32_MAX  UINT_MAX
-#else
-# define INT_FAST32_MIN  LONG_MIN
-# define INT_FAST32_MAX  LONG_MAX
-# define UINT_FAST32_MAX  ULONG_MAX
-#endif
+# undef INT_FAST8_MIN
+# undef INT_FAST8_MAX
+# undef UINT_FAST8_MAX
+# define INT_FAST8_MIN  SCHAR_MIN
+# define INT_FAST8_MAX  SCHAR_MAX
+# define UINT_FAST8_MAX  UCHAR_MAX
+
+# undef INT_FAST16_MIN
+# undef INT_FAST16_MAX
+# undef UINT_FAST16_MAX
+# define INT_FAST16_MIN  INT_FAST32_MIN
+# define INT_FAST16_MAX  INT_FAST32_MAX
+# define UINT_FAST16_MAX  UINT_FAST32_MAX
+
+# undef INT_FAST32_MIN
+# undef INT_FAST32_MAX
+# undef UINT_FAST32_MAX
+# ifdef __sun
+#  define INT_FAST32_MIN  INT_MIN
+#  define INT_FAST32_MAX  INT_MAX
+#  define UINT_FAST32_MAX  UINT_MAX
+# else
+#  define INT_FAST32_MIN  LONG_MIN
+#  define INT_FAST32_MAX  LONG_MAX
+#  define UINT_FAST32_MAX  ULONG_MAX
+# endif
 
-#undef INT_FAST64_MIN
-#undef INT_FAST64_MAX
-#ifdef GL_INT64_T
-# define INT_FAST64_MIN  INT64_MIN
-# define INT_FAST64_MAX  INT64_MAX
-#endif
+# undef INT_FAST64_MIN
+# undef INT_FAST64_MAX
+# ifdef GL_INT64_T
+#  define INT_FAST64_MIN  INT64_MIN
+#  define INT_FAST64_MAX  INT64_MAX
+# endif
 
-#undef UINT_FAST64_MAX
-#ifdef GL_UINT64_T
-# define UINT_FAST64_MAX  UINT64_MAX
-#endif
+# undef UINT_FAST64_MAX
+# ifdef GL_UINT64_T
+#  define UINT_FAST64_MAX  UINT64_MAX
+# endif
 
 /* 7.18.2.4. Limits of integer types capable of holding object pointers */
 
-#undef INTPTR_MIN
-#undef INTPTR_MAX
-#undef UINTPTR_MAX
-#define INTPTR_MIN  LONG_MIN
-#define INTPTR_MAX  LONG_MAX
-#define UINTPTR_MAX  ULONG_MAX
+# undef INTPTR_MIN
+# undef INTPTR_MAX
+# undef UINTPTR_MAX
+# define INTPTR_MIN  LONG_MIN
+# define INTPTR_MAX  LONG_MAX
+# define UINTPTR_MAX  ULONG_MAX
 
 /* 7.18.2.5. Limits of greatest-width integer types */
 
-#ifndef INTMAX_MAX
-# undef INTMAX_MIN
-# ifdef INT64_MAX
-#  define INTMAX_MIN  INT64_MIN
-#  define INTMAX_MAX  INT64_MAX
-# else
-#  define INTMAX_MIN  INT32_MIN
-#  define INTMAX_MAX  INT32_MAX
+# ifndef INTMAX_MAX
+#  undef INTMAX_MIN
+#  ifdef INT64_MAX
+#   define INTMAX_MIN  INT64_MIN
+#   define INTMAX_MAX  INT64_MAX
+#  else
+#   define INTMAX_MIN  INT32_MIN
+#   define INTMAX_MAX  INT32_MAX
+#  endif
 # endif
-#endif
 
-#ifndef UINTMAX_MAX
-# ifdef UINT64_MAX
-#  define UINTMAX_MAX  UINT64_MAX
-# else
-#  define UINTMAX_MAX  UINT32_MAX
+# ifndef UINTMAX_MAX
+#  ifdef UINT64_MAX
+#   define UINTMAX_MAX  UINT64_MAX
+#  else
+#   define UINTMAX_MAX  UINT32_MAX
+#  endif
 # endif
-#endif
 
 /* 7.18.3. Limits of other integer types */
 
 /* ptrdiff_t limits */
-#undef PTRDIFF_MIN
-#undef PTRDIFF_MAX
-#if @APPLE_UNIVERSAL_BUILD@
-# ifdef _LP64
-#  define PTRDIFF_MIN  _STDINT_MIN (1, 64, 0l)
-#  define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)
+# undef PTRDIFF_MIN
+# undef PTRDIFF_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+#  ifdef _LP64
+#   define PTRDIFF_MIN  _STDINT_MIN (1, 64, 0l)
+#   define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)
+#  else
+#   define PTRDIFF_MIN  _STDINT_MIN (1, 32, 0)
+#   define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
+#  endif
 # else
-#  define PTRDIFF_MIN  _STDINT_MIN (1, 32, 0)
-#  define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
-# endif
-#else
-# define PTRDIFF_MIN  \
+#  define PTRDIFF_MIN  \
     _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
-# define PTRDIFF_MAX  \
+#  define PTRDIFF_MAX  \
     _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, address@hidden@)
-#endif
+# endif
 
 /* sig_atomic_t limits */
-#undef SIG_ATOMIC_MIN
-#undef SIG_ATOMIC_MAX
-#define SIG_ATOMIC_MIN  \
+# undef SIG_ATOMIC_MIN
+# undef SIG_ATOMIC_MAX
+# define SIG_ATOMIC_MIN  \
    _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
                 address@hidden@)
-#define SIG_ATOMIC_MAX  \
+# define SIG_ATOMIC_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
                 address@hidden@)
 
 
 /* size_t limit */
-#undef SIZE_MAX
-#if @APPLE_UNIVERSAL_BUILD@
-# ifdef _LP64
-#  define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)
+# undef SIZE_MAX
+# if @APPLE_UNIVERSAL_BUILD@
+#  ifdef _LP64
+#   define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)
+#  else
+#   define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
+#  endif
 # else
-#  define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
+#  define SIZE_MAX  _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, address@hidden@)
 # endif
-#else
-# define SIZE_MAX  _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, address@hidden@)
-#endif
 
 /* wchar_t limits */
 /* Get WCHAR_MIN, WCHAR_MAX.
@@ -543,29 +554,29 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
    sequence of nested includes
    <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
    <stdint.h> and assumes its types are already defined.  */
-#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
+# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
   /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
      included before <wchar.h>.  */
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
-# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
-# include <wchar.h>
-# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
-#endif
-#undef WCHAR_MIN
-#undef WCHAR_MAX
-#define WCHAR_MIN  \
+#  include <stddef.h>
+#  include <stdio.h>
+#  include <time.h>
+#  define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+#  include <wchar.h>
+#  undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
+# endif
+# undef WCHAR_MIN
+# undef WCHAR_MAX
+# define WCHAR_MIN  \
    _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, address@hidden@)
-#define WCHAR_MAX  \
+# define WCHAR_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, address@hidden@)
 
 /* wint_t limits */
-#undef WINT_MIN
-#undef WINT_MAX
-#define WINT_MIN  \
+# undef WINT_MIN
+# undef WINT_MAX
+# define WINT_MIN  \
    _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, address@hidden@)
-#define WINT_MAX  \
+# define WINT_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, address@hidden@)
 
 /* 7.18.4. Macros for integer constants */
@@ -576,59 +587,120 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == 
sizeof (uintmax_t)
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits, and int is 32 bits.  */
 
-#undef INT8_C
-#undef UINT8_C
-#define INT8_C(x) x
-#define UINT8_C(x) x
-
-#undef INT16_C
-#undef UINT16_C
-#define INT16_C(x) x
-#define UINT16_C(x) x
-
-#undef INT32_C
-#undef UINT32_C
-#define INT32_C(x) x
-#define UINT32_C(x) x ## U
-
-#undef INT64_C
-#undef UINT64_C
-#if LONG_MAX >> 31 >> 31 == 1
-# define INT64_C(x) x##L
-#elif defined _MSC_VER
-# define INT64_C(x) x##i64
-#elif @HAVE_LONG_LONG_INT@
-# define INT64_C(x) x##LL
-#endif
-#if ULONG_MAX >> 31 >> 31 >> 1 == 1
-# define UINT64_C(x) x##UL
-#elif defined _MSC_VER
-# define UINT64_C(x) x##ui64
-#elif @HAVE_UNSIGNED_LONG_LONG_INT@
-# define UINT64_C(x) x##ULL
-#endif
+# undef INT8_C
+# undef UINT8_C
+# define INT8_C(x) x
+# define UINT8_C(x) x
+
+# undef INT16_C
+# undef UINT16_C
+# define INT16_C(x) x
+# define UINT16_C(x) x
+
+# undef INT32_C
+# undef UINT32_C
+# define INT32_C(x) x
+# define UINT32_C(x) x ## U
+
+# undef INT64_C
+# undef UINT64_C
+# if LONG_MAX >> 31 >> 31 == 1
+#  define INT64_C(x) x##L
+# elif defined _MSC_VER
+#  define INT64_C(x) x##i64
+# elif @HAVE_LONG_LONG_INT@
+#  define INT64_C(x) x##LL
+# endif
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+#  define UINT64_C(x) x##UL
+# elif defined _MSC_VER
+#  define UINT64_C(x) x##ui64
+# elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#  define UINT64_C(x) x##ULL
+# endif
 
 /* 7.18.4.2. Macros for greatest-width integer constants */
 
-#ifndef INTMAX_C
-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-#  define INTMAX_C(x)   x##LL
-# elif defined GL_INT64_T
-#  define INTMAX_C(x)   INT64_C(x)
-# else
-#  define INTMAX_C(x)   x##L
+# ifndef INTMAX_C
+#  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#   define INTMAX_C(x)   x##LL
+#  elif defined GL_INT64_T
+#   define INTMAX_C(x)   INT64_C(x)
+#  else
+#   define INTMAX_C(x)   x##L
+#  endif
 # endif
-#endif
 
-#ifndef UINTMAX_C
-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
-#  define UINTMAX_C(x)  x##ULL
-# elif defined GL_UINT64_T
-#  define UINTMAX_C(x)  UINT64_C(x)
-# else
-#  define UINTMAX_C(x)  x##UL
+# ifndef UINTMAX_C
+#  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#   define UINTMAX_C(x)  x##ULL
+#  elif defined GL_UINT64_T
+#   define UINTMAX_C(x)  UINT64_C(x)
+#  else
+#   define UINTMAX_C(x)  x##UL
+#  endif
 # endif
-#endif
+
+#endif /* address@hidden@ */
+
+/* Macros specified by ISO/IEC TS 18661-1:2014.  */
+
+#if (!defined UINTMAX_WIDTH \
+     && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
+# ifdef INT8_MAX
+#  define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX)
+# endif
+# ifdef UINT8_MAX
+#  define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX)
+# endif
+# ifdef INT16_MAX
+#  define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX)
+# endif
+# ifdef UINT16_MAX
+#  define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX)
+# endif
+# ifdef INT32_MAX
+#  define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX)
+# endif
+# ifdef UINT32_MAX
+#  define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX)
+# endif
+# ifdef INT64_MAX
+#  define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX)
+# endif
+# ifdef UINT64_MAX
+#  define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX)
+# endif
+# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX)
+# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX)
+# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX)
+# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX)
+# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX)
+# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX)
+# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX)
+# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX)
+# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX)
+# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX)
+# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX)
+# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX)
+# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX)
+# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX)
+# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX)
+# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX)
+# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX)
+# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX)
+# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX)
+# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX)
+# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX)
+# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX)
+# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX)
+# ifdef WINT_MAX
+#  define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX)
+# endif
+# ifdef SIG_ATOMIC_MAX
+#  define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX)
+# endif
+#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
 
 #endif /* address@hidden@_STDINT_H */
 #endif /* !(defined __ANDROID__ && ...) */
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index ce100aa..3306464 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2017 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
@@ -118,6 +118,26 @@
 # include <unistd.h>
 #endif
 
+/* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>.  We must include
+   it before we  #define perror rpl_perror.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
+    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <stdlib.h>
+#endif
+
+/* MSVC declares 'remove' in <io.h>, not in <stdio.h>.  We must include
+   it before we  #define remove rpl_remove.  */
+/* MSVC declares 'rename' in <io.h>, not in <stdio.h>.  We must include
+   it before we  #define rename rpl_rename.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
+    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <io.h>
+#endif
+
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index ec7a2ef..987167d 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2017 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
@@ -521,6 +521,9 @@ _GL_CXXALIASWARN (putenv);
 #endif
 
 #if @GNULIB_QSORT_R@
+/* Sort an array of NMEMB elements, starting at address BASE, each element
+   occupying SIZE bytes, in ascending order according to the comparison
+   function COMPARE.  */
 # if @REPLACE_QSORT_R@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef qsort_r
@@ -535,12 +538,24 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t 
nmemb, size_t size,
                                                   void *),
                                   void *arg));
 # else
+#  if address@hidden@
+_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
+                                  int (*compare) (void const *, void const *,
+                                                  void *),
+                                  void *arg) _GL_ARG_NONNULL ((1, 4)));
+#  endif
 _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
                                   int (*compare) (void const *, void const *,
                                                   void *),
                                   void *arg));
 # endif
 _GL_CXXALIASWARN (qsort_r);
+#elif defined GNULIB_POSIXCHECK
+# undef qsort_r
+# if HAVE_RAW_DECL_QSORT_R
+_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
+                 "use gnulib module qsort_r for portability");
+# endif
 #endif
 
 
diff --git a/lib/strdup.c b/lib/strdup.c
index b44862d..ece20c5 100644
--- a/lib/strdup.c
+++ b/lib/strdup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2016 Free Software
+/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2017 Free Software
    Foundation, Inc.
 
    This file is part of the GNU C Library.
diff --git a/lib/streq.h b/lib/streq.h
index 9be2939..831ded2 100644
--- a/lib/streq.h
+++ b/lib/streq.h
@@ -1,5 +1,5 @@
 /* Optimized string comparison.
-   Copyright (C) 2001-2002, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2017 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
diff --git a/lib/strftime.c b/lib/strftime.c
index b10f82f..8091f3d 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -1,22 +1,22 @@
-/* Copyright (C) 1991-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-   NOTE: The canonical source of this file is maintained with the GNU C 
Library.
-   Bugs can be reported to address@hidden
+   The GNU C Library 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 of the License, or (at your option) any later version.
 
-   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 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library 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.
+   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 Lesser General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifdef _LIBC
+# define USE_IN_EXTENDED_LOCALE_MODEL 1
 # define HAVE_STRUCT_ERA_ENTRY 1
 # define HAVE_TM_GMTOFF 1
 # define HAVE_TM_ZONE 1
@@ -63,10 +63,10 @@ extern char *tzname[];
 #endif
 
 #include <limits.h>
-#include <stdbool.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdbool.h>
 
 #ifdef COMPILE_WIDE
 # include <endian.h>
@@ -247,11 +247,11 @@ extern char *tzname[];
 # undef _NL_CURRENT
 # define _NL_CURRENT(category, item) \
   (current->values[_NL_ITEM_INDEX (item)].string)
+# define LOCALE_PARAM , __locale_t loc
 # define LOCALE_ARG , loc
-# define LOCALE_PARAM_PROTO , __locale_t loc
 # define HELPER_LOCALE_ARG  , current
 #else
-# define LOCALE_PARAM_PROTO
+# define LOCALE_PARAM
 # define LOCALE_ARG
 # ifdef _LIBC
 #  define HELPER_LOCALE_ARG , _NL_CURRENT_DATA (LC_TIME)
@@ -304,18 +304,22 @@ fwrite_uppcase (FILE *fp, const CHAR_T *src, size_t len)
     }
 }
 #else
+static CHAR_T *memcpy_lowcase (CHAR_T *dest, const CHAR_T *src,
+                               size_t len LOCALE_PARAM);
+
 static CHAR_T *
-memcpy_lowcase (CHAR_T *dest, const CHAR_T *src,
-                size_t len LOCALE_PARAM_PROTO)
+memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM)
 {
   while (len-- > 0)
     dest[len] = TOLOWER ((UCHAR_T) src[len], loc);
   return dest;
 }
 
+static CHAR_T *memcpy_uppcase (CHAR_T *dest, const CHAR_T *src,
+                               size_t len LOCALE_PARAM);
+
 static CHAR_T *
-memcpy_uppcase (CHAR_T *dest, const CHAR_T *src,
-                size_t len LOCALE_PARAM_PROTO)
+memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM)
 {
   while (len-- > 0)
     dest[len] = TOUPPER ((UCHAR_T) src[len], loc);
@@ -328,6 +332,7 @@ memcpy_uppcase (CHAR_T *dest, const CHAR_T *src,
 /* Yield the difference between *A and *B,
    measured in seconds, ignoring leap seconds.  */
 # define tm_diff ftime_tm_diff
+static int tm_diff (const struct tm *, const struct tm *);
 static int
 tm_diff (const struct tm *a, const struct tm *b)
 {
@@ -359,6 +364,7 @@ tm_diff (const struct tm *a, const struct tm *b)
 #define ISO_WEEK_START_WDAY 1 /* Monday */
 #define ISO_WEEK1_WDAY 4 /* Thursday */
 #define YDAY_MINIMUM (-366)
+static int iso_week_days (int, int);
 #ifdef __GNUC__
 __inline__
 #endif
@@ -401,17 +407,41 @@ iso_week_days (int yday, int wday)
 # define ns 0
 #endif
 
+static size_t __strftime_internal (STREAM_OR_CHAR_T *, STRFTIME_ARG (size_t)
+                                   const CHAR_T *, const struct tm *,
+                                   bool, bool *
+                                   extra_args_spec LOCALE_PARAM);
 
-/* Just like my_strftime, below, but with one more parameter, UPCASE,
-   to indicate that the result should be converted to upper case.  */
+/* Write information from TP into S according to the format
+   string FORMAT, writing no more that MAXSIZE characters
+   (including the terminating '\0') and returning number of
+   characters written.  If S is NULL, nothing will be written
+   anywhere, so to determine how many characters would be
+   written, use NULL for S and (size_t) -1 for MAXSIZE.  */
+size_t
+my_strftime (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
+             const CHAR_T *format,
+             const struct tm *tp extra_args_spec LOCALE_PARAM)
+{
+  bool tzset_called = false;
+  return __strftime_internal (s, STRFTIME_ARG (maxsize) format, tp,
+                              false, &tzset_called extra_args LOCALE_ARG);
+}
+#if defined _LIBC && ! FPRINTFTIME
+libc_hidden_def (my_strftime)
+#endif
+
+/* Just like my_strftime, above, but with two more parameters.
+   UPCASE indicate that the result should be converted to upper case,
+   and *TZSET_CALLED indicates whether tzset has been called here.  */
 static size_t
-strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
-                STRFTIME_ARG (size_t maxsize)
-                const CHAR_T *format,
-                const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO)
+__strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
+                     const CHAR_T *format,
+                     const struct tm *tp, bool upcase, bool *tzset_called
+                     extra_args_spec LOCALE_PARAM)
 {
 #if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL
-  struct locale_data *const current = loc->__locales[LC_TIME];
+  struct __locale_data *const current = loc->__locales[LC_TIME];
 #endif
 #if FPRINTFTIME
   size_t maxsize = (size_t) -1;
@@ -426,13 +456,17 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
      only a few elements.  Dereference the pointers only if the format
      requires this.  Then it is ok to fail if the pointers are invalid.  */
 # define a_wkday \
-  ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + tp->tm_wday))
+  ((const CHAR_T *) (tp->tm_wday < 0 || tp->tm_wday > 6                      \
+                     ? "?" : _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + 
tp->tm_wday)))
 # define f_wkday \
-  ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday))
+  ((const CHAR_T *) (tp->tm_wday < 0 || tp->tm_wday > 6                      \
+                     ? "?" : _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday)))
 # define a_month \
-  ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon))
+  ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11                       \
+                     ? "?" : _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon)))
 # define f_month \
-  ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon))
+  ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11                       \
+                     ? "?" : _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon)))
 # define ampm \
   ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11                    \
                                  ? NLW(PM_STR) : NLW(AM_STR)))
@@ -483,15 +517,21 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
       /* Infer the zone name from *TZ instead of from TZNAME.  */
       tzname_vec = tz->tzname_copy;
 # endif
+    }
+  /* The tzset() call might have changed the value.  */
+  if (!(zone && *zone) && tp->tm_isdst >= 0)
+    {
       /* POSIX.1 requires that local time zone information be used as
          though strftime called tzset.  */
 # if HAVE_TZSET
-      tzset ();
+      if (!*tzset_called)
+        {
+          tzset ();
+          *tzset_called = true;
+        }
 # endif
+      zone = tzname_vec[tp->tm_isdst != 0];
     }
-  /* The tzset() call might have changed the value.  */
-  if (!(zone && *zone) && tp->tm_isdst >= 0)
-    zone = tzname_vec[tp->tm_isdst != 0];
 #endif
   if (! zone)
     zone = "";
@@ -699,11 +739,10 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
           /* The mask is not what you might think.
              When the ordinal i'th bit is set, insert a colon
              before the i'th digit of the time zone representation.  */
-#define DO_TZ_OFFSET(d, negative, mask, v) \
+#define DO_TZ_OFFSET(d, mask, v) \
           do                                                                  \
             {                                                                 \
               digits = d;                                                     \
-              negative_number = negative;                                     \
               tz_colon_mask = mask;                                           \
               u_number_value = v;                                             \
               goto do_tz_offset;                                              \
@@ -801,14 +840,15 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
 
         subformat:
           {
-            size_t len = strftime_case_ (to_uppcase,
-                                         NULL, STRFTIME_ARG ((size_t) -1)
-                                         subfmt,
-                                         tp extra_args LOCALE_ARG);
-            add (len, strftime_case_ (to_uppcase, p,
-                                      STRFTIME_ARG (maxsize - i)
-                                      subfmt,
-                                      tp extra_args LOCALE_ARG));
+            size_t len = __strftime_internal (NULL, STRFTIME_ARG ((size_t) -1)
+                                              subfmt,
+                                              tp, to_uppcase, tzset_called
+                                              extra_args LOCALE_ARG);
+            add (len, __strftime_internal (p,
+                                           STRFTIME_ARG (maxsize - i)
+                                           subfmt,
+                                           tp, to_uppcase, tzset_called
+                                           extra_args LOCALE_ARG));
           }
           break;
 
@@ -845,8 +885,6 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
 #endif
 
         case L_('C'):
-          if (modifier == L_('O'))
-            goto bad_format;
           if (modifier == L_('E'))
             {
 #if HAVE_STRUCT_ERA_ENTRY
@@ -1115,6 +1153,10 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
           goto underlying_strftime;
 #endif
 
+        case L_('q'):           /* GNU extension.  */
+          DO_SIGNED_NUMBER (1, false, ((tp->tm_mon * 11) >> 5) + 1);
+          break;
+
         case L_('R'):
           subfmt = L_("%H:%M");
           goto subformat;
@@ -1364,6 +1406,16 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
                 struct tm ltm;
                 time_t lt;
 
+                /* POSIX.1 requires that local time zone information be used as
+                   though strftime called tzset.  */
+# if HAVE_TZSET
+                if (!*tzset_called)
+                  {
+                    tzset ();
+                    *tzset_called = true;
+                  }
+# endif
+
                 ltm = *tp;
                 lt = mktime_z (tz, &ltm);
 
@@ -1391,6 +1443,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
               }
 #endif
 
+            negative_number = diff < 0 || (diff == 0 && *zone == '-');
             hour_diff = diff / 60 / 60;
             min_diff = diff / 60 % 60;
             sec_diff = diff % 60;
@@ -1398,13 +1451,13 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
             switch (colons)
               {
               case 0: /* +hhmm */
-                DO_TZ_OFFSET (5, diff < 0, 0, hour_diff * 100 + min_diff);
+                DO_TZ_OFFSET (5, 0, hour_diff * 100 + min_diff);
 
               case 1: tz_hh_mm: /* +hh:mm */
-                DO_TZ_OFFSET (6, diff < 0, 04, hour_diff * 100 + min_diff);
+                DO_TZ_OFFSET (6, 04, hour_diff * 100 + min_diff);
 
               case 2: tz_hh_mm_ss: /* +hh:mm:ss */
-                DO_TZ_OFFSET (9, diff < 0, 024,
+                DO_TZ_OFFSET (9, 024,
                               hour_diff * 10000 + min_diff * 100 + sec_diff);
 
               case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */
@@ -1412,7 +1465,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
                   goto tz_hh_mm_ss;
                 if (min_diff != 0)
                   goto tz_hh_mm;
-                DO_TZ_OFFSET (3, diff < 0, 0, hour_diff);
+                DO_TZ_OFFSET (3, 0, hour_diff);
 
               default:
                 goto bad_format;
@@ -1444,22 +1497,3 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
 
   return i;
 }
-
-/* Write information from TP into S according to the format
-   string FORMAT, writing no more that MAXSIZE characters
-   (including the terminating '\0') and returning number of
-   characters written.  If S is NULL, nothing will be written
-   anywhere, so to determine how many characters would be
-   written, use NULL for S and (size_t) -1 for MAXSIZE.  */
-size_t
-my_strftime (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
-             const CHAR_T *format,
-             const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO)
-{
-  return strftime_case_ (false, s, STRFTIME_ARG (maxsize)
-                         format, tp extra_args LOCALE_ARG);
-}
-
-#if defined _LIBC && ! FPRINTFTIME
-libc_hidden_def (my_strftime)
-#endif
diff --git a/lib/strftime.h b/lib/strftime.h
index 9247af6..5238988 100644
--- a/lib/strftime.h
+++ b/lib/strftime.h
@@ -1,6 +1,6 @@
 /* declarations for strftime.c
 
-   Copyright (C) 2002, 2004, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2008-2017 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
diff --git a/lib/striconveh.c b/lib/striconveh.c
index 23a0718..5aec9bb 100644
--- a/lib/striconveh.c
+++ b/lib/striconveh.c
@@ -1,5 +1,5 @@
 /* Character set conversion with error handling.
-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2017 Free Software Foundation, Inc.
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/striconveh.h b/lib/striconveh.h
index a6fe7cf..0109ebd 100644
--- a/lib/striconveh.h
+++ b/lib/striconveh.h
@@ -1,5 +1,5 @@
 /* Character set conversion with error handling.
-   Copyright (C) 2001-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2009-2017 Free Software Foundation, Inc.
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/string.in.h b/lib/string.in.h
index 94019c6..c0d5178 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2017 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
@@ -416,15 +416,15 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - "
 #   undef strndup
 #   define strndup rpl_strndup
 #  endif
-_GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n)
+_GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n)
                                    _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
+_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n));
 # else
 #  if ! @HAVE_DECL_STRNDUP@
-_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
+_GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n)
                                    _GL_ARG_NONNULL ((1)));
 #  endif
-_GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n));
+_GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n));
 # endif
 _GL_CXXALIASWARN (strndup);
 #elif defined GNULIB_POSIXCHECK
@@ -444,17 +444,17 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - "
 #   undef strnlen
 #   define strnlen rpl_strnlen
 #  endif
-_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)
                                    _GL_ATTRIBUTE_PURE
                                    _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
+_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen));
 # else
 #  if ! @HAVE_DECL_STRNLEN@
-_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
+_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)
                                    _GL_ATTRIBUTE_PURE
                                    _GL_ARG_NONNULL ((1)));
 #  endif
-_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
+_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__s, size_t __maxlen));
 # endif
 _GL_CXXALIASWARN (strnlen);
 #elif defined GNULIB_POSIXCHECK
diff --git a/lib/stripslash.c b/lib/stripslash.c
index 809ab7a..ec2e05e 100644
--- a/lib/stripslash.c
+++ b/lib/stripslash.c
@@ -1,6 +1,6 @@
 /* stripslash.c -- remove redundant trailing slashes from a file name
 
-   Copyright (C) 1990, 2001, 2003-2006, 2009-2016 Free Software Foundation,
+   Copyright (C) 1990, 2001, 2003-2006, 2009-2017 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/sys_file.in.h b/lib/sys_file.in.h
index 9973c27..26dec1d 100644
--- a/lib/sys_file.in.h
+++ b/lib/sys_file.in.h
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/file.h.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index 53e318a..cba4b41 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -1,5 +1,5 @@
 /* Substitute for <sys/select.h>.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h
index 26024f6..841b413 100644
--- a/lib/sys_socket.in.h
+++ b/lib/sys_socket.in.h
@@ -1,6 +1,6 @@
 /* Provide a sys/socket header file for systems lacking it (read: MinGW)
    and for systems where it is incomplete.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -79,7 +79,12 @@ _GL_INLINE_HEADER_BEGIN
 
 #if address@hidden@
 # if !GNULIB_defined_sa_family_t
+/* On OS/2 kLIBC, sa_family_t is unsigned char unless TCPV40HDRS is defined. */
+#  if !defined __KLIBC__ || defined TCPV40HDRS
 typedef unsigned short  sa_family_t;
+#  else
+typedef unsigned char   sa_family_t;
+#  endif
 #  define GNULIB_defined_sa_family_t 1
 # endif
 #endif
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 2d06395..72c465d 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -1,5 +1,5 @@
 /* Provide a more complete sys/stat header file.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2017 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
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index e1e26e3..f141b52 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/time.h.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
@@ -109,6 +109,13 @@ _GL_CXXALIAS_SYS_CAST (gettimeofday, int,
                        (struct timeval *restrict, void *restrict));
 # endif
 _GL_CXXALIASWARN (gettimeofday);
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+namespace GNULIB_NAMESPACE {
+  typedef ::timeval
+#undef timeval
+    timeval;
+}
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef gettimeofday
 # if HAVE_RAW_DECL_GETTIMEOFDAY
diff --git a/lib/sys_times.in.h b/lib/sys_times.in.h
index 693eede..d98ca11 100644
--- a/lib/sys_times.in.h
+++ b/lib/sys_times.in.h
@@ -1,5 +1,5 @@
 /* Provide a sys/times.h header file.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h
index 9ca53ac..78d8fae 100644
--- a/lib/sys_types.in.h
+++ b/lib/sys_types.in.h
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/types.h.
 
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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
diff --git a/lib/sys_uio.in.h b/lib/sys_uio.in.h
index d72eb56..ec57b7c 100644
--- a/lib/sys_uio.in.h
+++ b/lib/sys_uio.in.h
@@ -1,5 +1,5 @@
 /* Substitute for <sys/uio.h>.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2017 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
diff --git a/lib/tempname.c b/lib/tempname.c
index 5136bb4..f6436a9 100644
--- a/lib/tempname.c
+++ b/lib/tempname.c
@@ -1,6 +1,6 @@
 /* tempname.c - generate the name of a temporary file.
 
-   Copyright (C) 1991-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1991-2003, 2005-2007, 2009-2017 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
diff --git a/lib/tempname.h b/lib/tempname.h
index 4e03288..5b740e8 100644
--- a/lib/tempname.h
+++ b/lib/tempname.h
@@ -1,6 +1,6 @@
 /* Create a temporary file or directory.
 
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2017 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
diff --git a/lib/time-internal.h b/lib/time-internal.h
index 48c0977..375e134 100644
--- a/lib/time-internal.h
+++ b/lib/time-internal.h
@@ -1,6 +1,6 @@
 /* Time internal interface
 
-   Copyright 2015-2016 Free Software Foundation, Inc.
+   Copyright 2015-2017 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
@@ -38,8 +38,8 @@ struct tm_zone
   /* A sequence of null-terminated strings packed next to each other.
      The strings are followed by an extra null byte.  If TZ_IS_SET,
      there must be at least one string and the first string (which is
-     actually a TZ environment value value) may be empty.  Otherwise
-     all strings must be nonempty.
+     actually a TZ environment value) may be empty.  Otherwise all
+     strings must be nonempty.
 
      Abbreviations are stored here because otherwise the values of
      tm_zone and/or tzname would be dead after changing TZ and calling
diff --git a/lib/time.in.h b/lib/time.in.h
index 503085a..296ea51 100644
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -1,6 +1,6 @@
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
@@ -217,7 +217,7 @@ _GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const 
*__timer));
 _GL_CXXALIASWARN (gmtime);
 # endif
 
-/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
+/* Parse BUF as a timestamp, assuming FORMAT specifies its layout, and store
    the resulting broken-down time into TM.  See
    <http://www.opengroup.org/susv3xsh/strptime.html>.  */
 # if @GNULIB_STRPTIME@
diff --git a/lib/time_r.c b/lib/time_r.c
index 34ced96..7de3e3a 100644
--- a/lib/time_r.c
+++ b/lib/time_r.c
@@ -1,6 +1,6 @@
 /* Reentrant time functions like localtime_r.
 
-   Copyright (C) 2003, 2006-2007, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2010-2017 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
diff --git a/lib/time_rz.c b/lib/time_rz.c
index 612093b..c6e6083 100644
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -1,6 +1,6 @@
 /* Time zone functions such as tzalloc and localtime_rz
 
-   Copyright 2015-2016 Free Software Foundation, Inc.
+   Copyright 2015-2017 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
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "flexmember.h"
 #include "time-internal.h"
 
 #if !HAVE_TZSET
@@ -94,7 +95,7 @@ tzalloc (char const *name)
 {
   size_t name_size = name ? strlen (name) + 1 : 0;
   size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1;
-  timezone_t tz = malloc (offsetof (struct tm_zone, abbrs) + abbr_size);
+  timezone_t tz = malloc (FLEXSIZEOF (struct tm_zone, abbrs, abbr_size));
   if (tz)
     {
       tz->next = NULL;
diff --git a/lib/timegm.c b/lib/timegm.c
index 112be1a..168da8e 100644
--- a/lib/timegm.c
+++ b/lib/timegm.c
@@ -1,6 +1,6 @@
 /* Convert UTC calendar time to simple time.  Like mktime but assumes UTC.
 
-   Copyright (C) 1994, 1997, 2003-2004, 2006-2007, 2009-2016 Free Software
+   Copyright (C) 1994, 1997, 2003-2004, 2006-2007, 2009-2017 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
diff --git a/lib/times.c b/lib/times.c
index 4fa15c2..f403e3d 100644
--- a/lib/times.c
+++ b/lib/times.c
@@ -1,6 +1,6 @@
 /* Get process times
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/trunc.c b/lib/trunc.c
index eba389a..f110f46 100644
--- a/lib/trunc.c
+++ b/lib/trunc.c
@@ -1,5 +1,5 @@
 /* Round towards zero.
-   Copyright (C) 2007, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2010-2017 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
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 26b73a8..2f862c8 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2017 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
@@ -55,9 +55,13 @@
 #include <stddef.h>
 
 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>.  */
+/* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>.  We must include
+   it before we  #define unlink rpl_unlink.  */
 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
+     || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
+         && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \
      || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
          && defined __CYGWIN__)) \
     && ! defined __GLIBC__
@@ -776,7 +780,7 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
      ${LOGNAME-$USER}        on Unix platforms,
      $USERNAME               on native Windows platforms.
  */
-# if address@hidden@
+# if address@hidden@
 _GL_FUNCDECL_SYS (getlogin, char *, (void));
 # endif
 _GL_CXXALIAS_SYS (getlogin, char *, (void));
diff --git a/lib/unsetenv.c b/lib/unsetenv.c
index e94ea8f..7081193 100644
--- a/lib/unsetenv.c
+++ b/lib/unsetenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2002, 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2002, 2005-2017 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
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index e31dbad..412219b 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2017 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
@@ -4832,9 +4832,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     break;
 # else
                     *fbp++ = 'l';
-                    /*FALLTHROUGH*/
 # endif
 #endif
+                    /*FALLTHROUGH*/
                   case TYPE_LONGINT:
                   case TYPE_ULONGINT:
 #if HAVE_WINT_T
diff --git a/lib/vasnprintf.h b/lib/vasnprintf.h
index 47216c4..3631ff8 100644
--- a/lib/vasnprintf.h
+++ b/lib/vasnprintf.h
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2017 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
diff --git a/lib/verify.h b/lib/verify.h
index 356c7fa..2d996ad 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2017 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
@@ -248,7 +248,12 @@ template <int w>
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+#ifdef __GNUC__
+# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+#else
+/* PGI barfs if R is long.  Play it safe.  */
+# define verify(R) _GL_VERIFY (R, "verify (...)")
+#endif
 
 #ifndef __has_builtin
 # define __has_builtin(x) 0
diff --git a/lib/vsnprintf.c b/lib/vsnprintf.c
index af05174..2014ce9 100644
--- a/lib/vsnprintf.c
+++ b/lib/vsnprintf.c
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2017 Free Software Foundation, Inc.
    Written by Simon Josefsson and Yoann Vandoorselaere <address@hidden>.
 
    This program is free software; you can redistribute it and/or modify
diff --git a/lib/w32sock.h b/lib/w32sock.h
index f9506b7..9c55e5a 100644
--- a/lib/w32sock.h
+++ b/lib/w32sock.h
@@ -1,6 +1,6 @@
 /* w32sock.h --- internal auxiliary functions for Windows socket functions
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 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
diff --git a/lib/wchar.in.h b/lib/wchar.in.h
index 7d1aa16..9f2fbc6 100644
--- a/lib/wchar.in.h
+++ b/lib/wchar.in.h
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2017 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
@@ -35,6 +35,7 @@
      || (defined __hpux                                                 \
          && ((defined _INTTYPES_INCLUDED && !defined strtoimax)         \
              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
+     || (defined __MINGW32__ && defined __STRING_H_SOURCED__)           \
      || defined _GL_ALREADY_INCLUDING_WCHAR_H)
 /* Special invocation convention:
    - Inside glibc and uClibc header files, but not MinGW.
@@ -44,6 +45,8 @@
      and once directly.  In both situations 'wint_t' is not yet defined,
      therefore we cannot provide the function overrides; instead include only
      the system's <wchar.h>.
+   - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
+     <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
    - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
      the latter includes <wchar.h>.  But here, we have no way to detect whether
      <wctype.h> is completely included or is still being included.  */
@@ -110,10 +113,10 @@
 #  define WEOF -1
 # endif
 #else
-/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h>.
    This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
    "unchanged by default argument promotions".  Override it.  */
-# if defined _MSC_VER
+# if @GNULIB_OVERRIDES_WINT_T@
 #  if !GNULIB_defined_wint_t
 #   include <crtdefs.h>
 typedef unsigned int rpl_wint_t;
diff --git a/lib/wcrtomb.c b/lib/wcrtomb.c
index d6cc58a..ee5906c 100644
--- a/lib/wcrtomb.c
+++ b/lib/wcrtomb.c
@@ -1,5 +1,5 @@
 /* Convert wide character to multibyte character.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/wctype.in.h b/lib/wctype.in.h
index 3d889f0..f4c7c01 100644
--- a/lib/wctype.in.h
+++ b/lib/wctype.in.h
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2017 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
@@ -25,13 +25,25 @@
  * wctrans_t, and wctype_t are not yet implemented.
  */
 
-#ifndef address@hidden@_WCTYPE_H
-
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
+#if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__)
+
+/* Special invocation convention:
+   - With MinGW 3.22, when <ctype.h> includes <wctype.h>, only some part of
+     <wctype.h> is being processed, which doesn't include the idempotency
+     guard.   */
+
address@hidden@ @NEXT_WCTYPE_H@
+
+#else
+/* Normal invocation convention.  */
+
+#ifndef address@hidden@_WCTYPE_H
+
 #if @HAVE_WINT_T@
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
    Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
@@ -93,10 +105,10 @@ _GL_INLINE_HEADER_BEGIN
 #  define WEOF -1
 # endif
 #else
-/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h>.
    This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
    "unchanged by default argument promotions".  Override it.  */
-# if defined _MSC_VER
+# if @GNULIB_OVERRIDES_WINT_T@
 #  if !GNULIB_defined_wint_t
 #   include <crtdefs.h>
 typedef unsigned int rpl_wint_t;
@@ -512,3 +524,4 @@ _GL_INLINE_HEADER_END
 
 #endif /* address@hidden@_WCTYPE_H */
 #endif /* address@hidden@_WCTYPE_H */
+#endif
diff --git a/lib/write.c b/lib/write.c
index e3cd35a..c451a50 100644
--- a/lib/write.c
+++ b/lib/write.c
@@ -1,5 +1,5 @@
 /* POSIX compatible write() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2008.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/xalloc-oversized.h b/lib/xalloc-oversized.h
new file mode 100644
index 0000000..1b92a58
--- /dev/null
+++ b/lib/xalloc-oversized.h
@@ -0,0 +1,60 @@
+/* xalloc-oversized.h -- memory allocation size checking
+
+   Copyright (C) 1990-2000, 2003-2004, 2006-2017 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
+   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 Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef XALLOC_OVERSIZED_H_
+#define XALLOC_OVERSIZED_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+/* True if N * S would overflow in a size_t calculation,
+   or would generate a value larger than PTRDIFF_MAX.
+   This expands to a constant expression if N and S are both constants.
+   By gnulib convention, SIZE_MAX represents overflow in size
+   calculations, so the conservative size_t-based dividend to use here
+   is SIZE_MAX - 1.  */
+#define __xalloc_oversized(n, s) \
+  ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) < (n))
+
+#if PTRDIFF_MAX < SIZE_MAX
+typedef ptrdiff_t __xalloc_count_type;
+#else
+typedef size_t __xalloc_count_type;
+#endif
+
+/* Return 1 if an array of N objects, each of size S, cannot exist
+   reliably due to size or ptrdiff_t arithmetic overflow.  S must be
+   positive and N must be nonnegative.  This is a macro, not a
+   function, so that it works correctly even when SIZE_MAX < N.  */
+
+#if 7 <= __GNUC__
+# define xalloc_oversized(n, s) \
+   __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
+#elif 5 <= __GNUC__ && !__STRICT_ANSI__
+# define xalloc_oversized(n, s) \
+   (__builtin_constant_p (n) && __builtin_constant_p (s) \
+    ? __xalloc_oversized (n, s) \
+    : ({ __xalloc_count_type __xalloc_count; \
+         __builtin_mul_overflow (n, s, &__xalloc_count); }))
+
+/* Other compilers use integer division; this may be slower but is
+   more portable.  */
+#else
+# define xalloc_oversized(n, s) __xalloc_oversized (n, s)
+#endif
+
+#endif /* !XALLOC_OVERSIZED_H_ */
diff --git a/lib/xsize.h b/lib/xsize.h
index 840d682..d787671 100644
--- a/lib/xsize.h
+++ b/lib/xsize.h
@@ -1,6 +1,6 @@
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008-2017 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
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4
index bb37e32..bb3512f 100644
--- a/m4/00gnulib.m4
+++ b/m4/00gnulib.m4
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 3
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4
index 7ffc38d..c73adc8 100644
--- a/m4/absolute-header.m4
+++ b/m4/absolute-header.m4
@@ -1,5 +1,5 @@
 # absolute-header.m4 serial 16
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index 2382ff1..7f0604c 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,5 +1,5 @@
 # alloca.m4 serial 14
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2017 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4
index 5387f28..d655455 100644
--- a/m4/arpa_inet_h.m4
+++ b/m4/arpa_inet_h.m4
@@ -1,5 +1,5 @@
 # arpa_inet_h.m4 serial 13
-dnl Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2017 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.
diff --git a/m4/autobuild.m4 b/m4/autobuild.m4
index 66b183b..f5f2a18 100644
--- a/m4/autobuild.m4
+++ b/m4/autobuild.m4
@@ -1,5 +1,5 @@
 # autobuild.m4 serial 7
-dnl Copyright (C) 2004, 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006-2017 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.
diff --git a/m4/btowc.m4 b/m4/btowc.m4
index 47e8fd8..1021809 100644
--- a/m4/btowc.m4
+++ b/m4/btowc.m4
@@ -1,5 +1,5 @@
 # btowc.m4 serial 10
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/builtin-expect.m4 b/m4/builtin-expect.m4
new file mode 100644
index 0000000..aa3364b
--- /dev/null
+++ b/m4/builtin-expect.m4
@@ -0,0 +1,49 @@
+dnl Check for __builtin_expect.
+
+dnl Copyright 2016-2017 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.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl___BUILTIN_EXPECT],
+[
+  AC_CACHE_CHECK([for __builtin_expect],
+    [gl_cv___builtin_expect],
+    [AC_LINK_IFELSE(
+       [AC_LANG_SOURCE([[
+         int
+         main (int argc, char **argv)
+         {
+           argc = __builtin_expect (argc, 100);
+           return argv[argc != 100][0];
+         }]])],
+       [gl_cv___builtin_expect=yes],
+       [AC_LINK_IFELSE(
+          [AC_LANG_SOURCE([[
+             #include <builtins.h>
+             int
+             main (int argc, char **argv)
+             {
+               argc = __builtin_expect (argc, 100);
+               return argv[argc != 100][0];
+             }]])],
+          [gl_cv___builtin_expect="in <builtins.h>"],
+          [gl_cv___builtin_expect=no])])])
+  if test "$gl_cv___builtin_expect" = yes; then
+    AC_DEFINE([HAVE___BUILTIN_EXPECT], [1])
+  elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
+    AC_DEFINE([HAVE___BUILTIN_EXPECT], [2])
+  fi
+  AH_VERBATIM([HAVE___BUILTIN_EXPECT],
+    [/* Define to 1 if the compiler supports __builtin_expect,
+   and to 2 if <builtins.h> does.  */
+#undef HAVE___BUILTIN_EXPECT
+#ifndef HAVE___BUILTIN_EXPECT
+# define __builtin_expect(e, c) (e)
+#elif HAVE___BUILTIN_EXPECT == 2
+# include <builtins.h>
+#endif
+    ])
+])
diff --git a/m4/byteswap.m4 b/m4/byteswap.m4
index 27f0fd6..f20d0f4 100644
--- a/m4/byteswap.m4
+++ b/m4/byteswap.m4
@@ -1,5 +1,5 @@
 # byteswap.m4 serial 4
-dnl Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2017 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.
diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4
index cbbf3e2..c04ff8d 100644
--- a/m4/canonicalize.m4
+++ b/m4/canonicalize.m4
@@ -1,6 +1,6 @@
 # canonicalize.m4 serial 28
 
-dnl Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc.
 
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/ceil.m4 b/m4/ceil.m4
index 214e565..f58a998 100644
--- a/m4/ceil.m4
+++ b/m4/ceil.m4
@@ -1,5 +1,5 @@
 # ceil.m4 serial 9
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.
diff --git a/m4/check-math-lib.m4 b/m4/check-math-lib.m4
index 58af051..8241eed 100644
--- a/m4/check-math-lib.m4
+++ b/m4/check-math-lib.m4
@@ -1,5 +1,5 @@
 # check-math-lib.m4 serial 4
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.
diff --git a/m4/clock_time.m4 b/m4/clock_time.m4
index beace12..12d95ff 100644
--- a/m4/clock_time.m4
+++ b/m4/clock_time.m4
@@ -1,5 +1,5 @@
 # clock_time.m4 serial 10
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2017 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.
diff --git a/m4/close.m4 b/m4/close.m4
index 310f076..005a43a 100644
--- a/m4/close.m4
+++ b/m4/close.m4
@@ -1,5 +1,5 @@
 # close.m4 serial 8
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/configmake.m4 b/m4/configmake.m4
index 80b9254..b783296 100644
--- a/m4/configmake.m4
+++ b/m4/configmake.m4
@@ -1,5 +1,5 @@
 # configmake.m4 serial 2
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.
diff --git a/m4/copysign.m4 b/m4/copysign.m4
index fd1f7be..a39de01 100644
--- a/m4/copysign.m4
+++ b/m4/copysign.m4
@@ -1,5 +1,5 @@
 # copysign.m4 serial 1
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.
diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4
index 68836a4..1f9c4f3 100644
--- a/m4/dirent_h.m4
+++ b/m4/dirent_h.m4
@@ -1,5 +1,5 @@
 # dirent_h.m4 serial 16
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index 1d7cb08..b4ec3d1 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -2,7 +2,7 @@
 
 dnl Find out how to get the file descriptor associated with an open DIR*.
 
-# Copyright (C) 2001-2006, 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001-2006, 2008-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/dirname.m4 b/m4/dirname.m4
index 6f8bec3..46f5394 100644
--- a/m4/dirname.m4
+++ b/m4/dirname.m4
@@ -1,5 +1,5 @@
 #serial 10   -*- autoconf -*-
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2017 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.
diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4
index dfd3921..c80f9ea 100644
--- a/m4/double-slash-root.m4
+++ b/m4/double-slash-root.m4
@@ -1,5 +1,5 @@
 # double-slash-root.m4 serial 4   -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2017 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.
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index 5b68312..bdb9ae2 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,5 +1,5 @@
 #serial 25
-dnl Copyright (C) 2002, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005, 2007, 2009-2017 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.
diff --git a/m4/duplocale.m4 b/m4/duplocale.m4
index fcf9d39..b5efd24 100644
--- a/m4/duplocale.m4
+++ b/m4/duplocale.m4
@@ -1,5 +1,5 @@
 # duplocale.m4 serial 8
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/eealloc.m4 b/m4/eealloc.m4
index 63d74de..96b9bca 100644
--- a/m4/eealloc.m4
+++ b/m4/eealloc.m4
@@ -1,5 +1,5 @@
 # eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2017 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.
diff --git a/m4/environ.m4 b/m4/environ.m4
index 9a0ea7e..3b9fa5f 100644
--- a/m4/environ.m4
+++ b/m4/environ.m4
@@ -1,5 +1,5 @@
 # environ.m4 serial 6
-dnl Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2004, 2006-2017 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.
diff --git a/m4/errno_h.m4 b/m4/errno_h.m4
index b111fce..9f0f2f2 100644
--- a/m4/errno_h.m4
+++ b/m4/errno_h.m4
@@ -1,5 +1,5 @@
 # errno_h.m4 serial 12
-dnl Copyright (C) 2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2008-2017 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.
diff --git a/m4/exponentd.m4 b/m4/exponentd.m4
index 7869a7d..cd64b92 100644
--- a/m4/exponentd.m4
+++ b/m4/exponentd.m4
@@ -1,5 +1,5 @@
 # exponentd.m4 serial 3
-dnl Copyright (C) 2007-2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-2017 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.
diff --git a/m4/exponentf.m4 b/m4/exponentf.m4
index d4298f2..54f609e 100644
--- a/m4/exponentf.m4
+++ b/m4/exponentf.m4
@@ -1,5 +1,5 @@
 # exponentf.m4 serial 2
-dnl Copyright (C) 2007-2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-2017 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.
diff --git a/m4/exponentl.m4 b/m4/exponentl.m4
index c49cf2c..c9cb81d 100644
--- a/m4/exponentl.m4
+++ b/m4/exponentl.m4
@@ -1,5 +1,5 @@
 # exponentl.m4 serial 3
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index 6d378ec..c60f537 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,7 +1,7 @@
-# serial 13  -*- Autoconf -*-
+# serial 15  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -60,7 +60,7 @@ dnl configure.ac when using autoheader 2.62.
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-/* Enable general extensions on OS X.  */
+/* Enable general extensions on macOS.  */
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
@@ -68,14 +68,38 @@ dnl configure.ac when using autoheader 2.62.
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
-/* Use GNU style printf and scanf.  */
-#ifndef __USE_MINGW_ANSI_STDIO
-# undef __USE_MINGW_ANSI_STDIO
-#endif
 /* Enable threading extensions on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
+/* Enable extensions specified by ISO/IEC TS 18661-5:2014.  */
+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-1:2014.  */
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+# undef __STDC_WANT_IEC_60559_BFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-2:2015.  */
+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
+# undef __STDC_WANT_IEC_60559_DFP_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-4:2015.  */
+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
+# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TS 18661-3:2015.  */
+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
+# undef __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+/* Enable extensions specified by ISO/IEC TR 24731-2:2010.  */
+#ifndef __STDC_WANT_LIB_EXT2__
+# undef __STDC_WANT_LIB_EXT2__
+#endif
+/* Enable extensions specified by ISO/IEC 24747:2009.  */
+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
+# undef __STDC_WANT_MATH_SPEC_FUNCS__
+#endif
 /* Enable extensions on HP NonStop.  */
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
@@ -104,8 +128,14 @@ dnl configure.ac when using autoheader 2.62.
   AC_DEFINE([_ALL_SOURCE])
   AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
-  AC_DEFINE([__USE_MINGW_ANSI_STDIO])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+  AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__])
+  AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__])
+  AC_DEFINE([__STDC_WANT_LIB_EXT2__])
+  AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
   AC_DEFINE([_TANDEM_SOURCE])
   AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
     [ac_cv_should_define__xopen_source],
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 1e578f3..00f9609 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -1,6 +1,6 @@
 dnl 'extern inline' a la ISO C99.
 
-dnl Copyright 2012-2016 Free Software Foundation, Inc.
+dnl Copyright 2012-2017 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.
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
index 24fcf88..3c3b63c 100644
--- a/m4/fcntl-o.m4
+++ b/m4/fcntl-o.m4
@@ -1,5 +1,5 @@
 # fcntl-o.m4 serial 4
-dnl Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2017 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.
diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4
index ef0d78d..09c21ef 100644
--- a/m4/fcntl_h.m4
+++ b/m4/fcntl_h.m4
@@ -1,6 +1,6 @@
 # serial 15
 # Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2017 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.
diff --git a/m4/flexmember.m4 b/m4/flexmember.m4
index baa9ff8..35580ac 100644
--- a/m4/flexmember.m4
+++ b/m4/flexmember.m4
@@ -1,7 +1,7 @@
-# serial 3
+# serial 4
 # Check for flexible array member support.
 
-# Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -19,8 +19,10 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
             #include <stddef.h>
             struct s { int n; double d[]; };]],
           [[int m = getchar ();
-            struct s *p = malloc (offsetof (struct s, d)
-                                  + m * sizeof (double));
+            size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
+            nbytes += sizeof (struct s) - 1;
+            nbytes -= nbytes % sizeof (struct s);
+            struct s *p = malloc (nbytes);
             p->d[0] = 0.0;
             return p->d != (double *) NULL;]])],
        [ac_cv_c_flexmember=yes],
diff --git a/m4/float_h.m4 b/m4/float_h.m4
index e2887eb..e8522ab 100644
--- a/m4/float_h.m4
+++ b/m4/float_h.m4
@@ -1,5 +1,5 @@
 # float_h.m4 serial 9
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.
diff --git a/m4/flock.m4 b/m4/flock.m4
index 01b38b7..5b3544d 100644
--- a/m4/flock.m4
+++ b/m4/flock.m4
@@ -1,5 +1,5 @@
 # flock.m4 serial 3
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/floor.m4 b/m4/floor.m4
index cd89505..713e7b3 100644
--- a/m4/floor.m4
+++ b/m4/floor.m4
@@ -1,5 +1,5 @@
 # floor.m4 serial 8
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.
diff --git a/m4/fpieee.m4 b/m4/fpieee.m4
index e11ac9f..69579d8 100644
--- a/m4/fpieee.m4
+++ b/m4/fpieee.m4
@@ -1,5 +1,5 @@
 # fpieee.m4 serial 2  -*- coding: utf-8 -*-
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.
diff --git a/m4/frexp.m4 b/m4/frexp.m4
index 23f5821..73f50b3 100644
--- a/m4/frexp.m4
+++ b/m4/frexp.m4
@@ -1,5 +1,5 @@
 # frexp.m4 serial 15
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/fstat.m4 b/m4/fstat.m4
index 29f9b81..14c871a 100644
--- a/m4/fstat.m4
+++ b/m4/fstat.m4
@@ -1,5 +1,5 @@
 # fstat.m4 serial 4
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.
diff --git a/m4/fsync.m4 b/m4/fsync.m4
index 405d43d..f1399de 100644
--- a/m4/fsync.m4
+++ b/m4/fsync.m4
@@ -1,5 +1,5 @@
 # fsync.m4 serial 2
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/func.m4 b/m4/func.m4
index f537b15..bd429ee 100644
--- a/m4/func.m4
+++ b/m4/func.m4
@@ -1,5 +1,5 @@
 # func.m4 serial 2
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4
index 2af1e01..f5e2284 100644
--- a/m4/getaddrinfo.m4
+++ b/m4/getaddrinfo.m4
@@ -1,5 +1,5 @@
-# getaddrinfo.m4 serial 30
-dnl Copyright (C) 2004-2016 Free Software Foundation, Inc.
+# getaddrinfo.m4 serial 31
+dnl Copyright (C) 2004-2017 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.
@@ -8,7 +8,7 @@ AC_DEFUN([gl_GETADDRINFO],
 [
   AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
   AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H
-  AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
+  AC_MSG_CHECKING([how to do getaddrinfo, freeaddrinfo and getnameinfo])
   GETADDRINFO_LIB=
   gai_saved_LIBS="$LIBS"
 
diff --git a/m4/getlogin.m4 b/m4/getlogin.m4
index b3b2655..c013fdd 100644
--- a/m4/getlogin.m4
+++ b/m4/getlogin.m4
@@ -1,5 +1,5 @@
-# getlogin.m4 serial 3
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+# getlogin.m4 serial 5
+dnl Copyright (C) 2010-2017 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,8 +7,26 @@ dnl with or without modifications, as long as this notice is 
preserved.
 AC_DEFUN([gl_FUNC_GETLOGIN],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_CHECK_DECLS_ONCE([getlogin])
+  if test $ac_cv_have_decl_getlogin = no; then
+    HAVE_DECL_GETLOGIN=0
+  fi
   AC_CHECK_FUNCS_ONCE([getlogin])
   if test $ac_cv_func_getlogin = no; then
     HAVE_GETLOGIN=0
   fi
 ])
+
+dnl Determines the library needed by the implementation of the
+dnl getlogin and getlogin_r functions.
+AC_DEFUN([gl_LIB_GETLOGIN],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case $host_os in
+    mingw*)
+      LIB_GETLOGIN='-ladvapi32' ;;
+    *)
+      LIB_GETLOGIN= ;;
+  esac
+  AC_SUBST([LIB_GETLOGIN])
+])
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
index 4ae5d63..4f501e5 100644
--- a/m4/gettimeofday.m4
+++ b/m4/gettimeofday.m4
@@ -1,6 +1,6 @@
 # serial 21
 
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
index dafebf5..2e30ed6 100644
--- a/m4/glibc21.m4
+++ b/m4/glibc21.m4
@@ -1,5 +1,5 @@
 # glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2016 Free Software Foundation,
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2017 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index f6d36c7..f552a18 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index f8454c8..7d9b40b 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
 # gnulib-common.m4 serial 36
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 9881c1b..9380120 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -55,6 +55,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module binary-io:
   # Code from module bind:
   # Code from module btowc:
+  # Code from module builtin-expect:
   # Code from module byteswap:
   # Code from module c-ctype:
   # Code from module c-strcase:
@@ -133,6 +134,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module lib-symbol-versions:
   # Code from module lib-symbol-visibility:
   # Code from module libunistring:
+  # Code from module limits-h:
   # Code from module link:
   # Code from module listen:
   # Code from module localcharset:
@@ -242,6 +244,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module wcrtomb:
   # Code from module wctype-h:
   # Code from module write:
+  # Code from module xalloc-oversized:
   # Code from module xsize:
 ])
 
@@ -341,7 +344,7 @@ AC_DEFUN([gl_INIT],
     AC_LIBOBJ([floor])
   fi
   gl_MATH_MODULE_INDICATOR([floor])
-  gl_FUNC_FREXP
+  AC_REQUIRE([gl_FUNC_FREXP])
   if test $gl_func_frexp != yes; then
     AC_LIBOBJ([frexp])
   fi
@@ -372,6 +375,7 @@ AC_DEFUN([gl_INIT],
     AC_LIBOBJ([getlogin])
   fi
   gl_UNISTD_MODULE_INDICATOR([getlogin])
+  AC_REQUIRE([gl_LIB_GETLOGIN])
   AC_REQUIRE([gl_HEADER_SYS_SOCKET])
   if test "$ac_cv_header_winsock2_h" = yes; then
     AC_LIBOBJ([getpeername])
@@ -473,6 +477,7 @@ AC_DEFUN([gl_INIT],
   gl_LD_VERSION_SCRIPT
   gl_VISIBILITY
   gl_LIBUNISTRING
+  gl_LIMITS_H
   gl_FUNC_LINK
   if test $HAVE_LINK = 0 || test $REPLACE_LINK = 1; then
     AC_LIBOBJ([link])
@@ -706,6 +711,7 @@ AC_DEFUN([gl_INIT],
   gl_gnulib_enabled_alloca=false
   gl_gnulib_enabled_assure=false
   gl_gnulib_enabled_btowc=false
+  gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547=false
   gl_gnulib_enabled_chdir=false
   gl_gnulib_enabled_dup2=false
   gl_gnulib_enabled_43fe87a341d9b4b93c47c3ad819a5239=false
@@ -779,6 +785,13 @@ AC_SUBST([LTALLOCA])
       fi
     fi
   }
+  func_gl_gnulib_m4code_37f71b604aa9c54446783d80f42fe547 ()
+  {
+    if ! $gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547; then
+      gl___BUILTIN_EXPECT
+      gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547=true
+    fi
+  }
   func_gl_gnulib_m4code_chdir ()
   {
     if ! $gl_gnulib_enabled_chdir; then
@@ -1369,9 +1382,15 @@ AC_SUBST([LTALLOCA])
     func_gl_gnulib_m4code_btowc
   fi
   if test $ac_use_included_regex = yes; then
+    func_gl_gnulib_m4code_37f71b604aa9c54446783d80f42fe547
+  fi
+  if test $ac_use_included_regex = yes; then
     func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
   fi
   if test $ac_use_included_regex = yes; then
+    func_gl_gnulib_m4code_intprops
+  fi
+  if test $ac_use_included_regex = yes; then
     func_gl_gnulib_m4code_mbrtowc
   fi
   if test $ac_use_included_regex = yes; then
@@ -1447,6 +1466,7 @@ AC_SUBST([LTALLOCA])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_alloca], [$gl_gnulib_enabled_alloca])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_assure], [$gl_gnulib_enabled_assure])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_btowc], [$gl_gnulib_enabled_btowc])
+  AM_CONDITIONAL([gl_GNULIB_ENABLED_37f71b604aa9c54446783d80f42fe547], 
[$gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_chdir], [$gl_gnulib_enabled_chdir])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_dup2], [$gl_gnulib_enabled_dup2])
   AM_CONDITIONAL([gl_GNULIB_ENABLED_43fe87a341d9b4b93c47c3ad819a5239], 
[$gl_gnulib_enabled_43fe87a341d9b4b93c47c3ad819a5239])
@@ -1677,6 +1697,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/fcntl.in.h
   lib/fd-hook.c
   lib/fd-hook.h
+  lib/flexmember.h
   lib/float+.h
   lib/float.c
   lib/float.in.h
@@ -1724,6 +1745,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/itold.c
   lib/langinfo.in.h
   lib/libunistring.valgrind
+  lib/limits.in.h
   lib/link.c
   lib/listen.c
   lib/localcharset.c
@@ -1854,6 +1876,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/wctype-h.c
   lib/wctype.in.h
   lib/write.c
+  lib/xalloc-oversized.h
   lib/xsize.c
   lib/xsize.h
   m4/00gnulib.m4
@@ -1862,6 +1885,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/arpa_inet_h.m4
   m4/autobuild.m4
   m4/btowc.m4
+  m4/builtin-expect.m4
   m4/byteswap.m4
   m4/canonicalize.m4
   m4/ceil.m4
@@ -1926,6 +1950,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/lib-link.m4
   m4/lib-prefix.m4
   m4/libunistring.m4
+  m4/limits-h.m4
   m4/link.m4
   m4/localcharset.m4
   m4/locale-fr.m4
diff --git a/m4/gnulib-tool.m4 b/m4/gnulib-tool.m4
index 0d2ee44..2e2d8f6 100644
--- a/m4/gnulib-tool.m4
+++ b/m4/gnulib-tool.m4
@@ -1,5 +1,5 @@
 # gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2017 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.
diff --git a/m4/hard-locale.m4 b/m4/hard-locale.m4
index 4661bfc..d79acd6 100644
--- a/m4/hard-locale.m4
+++ b/m4/hard-locale.m4
@@ -1,5 +1,5 @@
 # hard-locale.m4 serial 8
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2017 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.
diff --git a/m4/hostent.m4 b/m4/hostent.m4
index 1b2488a..595a68d 100644
--- a/m4/hostent.m4
+++ b/m4/hostent.m4
@@ -1,5 +1,5 @@
 # hostent.m4 serial 2
-dnl Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2017 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.
diff --git a/m4/iconv.m4 b/m4/iconv.m4
index aa159c5..bdafc54 100644
--- a/m4/iconv.m4
+++ b/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial 19 (gettext-0.18.2)
+# iconv.m4 serial 20
 dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -258,14 +258,18 @@ size_t iconv();
     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( 
/(/'`
     AC_MSG_RESULT([
          $am_cv_proto_iconv])
-    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
-      [Define as const if the declaration of iconv() needs const.])
-    dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
-    m4_ifdef([gl_ICONV_H_DEFAULTS],
-      [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
-       if test -n "$am_cv_proto_iconv_arg1"; then
-         ICONV_CONST="const"
-       fi
-      ])
+  else
+    dnl When compiling GNU libiconv on a system that does not have iconv yet,
+    dnl pick the POSIX compliant declaration without 'const'.
+    am_cv_proto_iconv_arg1=""
   fi
+  AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+    [Define as const if the declaration of iconv() needs const.])
+  dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+  m4_ifdef([gl_ICONV_H_DEFAULTS],
+    [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+     if test -n "$am_cv_proto_iconv_arg1"; then
+       ICONV_CONST="const"
+     fi
+    ])
 ])
diff --git a/m4/iconv_h.m4 b/m4/iconv_h.m4
index c95ecc2..d4ac243 100644
--- a/m4/iconv_h.m4
+++ b/m4/iconv_h.m4
@@ -1,5 +1,5 @@
 # iconv_h.m4 serial 8
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/iconv_open-utf.m4 b/m4/iconv_open-utf.m4
index 2c18023..4a3211c 100644
--- a/m4/iconv_open-utf.m4
+++ b/m4/iconv_open-utf.m4
@@ -1,5 +1,5 @@
 # iconv_open-utf.m4 serial 1
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4
index 54e1dc8..2517a5b 100644
--- a/m4/iconv_open.m4
+++ b/m4/iconv_open.m4
@@ -1,5 +1,5 @@
 # iconv_open.m4 serial 14
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/include_next.m4 b/m4/include_next.m4
index db0f2c0..e687e23 100644
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,5 +1,5 @@
 # include_next.m4 serial 23
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.
diff --git a/m4/inet_ntop.m4 b/m4/inet_ntop.m4
index 26464c3..f4ac237 100644
--- a/m4/inet_ntop.m4
+++ b/m4/inet_ntop.m4
@@ -1,5 +1,5 @@
 # inet_ntop.m4 serial 19
-dnl Copyright (C) 2005-2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2006, 2008-2017 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.
diff --git a/m4/inet_pton.m4 b/m4/inet_pton.m4
index 4f5db71..407c29c 100644
--- a/m4/inet_pton.m4
+++ b/m4/inet_pton.m4
@@ -1,5 +1,5 @@
 # inet_pton.m4 serial 17
-dnl Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2017 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.
diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4
index 9559acc..ff143e9 100644
--- a/m4/intmax_t.m4
+++ b/m4/intmax_t.m4
@@ -1,5 +1,5 @@
 # intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2017 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
index 7657119..9240305 100644
--- a/m4/inttypes_h.m4
+++ b/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
 # inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2017 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.
diff --git a/m4/isfinite.m4 b/m4/isfinite.m4
index 7b9641c..fab12be 100644
--- a/m4/isfinite.m4
+++ b/m4/isfinite.m4
@@ -1,5 +1,5 @@
 # isfinite.m4 serial 15
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/isinf.m4 b/m4/isinf.m4
index d062be0..146529d 100644
--- a/m4/isinf.m4
+++ b/m4/isinf.m4
@@ -1,5 +1,5 @@
 # isinf.m4 serial 11
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/isnan.m4 b/m4/isnan.m4
index 98a32f3..844aac2 100644
--- a/m4/isnan.m4
+++ b/m4/isnan.m4
@@ -1,5 +1,5 @@
 # isnan.m4 serial 5
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/isnand.m4 b/m4/isnand.m4
index bcf3840..cbe6a38 100644
--- a/m4/isnand.m4
+++ b/m4/isnand.m4
@@ -1,5 +1,5 @@
 # isnand.m4 serial 11
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/isnanf.m4 b/m4/isnanf.m4
index f49d20c..1a0d03e 100644
--- a/m4/isnanf.m4
+++ b/m4/isnanf.m4
@@ -1,5 +1,5 @@
 # isnanf.m4 serial 14
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/isnanl.m4 b/m4/isnanl.m4
index 9766e47..a42cfc0 100644
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -1,5 +1,5 @@
 # isnanl.m4 serial 19
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4
index edbbe76..ea94b4e 100644
--- a/m4/langinfo_h.m4
+++ b/m4/langinfo_h.m4
@@ -1,5 +1,5 @@
 # langinfo_h.m4 serial 7
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index 8bbdfaa..790f7c0 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -1,6 +1,6 @@
 # Enable large files on systems where this is not the default.
 
-# Copyright 1992-1996, 1998-2016 Free Software Foundation, Inc.
+# Copyright 1992-1996, 1998-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/ld-version-script.m4 b/m4/ld-version-script.m4
index 330c2cc..caccec1 100644
--- a/m4/ld-version-script.m4
+++ b/m4/ld-version-script.m4
@@ -1,5 +1,5 @@
 # ld-version-script.m4 serial 4
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/ldexp.m4 b/m4/ldexp.m4
index 596dede..151a677 100644
--- a/m4/ldexp.m4
+++ b/m4/ldexp.m4
@@ -1,5 +1,5 @@
 # ldexp.m4 serial 1
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
index 6209de6..a7733e4 100644
--- a/m4/lib-ld.m4
+++ b/m4/lib-ld.m4
@@ -1,5 +1,5 @@
 # lib-ld.m4 serial 6
-dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2009-2017 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.
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index 2f51855..1ce9a5a 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,5 +1,5 @@
 # lib-link.m4 serial 26 (gettext-0.18.2)
-dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2017 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.
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index 6851031..68a0835 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
 # lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2017 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.
diff --git a/m4/libunistring.m4 b/m4/libunistring.m4
index 31a610e..0249896 100644
--- a/m4/libunistring.m4
+++ b/m4/libunistring.m4
@@ -1,5 +1,5 @@
 # libunistring.m4 serial 11
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/limits-h.m4 b/m4/limits-h.m4
new file mode 100644
index 0000000..443f91b
--- /dev/null
+++ b/m4/limits-h.m4
@@ -0,0 +1,31 @@
+dnl Check whether limits.h has needed features.
+
+dnl Copyright 2016-2017 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.
+
+dnl From Paul Eggert.
+
+AC_DEFUN_ONCE([gl_LIMITS_H],
+[
+  gl_CHECK_NEXT_HEADERS([limits.h])
+
+  AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
+    [gl_cv_header_limits_width],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+                           #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+                          #endif
+                          #include <limits.h>
+                          int ullw = ULLONG_WIDTH;]])],
+       [gl_cv_header_limits_width=yes],
+       [gl_cv_header_limits_width=no])])
+  if test "$gl_cv_header_limits_width" = yes; then
+    LIMITS_H=
+  else
+    LIMITS_H=limits.h
+  fi
+  AC_SUBST([LIMITS_H])
+  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+])
diff --git a/m4/link.m4 b/m4/link.m4
index 77f5a2b..021c301 100644
--- a/m4/link.m4
+++ b/m4/link.m4
@@ -1,5 +1,5 @@
 # link.m4 serial 8
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
@@ -22,6 +22,7 @@ AC_DEFUN([gl_FUNC_LINK],
        AC_RUN_IFELSE(
          [AC_LANG_PROGRAM(
            [[#include <unistd.h>
+             #include <stdio.h>
            ]],
            [[int result = 0;
              if (!link ("conftest.a", "conftest.b/"))
diff --git a/m4/localcharset.m4 b/m4/localcharset.m4
index 22c311b..0c1ff38 100644
--- a/m4/localcharset.m4
+++ b/m4/localcharset.m4
@@ -1,5 +1,5 @@
 # localcharset.m4 serial 7
-dnl Copyright (C) 2002, 2004, 2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004, 2006, 2009-2017 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.
diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4
index 92896a0..93d3da7 100644
--- a/m4/locale-fr.m4
+++ b/m4/locale-fr.m4
@@ -1,5 +1,5 @@
 # locale-fr.m4 serial 17
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2017 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.
diff --git a/m4/locale-ja.m4 b/m4/locale-ja.m4
index f222a08..c1d1154 100644
--- a/m4/locale-ja.m4
+++ b/m4/locale-ja.m4
@@ -1,5 +1,5 @@
 # locale-ja.m4 serial 12
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2017 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.
diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4
index 2271f77..1459418 100644
--- a/m4/locale-zh.m4
+++ b/m4/locale-zh.m4
@@ -1,5 +1,5 @@
 # locale-zh.m4 serial 12
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2017 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.
diff --git a/m4/locale_h.m4 b/m4/locale_h.m4
index 563f8f8..7426a65 100644
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,5 +1,5 @@
 # locale_h.m4 serial 19
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.
diff --git a/m4/localeconv.m4 b/m4/localeconv.m4
index 6e1dbf1..c287aa5 100644
--- a/m4/localeconv.m4
+++ b/m4/localeconv.m4
@@ -1,5 +1,5 @@
 # localeconv.m4 serial 1
-dnl Copyright (C) 2012-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2017 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.
diff --git a/m4/log.m4 b/m4/log.m4
index a4401b6..90dee24 100644
--- a/m4/log.m4
+++ b/m4/log.m4
@@ -1,5 +1,5 @@
 # log.m4 serial 4
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.
diff --git a/m4/log1p.m4 b/m4/log1p.m4
index 055aba8..f55ac54 100644
--- a/m4/log1p.m4
+++ b/m4/log1p.m4
@@ -1,5 +1,5 @@
 # log1p.m4 serial 3
-dnl Copyright (C) 2012-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2017 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.
diff --git a/m4/longlong.m4 b/m4/longlong.m4
index 36d8b12..9a3294b 100644
--- a/m4/longlong.m4
+++ b/m4/longlong.m4
@@ -1,5 +1,5 @@
 # longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2017 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.
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index e143d5c..953c117 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,6 +1,6 @@
 # serial 27
 
-# Copyright (C) 1997-2001, 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index c393690..e1d2ec6 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,5 +1,5 @@
 # malloc.m4 serial 15
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.
diff --git a/m4/malloca.m4 b/m4/malloca.m4
index b368b20..6956baf 100644
--- a/m4/malloca.m4
+++ b/m4/malloca.m4
@@ -1,5 +1,5 @@
 # malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2017 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/math_h.m4 b/m4/math_h.m4
index 35d07ee..6db72ca 100644
--- a/m4/math_h.m4
+++ b/m4/math_h.m4
@@ -1,5 +1,5 @@
-# math_h.m4 serial 114
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# math_h.m4 serial 115
+dnl Copyright (C) 2007-2017 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.
@@ -256,11 +256,18 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
   HAVE_DECL_TRUNC=1;           AC_SUBST([HAVE_DECL_TRUNC])
   HAVE_DECL_TRUNCF=1;          AC_SUBST([HAVE_DECL_TRUNCF])
   HAVE_DECL_TRUNCL=1;          AC_SUBST([HAVE_DECL_TRUNCL])
+  REPLACE_ACOSF=0;             AC_SUBST([REPLACE_ACOSF])
+  REPLACE_ASINF=0;             AC_SUBST([REPLACE_ASINF])
+  REPLACE_ATANF=0;             AC_SUBST([REPLACE_ATANF])
+  REPLACE_ATAN2F=0;            AC_SUBST([REPLACE_ATAN2F])
   REPLACE_CBRTF=0;             AC_SUBST([REPLACE_CBRTF])
   REPLACE_CBRTL=0;             AC_SUBST([REPLACE_CBRTL])
   REPLACE_CEIL=0;              AC_SUBST([REPLACE_CEIL])
   REPLACE_CEILF=0;             AC_SUBST([REPLACE_CEILF])
   REPLACE_CEILL=0;             AC_SUBST([REPLACE_CEILL])
+  REPLACE_COSF=0;              AC_SUBST([REPLACE_COSF])
+  REPLACE_COSHF=0;             AC_SUBST([REPLACE_COSHF])
+  REPLACE_EXPF=0;              AC_SUBST([REPLACE_EXPF])
   REPLACE_EXPM1=0;             AC_SUBST([REPLACE_EXPM1])
   REPLACE_EXPM1F=0;            AC_SUBST([REPLACE_EXPM1F])
   REPLACE_EXP2=0;              AC_SUBST([REPLACE_EXP2])
@@ -315,7 +322,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
   REPLACE_ROUNDL=0;            AC_SUBST([REPLACE_ROUNDL])
   REPLACE_SIGNBIT=0;           AC_SUBST([REPLACE_SIGNBIT])
   REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
+  REPLACE_SINF=0;              AC_SUBST([REPLACE_SINF])
+  REPLACE_SINHF=0;             AC_SUBST([REPLACE_SINHF])
+  REPLACE_SQRTF=0;             AC_SUBST([REPLACE_SQRTF])
   REPLACE_SQRTL=0;             AC_SUBST([REPLACE_SQRTL])
+  REPLACE_TANF=0;              AC_SUBST([REPLACE_TANF])
+  REPLACE_TANHF=0;             AC_SUBST([REPLACE_TANHF])
   REPLACE_TRUNC=0;             AC_SUBST([REPLACE_TRUNC])
   REPLACE_TRUNCF=0;            AC_SUBST([REPLACE_TRUNCF])
   REPLACE_TRUNCL=0;            AC_SUBST([REPLACE_TRUNCL])
diff --git a/m4/mathfunc.m4 b/m4/mathfunc.m4
index 0170697..b55ebc7 100644
--- a/m4/mathfunc.m4
+++ b/m4/mathfunc.m4
@@ -1,5 +1,5 @@
 # mathfunc.m4 serial 11
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index d370fcc..536183f 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,5 +1,5 @@
 # mbrtowc.m4 serial 27  -*- coding: utf-8 -*-
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2016 Free Software Foundation,
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2017 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -164,7 +164,7 @@ int main ()
       memset (&state, '\0', sizeof (mbstate_t));
       if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
         if (mbsinit (&state))
-          return 1;
+          return 2;
     }
   return 0;
 }]])],
@@ -224,7 +224,7 @@ int main ()
       memset (&state, '\0', sizeof (mbstate_t));
       if (mbrtowc (&wc, input + 3, 6, &state) != 4
           && mbtowc (&wc, input + 3, 6) == 4)
-        return 1;
+        return 2;
     }
   return 0;
 }]])],
@@ -352,7 +352,7 @@ int main ()
       mbrtowc (&wc, NULL, 5, &state);
       /* Check that wc was not modified.  */
       if (wc != (wchar_t) 0xBADFACE)
-        return 1;
+        return 2;
     }
   return 0;
 }]])],
@@ -539,7 +539,7 @@ int main ()
 
       memset (&state, '\0', sizeof (mbstate_t));
       if (mbrtowc (&wc, "", 1, &state) != 0)
-        return 1;
+        return 2;
     }
   return 0;
 }]])],
@@ -608,7 +608,7 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
             int i;
             char *locale = setlocale (LC_ALL, "C");
             if (! locale)
-              return 1;
+              return 2;
             for (i = CHAR_MIN; i <= CHAR_MAX; i++)
               {
                 char c = i;
@@ -616,7 +616,7 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
                 mbstate_t mbs = { 0, };
                 size_t ss = mbrtowc (&wc, &c, 1, &mbs);
                 if (1 < ss)
-                  return 1;
+                  return 3;
               }
             return 0;
           ]])],
diff --git a/m4/mbsinit.m4 b/m4/mbsinit.m4
index 88f0836..5904a51 100644
--- a/m4/mbsinit.m4
+++ b/m4/mbsinit.m4
@@ -1,5 +1,5 @@
 # mbsinit.m4 serial 8
-dnl Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2017 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.
diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4
index 0a8eae2..6325cf3 100644
--- a/m4/mbstate_t.m4
+++ b/m4/mbstate_t.m4
@@ -1,5 +1,5 @@
 # mbstate_t.m4 serial 13
-dnl Copyright (C) 2000-2002, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2008-2017 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.
diff --git a/m4/mbtowc.m4 b/m4/mbtowc.m4
index e770bbf..378a4e2 100644
--- a/m4/mbtowc.m4
+++ b/m4/mbtowc.m4
@@ -1,5 +1,5 @@
 # mbtowc.m4 serial 2
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.
diff --git a/m4/memchr.m4 b/m4/memchr.m4
index 25d32f0..b6ec814 100644
--- a/m4/memchr.m4
+++ b/m4/memchr.m4
@@ -1,5 +1,5 @@
 # memchr.m4 serial 12
-dnl Copyright (C) 2002-2004, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2009-2017 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.
diff --git a/m4/mkdir.m4 b/m4/mkdir.m4
index 574092b..5eec622 100644
--- a/m4/mkdir.m4
+++ b/m4/mkdir.m4
@@ -1,6 +1,6 @@
 # serial 11
 
-# Copyright (C) 2001, 2003-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2004, 2006, 2008-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/mkostemp.m4 b/m4/mkostemp.m4
index 1f44a03..337f17b 100644
--- a/m4/mkostemp.m4
+++ b/m4/mkostemp.m4
@@ -1,5 +1,5 @@
 # mkostemp.m4 serial 2
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index 23cad73..d594ddc 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,5 +1,5 @@
 # serial 27
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/mmap-anon.m4 b/m4/mmap-anon.m4
index 853c89d..263687d 100644
--- a/m4/mmap-anon.m4
+++ b/m4/mmap-anon.m4
@@ -1,5 +1,5 @@
 # mmap-anon.m4 serial 10
-dnl Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2017 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.
diff --git a/m4/mode_t.m4 b/m4/mode_t.m4
index 0cd40db..75d372a 100644
--- a/m4/mode_t.m4
+++ b/m4/mode_t.m4
@@ -1,5 +1,5 @@
 # mode_t.m4 serial 2
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/msvc-inval.m4 b/m4/msvc-inval.m4
index f5e4c89..3324375 100644
--- a/m4/msvc-inval.m4
+++ b/m4/msvc-inval.m4
@@ -1,5 +1,5 @@
 # msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.
diff --git a/m4/msvc-nothrow.m4 b/m4/msvc-nothrow.m4
index 58f5c0b..3014661 100644
--- a/m4/msvc-nothrow.m4
+++ b/m4/msvc-nothrow.m4
@@ -1,5 +1,5 @@
 # msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.
diff --git a/m4/multiarch.m4 b/m4/multiarch.m4
index 43b5d05..30006cb 100644
--- a/m4/multiarch.m4
+++ b/m4/multiarch.m4
@@ -1,5 +1,5 @@
 # multiarch.m4 serial 7
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4
index 4e5206c..3a34d25 100644
--- a/m4/netdb_h.m4
+++ b/m4/netdb_h.m4
@@ -1,5 +1,5 @@
 # netdb_h.m4 serial 11
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/netinet_in_h.m4 b/m4/netinet_in_h.m4
index 93dcc68..f936657 100644
--- a/m4/netinet_in_h.m4
+++ b/m4/netinet_in_h.m4
@@ -1,5 +1,5 @@
 # netinet_in_h.m4 serial 5
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.
diff --git a/m4/nl_langinfo.m4 b/m4/nl_langinfo.m4
index a2f7196..16de8de 100644
--- a/m4/nl_langinfo.m4
+++ b/m4/nl_langinfo.m4
@@ -1,5 +1,5 @@
 # nl_langinfo.m4 serial 5
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
index d8dd8f1..2c2c5fb 100644
--- a/m4/nocrash.m4
+++ b/m4/nocrash.m4
@@ -1,5 +1,5 @@
 # nocrash.m4 serial 4
-dnl Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2017 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.
diff --git a/m4/nproc.m4 b/m4/nproc.m4
index fead234..e1ca5b3 100644
--- a/m4/nproc.m4
+++ b/m4/nproc.m4
@@ -1,5 +1,5 @@
-# nproc.m4 serial 4
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# nproc.m4 serial 5
+dnl Copyright (C) 2009-2017 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.
@@ -40,7 +40,8 @@ AC_DEFUN([gl_PREREQ_NPROC],
       [gl_cv_func_sched_getaffinity3],
       [AC_COMPILE_IFELSE(
          [AC_LANG_PROGRAM(
-            [[#include <sched.h>]],
+            [[#include <errno.h>
+              #include <sched.h>]],
             [[sched_getaffinity (0, 0, (cpu_set_t *) 0);]])],
          [gl_cv_func_sched_getaffinity3=yes],
          [gl_cv_func_sched_getaffinity3=no])
diff --git a/m4/off_t.m4 b/m4/off_t.m4
index 282751b..92c45ef 100644
--- a/m4/off_t.m4
+++ b/m4/off_t.m4
@@ -1,5 +1,5 @@
 # off_t.m4 serial 1
-dnl Copyright (C) 2012-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2017 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.
diff --git a/m4/open.m4 b/m4/open.m4
index 53d3038..2a869dc 100644
--- a/m4/open.m4
+++ b/m4/open.m4
@@ -1,5 +1,5 @@
 # open.m4 serial 14
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
index 6f8e59a..c6c9f24 100644
--- a/m4/pathmax.m4
+++ b/m4/pathmax.m4
@@ -1,5 +1,5 @@
 # pathmax.m4 serial 10
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/pipe.m4 b/m4/pipe.m4
index 0fe6975..c35b32c 100644
--- a/m4/pipe.m4
+++ b/m4/pipe.m4
@@ -1,5 +1,5 @@
 # pipe.m4 serial 2
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.
diff --git a/m4/pipe2.m4 b/m4/pipe2.m4
index c09fcee..7393343 100644
--- a/m4/pipe2.m4
+++ b/m4/pipe2.m4
@@ -1,5 +1,5 @@
 # pipe2.m4 serial 2
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/poll.m4 b/m4/poll.m4
index edeaaeb..5706ab5 100644
--- a/m4/poll.m4
+++ b/m4/poll.m4
@@ -1,5 +1,5 @@
 # poll.m4 serial 17
-dnl Copyright (c) 2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (c) 2003, 2005-2007, 2009-2017 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.
diff --git a/m4/poll_h.m4 b/m4/poll_h.m4
index 85699e0..b3d6dab 100644
--- a/m4/poll_h.m4
+++ b/m4/poll_h.m4
@@ -1,5 +1,5 @@
 # poll_h.m4 serial 2
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.
diff --git a/m4/printf.m4 b/m4/printf.m4
index e495e0c..a44ac66 100644
--- a/m4/printf.m4
+++ b/m4/printf.m4
@@ -1,5 +1,5 @@
 # printf.m4 serial 52
-dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2017 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.
@@ -38,6 +38,8 @@ int main ()
   if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
       || strcmp (buf, "12345671 33") != 0)
     result |= 1;
+#else
+  result |= 1;
 #endif
   buf[0] = '\0';
   if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
diff --git a/m4/putenv.m4 b/m4/putenv.m4
index c3c30d8..a8e3ab3 100644
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -1,5 +1,5 @@
 # putenv.m4 serial 20
-dnl Copyright (C) 2002-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2017 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.
diff --git a/m4/raise.m4 b/m4/raise.m4
index 71c1f4c..28c2e0b 100644
--- a/m4/raise.m4
+++ b/m4/raise.m4
@@ -1,5 +1,5 @@
 # raise.m4 serial 3
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.
diff --git a/m4/read.m4 b/m4/read.m4
index 5a18c11..36249ab 100644
--- a/m4/read.m4
+++ b/m4/read.m4
@@ -1,5 +1,5 @@
 # read.m4 serial 4
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.
diff --git a/m4/readlink.m4 b/m4/readlink.m4
index ede0378..d3ba0ad 100644
--- a/m4/readlink.m4
+++ b/m4/readlink.m4
@@ -1,5 +1,5 @@
 # readlink.m4 serial 12
-dnl Copyright (C) 2003, 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007, 2009-2017 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.
diff --git a/m4/regex.m4 b/m4/regex.m4
index abfd262..61ff098 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,6 +1,6 @@
 # serial 66
 
-# Copyright (C) 1996-2001, 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/rename.m4 b/m4/rename.m4
index fbcc758..7c3ffe7 100644
--- a/m4/rename.m4
+++ b/m4/rename.m4
@@ -1,6 +1,6 @@
 # serial 26
 
-# Copyright (C) 2001, 2003, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005-2006, 2009-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/rmdir.m4 b/m4/rmdir.m4
index ebb3b5d..f585c27 100644
--- a/m4/rmdir.m4
+++ b/m4/rmdir.m4
@@ -1,5 +1,5 @@
 # rmdir.m4 serial 13
-dnl Copyright (C) 2002, 2005, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005, 2009-2017 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.
diff --git a/m4/round.m4 b/m4/round.m4
index 35ffa40..45b7df4 100644
--- a/m4/round.m4
+++ b/m4/round.m4
@@ -1,5 +1,5 @@
 # round.m4 serial 16
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2017 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.
diff --git a/m4/safe-read.m4 b/m4/safe-read.m4
index 2221682..022bb65 100644
--- a/m4/safe-read.m4
+++ b/m4/safe-read.m4
@@ -1,5 +1,5 @@
 # safe-read.m4 serial 6
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/safe-write.m4 b/m4/safe-write.m4
index a99fb1f..09a2226 100644
--- a/m4/safe-write.m4
+++ b/m4/safe-write.m4
@@ -1,5 +1,5 @@
 # safe-write.m4 serial 4
-dnl Copyright (C) 2002, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2006, 2009-2017 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.
diff --git a/m4/secure_getenv.m4 b/m4/secure_getenv.m4
index 3983173..6bd4afd 100644
--- a/m4/secure_getenv.m4
+++ b/m4/secure_getenv.m4
@@ -1,5 +1,5 @@
 # Look up an environment variable more securely.
-dnl Copyright 2013-2016 Free Software Foundation, Inc.
+dnl Copyright 2013-2017 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.
diff --git a/m4/select.m4 b/m4/select.m4
index d193655..c7844bc 100644
--- a/m4/select.m4
+++ b/m4/select.m4
@@ -1,5 +1,5 @@
 # select.m4 serial 8
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/servent.m4 b/m4/servent.m4
index 182e7f6..89331e2 100644
--- a/m4/servent.m4
+++ b/m4/servent.m4
@@ -1,5 +1,5 @@
 # servent.m4 serial 2
-dnl Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2017 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.
diff --git a/m4/setenv.m4 b/m4/setenv.m4
index 5d49aba..005aa8c 100644
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,5 +1,5 @@
 # setenv.m4 serial 26
-dnl Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2004, 2006-2017 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.
diff --git a/m4/signal_h.m4 b/m4/signal_h.m4
index bcfd7b4..eaf5ce9 100644
--- a/m4/signal_h.m4
+++ b/m4/signal_h.m4
@@ -1,5 +1,5 @@
 # signal_h.m4 serial 18
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/signbit.m4 b/m4/signbit.m4
index e42f183..9d2b0a8 100644
--- a/m4/signbit.m4
+++ b/m4/signbit.m4
@@ -1,5 +1,5 @@
 # signbit.m4 serial 13
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
diff --git a/m4/size_max.m4 b/m4/size_max.m4
index de69025..05ad1b6 100644
--- a/m4/size_max.m4
+++ b/m4/size_max.m4
@@ -1,5 +1,5 @@
 # size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2017 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.
diff --git a/m4/snprintf.m4 b/m4/snprintf.m4
index f876b55..e5155f7 100644
--- a/m4/snprintf.m4
+++ b/m4/snprintf.m4
@@ -1,5 +1,5 @@
-# snprintf.m4 serial 6
-dnl Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
+# snprintf.m4 serial 7
+dnl Copyright (C) 2002-2004, 2007-2017 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.
@@ -46,6 +46,14 @@ AC_DEFUN([gl_REPLACE_SNPRINTF],
   AC_LIBOBJ([snprintf])
   if test $ac_cv_func_snprintf = yes; then
     REPLACE_SNPRINTF=1
+  else
+    AC_CHECK_DECLS_ONCE([snprintf])
+    if test $ac_cv_have_decl_snprintf = yes; then
+      dnl If the function is declared but does not appear to exist, it may be
+      dnl defined as an inline function. In order to avoid a conflict, we have
+      dnl to define rpl_snprintf, not snprintf.
+      REPLACE_SNPRINTF=1
+    fi
   fi
   gl_PREREQ_SNPRINTF
 ])
diff --git a/m4/socketlib.m4 b/m4/socketlib.m4
index 5da64fc..c708fd2 100644
--- a/m4/socketlib.m4
+++ b/m4/socketlib.m4
@@ -1,5 +1,5 @@
 # socketlib.m4 serial 1
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/sockets.m4 b/m4/sockets.m4
index 7e77a62..0ef23bc 100644
--- a/m4/sockets.m4
+++ b/m4/sockets.m4
@@ -1,5 +1,5 @@
 # sockets.m4 serial 7
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/socklen.m4 b/m4/socklen.m4
index 634c43a..0a62f49 100644
--- a/m4/socklen.m4
+++ b/m4/socklen.m4
@@ -1,5 +1,5 @@
 # socklen.m4 serial 10
-dnl Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2017 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.
diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4
index dce8b8f..c2e2582 100644
--- a/m4/sockpfaf.m4
+++ b/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
 # sockpfaf.m4 serial 8
-dnl Copyright (C) 2004, 2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2009-2017 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.
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4
index 3e7b9e6..66ba9d4 100644
--- a/m4/ssize_t.m4
+++ b/m4/ssize_t.m4
@@ -1,5 +1,5 @@
 # ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2017 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.
diff --git a/m4/stat-time.m4 b/m4/stat-time.m4
index 231cb74..4017fc9 100644
--- a/m4/stat-time.m4
+++ b/m4/stat-time.m4
@@ -1,6 +1,6 @@
 # Checks for stat-related time functions.
 
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2016 Free Software
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2017 Free Software
 # Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
diff --git a/m4/stat.m4 b/m4/stat.m4
index a794975..9ff77df 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -1,6 +1,6 @@
 # serial 11
 
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index 49980cd..3a12658 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -1,6 +1,6 @@
 # Check for stdalign.h that conforms to C11.
 
-dnl Copyright 2011-2016 Free Software Foundation, Inc.
+dnl Copyright 2011-2017 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.
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index a556153..d368123 100644
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -1,11 +1,11 @@
 # Check for stdbool.h that conforms to C99.
 
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2017 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.
 
-#serial 6
+#serial 7
 
 # Prepare for substituting <stdbool.h> if it is not supported.
 
@@ -44,7 +44,10 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
            [[
              #include <stdbool.h>
 
-             #if __cplusplus < 201103
+             #ifdef __cplusplus
+              typedef bool Bool;
+             #else
+              typedef _Bool Bool;
               #ifndef bool
                "error: bool is not defined"
               #endif
@@ -66,37 +69,38 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
               "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; bool u: 1; bool v; } 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];
              /* See body of main program for 'e'.  */
-             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char f[(Bool) 0.0 == false ? 1 : -1];
              char g[true];
-             char h[sizeof (_Bool)];
+             char h[sizeof (Bool)];
              char i[sizeof s.t];
              enum { j = false, k = true, l = false * true, m = true * 256 };
              /* The following fails for
                 HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-             _Bool n[m];
+             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];
+             char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
              /* 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;
+             Bool q = true;
+             Bool *pq = &q;
+             bool *qq = &q;
            ]],
            [[
              bool e = &s;
-             *pq |= q;
-             *pq |= ! q;
+             *pq |= q; *pq |= ! q;
+             *qq |= q; *qq |= ! 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);
+                     + !m + !n + !o + !p + !q + !pq + !qq);
            ]])],
         [ac_cv_header_stdbool_h=yes],
         [ac_cv_header_stdbool_h=no])])
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index c045c65..f45def1 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,6 +1,6 @@
 dnl A placeholder for <stddef.h>, for platforms that have issues.
 # stddef_h.m4 serial 5
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index 0b4b906..4ac854d 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,5 +1,5 @@
-# stdint.m4 serial 44
-dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
+# stdint.m4 serial 50
+dnl Copyright (C) 2001-2017 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.
@@ -11,6 +11,9 @@ AC_DEFUN_ONCE([gl_STDINT_H],
 [
   AC_PREREQ([2.59])dnl
 
+  AC_REQUIRE([gl_LIMITS_H])
+  AC_REQUIRE([gt_TYPE_WINT_T])
+
   dnl Check for long long int and unsigned long long int.
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   if test $ac_cv_type_long_long_int = yes; then
@@ -152,6 +155,15 @@ uintptr_t h = UINTPTR_MAX;
 intmax_t i = INTMAX_MAX;
 uintmax_t j = UINTMAX_MAX;
 
+/* Check that SIZE_MAX has the correct type, if possible.  */
+#if 201112 <= __STDC_VERSION__
+int k = _Generic (SIZE_MAX, size_t: 0);
+#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+       || (0x5110 <= __SUNPRO_C && !__STDC__))
+extern size_t k;
+extern __typeof__ (SIZE_MAX) k;
+#endif
+
 #include <limits.h> /* for CHAR_BIT */
 #define TYPE_MINIMUM(t) \
   ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
@@ -282,14 +294,20 @@ static const char *macro_values[] =
          ])
       ])
   fi
+
+  HAVE_C99_STDINT_H=0
+  HAVE_SYS_BITYPES_H=0
+  HAVE_SYS_INTTYPES_H=0
+  STDINT_H=stdint.h
   if test "$gl_cv_header_working_stdint_h" = yes; then
+    HAVE_C99_STDINT_H=1
     dnl Now see whether the system <stdint.h> works without
     dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
     AC_CACHE_CHECK([whether stdint.h predates C++11],
       [gl_cv_header_stdint_predates_cxx11_h],
       [gl_cv_header_stdint_predates_cxx11_h=yes
        AC_COMPILE_IFELSE([
-        AC_LANG_PROGRAM([[
+         AC_LANG_PROGRAM([[
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 #include <stdint.h>
 ]
@@ -306,27 +324,44 @@ int32_t i32 = INT32_C (0x7fffffff);
       AC_DEFINE([__STDC_LIMIT_MACROS], [1],
                 [Define to 1 if the system <stdint.h> predates C++11.])
     fi
-    STDINT_H=
+    AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
+      [gl_cv_header_stdint_width],
+      [gl_cv_header_stdint_width=no
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[
+            /* Work if build is not clean.  */
+            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
+            #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+             #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+            #endif
+            #include <stdint.h>
+            ]gl_STDINT_INCLUDES[
+            int iw = UINTMAX_WIDTH;
+            ]])],
+         [gl_cv_header_stdint_width=yes])])
+    if test "$gl_cv_header_stdint_width" = yes; then
+      STDINT_H=
+    fi
   else
     dnl Check for <sys/inttypes.h>, and for
     dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
     AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
     if test $ac_cv_header_sys_inttypes_h = yes; then
       HAVE_SYS_INTTYPES_H=1
-    else
-      HAVE_SYS_INTTYPES_H=0
     fi
-    AC_SUBST([HAVE_SYS_INTTYPES_H])
     if test $ac_cv_header_sys_bitypes_h = yes; then
       HAVE_SYS_BITYPES_H=1
-    else
-      HAVE_SYS_BITYPES_H=0
     fi
-    AC_SUBST([HAVE_SYS_BITYPES_H])
-
     gl_STDINT_TYPE_PROPERTIES
-    STDINT_H=stdint.h
   fi
+
+  dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
+  LIMITS_H=limits.h
+  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+
+  AC_SUBST([HAVE_C99_STDINT_H])
+  AC_SUBST([HAVE_SYS_BITYPES_H])
+  AC_SUBST([HAVE_SYS_INTTYPES_H])
   AC_SUBST([STDINT_H])
   AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
 ])
@@ -494,7 +529,7 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
   dnl requirement that wint_t is "unchanged by default argument promotions".
   dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
   dnl Set the variable BITSIZEOF_WINT_T accordingly.
-  if test $BITSIZEOF_WINT_T -lt 32; then
+  if test $GNULIB_OVERRIDES_WINT_T = 1; then
     BITSIZEOF_WINT_T=32
   fi
 ])
@@ -504,8 +539,3 @@ dnl Remove this when we can assume autoconf >= 2.61.
 m4_ifdef([AC_COMPUTE_INT], [], [
   AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
 ])
-
-# Hey Emacs!
-# Local Variables:
-# indent-tabs-mode: nil
-# End:
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
index f823b94..786eaa3 100644
--- a/m4/stdint_h.m4
+++ b/m4/stdint_h.m4
@@ -1,5 +1,5 @@
 # stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2017 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.
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 0e38758..9ffbb85 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,14 +1,18 @@
-# stdio_h.m4 serial 46
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# stdio_h.m4 serial 48
+dnl Copyright (C) 2007-2017 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.
 
 AC_DEFUN([gl_STDIO_H],
 [
-  dnl For __USE_MINGW_ANSI_STDIO
-  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
+  AH_VERBATIM([MINGW_ANSI_STDIO],
+[/* Use GNU style printf and scanf.  */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
+])
+  AC_DEFINE([__USE_MINGW_ANSI_STDIO])
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   gl_NEXT_HEADERS([stdio.h])
 
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4
index 19107c4..110fe2d 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 42
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 43
+dnl Copyright (C) 2007-2017 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.
@@ -21,7 +21,7 @@ AC_DEFUN([gl_STDLIB_H],
 #endif
     ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
     initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
-    posix_openpt ptsname ptsname_r random random_r realpath rpmatch
+    posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch
     secure_getenv setenv setstate setstate_r srandom srandom_r
     strtod strtoll strtoull unlockpt unsetenv])
 ])
@@ -85,6 +85,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_POSIX_OPENPT=1;       AC_SUBST([HAVE_POSIX_OPENPT])
   HAVE_PTSNAME=1;            AC_SUBST([HAVE_PTSNAME])
   HAVE_PTSNAME_R=1;          AC_SUBST([HAVE_PTSNAME_R])
+  HAVE_QSORT_R=1;            AC_SUBST([HAVE_QSORT_R])
   HAVE_RANDOM=1;             AC_SUBST([HAVE_RANDOM])
   HAVE_RANDOM_H=1;           AC_SUBST([HAVE_RANDOM_H])
   HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])
diff --git a/m4/strdup.m4 b/m4/strdup.m4
index ff7060a..a92dbd6 100644
--- a/m4/strdup.m4
+++ b/m4/strdup.m4
@@ -1,6 +1,6 @@
 # strdup.m4 serial 13
 
-dnl Copyright (C) 2002-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2017 Free Software Foundation, Inc.
 
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/strftime.m4 b/m4/strftime.m4
index 9598e72..3a5db9b 100644
--- a/m4/strftime.m4
+++ b/m4/strftime.m4
@@ -1,6 +1,6 @@
 # serial 33
 
-# Copyright (C) 1996-1997, 1999-2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 1996-1997, 1999-2007, 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index 0c5ec6f..3d2ad22 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -1,6 +1,6 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_file_h.m4 b/m4/sys_file_h.m4
index cacc625..6317572 100644
--- a/m4/sys_file_h.m4
+++ b/m4/sys_file_h.m4
@@ -1,7 +1,7 @@
 # Configure a replacement for <sys/file.h>.
 # serial 6
 
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2008-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4
index 23526e5..4ec2800 100644
--- a/m4/sys_select_h.m4
+++ b/m4/sys_select_h.m4
@@ -1,5 +1,5 @@
 # sys_select_h.m4 serial 20
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
index ae500c7..3ecbe7c 100644
--- a/m4/sys_socket_h.m4
+++ b/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
 # sys_socket_h.m4 serial 23
-dnl Copyright (C) 2005-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2017 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.
diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4
index 3d43b6f..1e34ac4 100644
--- a/m4/sys_stat_h.m4
+++ b/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
 # sys_stat_h.m4 serial 28   -*- Autoconf -*-
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
index 3061a9c..e622dbe 100644
--- a/m4/sys_time_h.m4
+++ b/m4/sys_time_h.m4
@@ -1,7 +1,7 @@
 # Configure a replacement for <sys/time.h>.
 # serial 8
 
-# Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_times_h.m4 b/m4/sys_times_h.m4
index e472e71..078e523 100644
--- a/m4/sys_times_h.m4
+++ b/m4/sys_times_h.m4
@@ -1,7 +1,7 @@
 # Configure a replacement for <sys/times.h>.
 # serial 8
 
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2008-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
index b0aabb4..2eb4e9e 100644
--- a/m4/sys_types_h.m4
+++ b/m4/sys_types_h.m4
@@ -1,5 +1,5 @@
-# sys_types_h.m4 serial 5
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# sys_types_h.m4 serial 6
+dnl Copyright (C) 2011-2017 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.
@@ -22,3 +22,28 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H],
 AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
 [
 ])
+
+# This works around a buggy version in autoconf <= 2.69.
+# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html>
+
+m4_version_prereq([2.70], [], [
+
+# This is taken from the following Autoconf patch:
+# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98
+
+m4_undefine([AC_HEADER_MAJOR])
+AC_DEFUN([AC_HEADER_MAJOR],
+[AC_CHECK_HEADERS_ONCE([sys/types.h])
+AC_CHECK_HEADER([sys/mkdev.h],
+  [AC_DEFINE([MAJOR_IN_MKDEV], [1],
+    [Define to 1 if `major', `minor', and `makedev' are declared in
+     <mkdev.h>.])])
+if test $ac_cv_header_sys_mkdev_h = no; then
+  AC_CHECK_HEADER([sys/sysmacros.h],
+    [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
+      [Define to 1 if `major', `minor', and `makedev' are declared in
+       <sysmacros.h>.])])
+fi
+])
+
+])
diff --git a/m4/sys_uio_h.m4 b/m4/sys_uio_h.m4
index d4d967f..68ef088 100644
--- a/m4/sys_uio_h.m4
+++ b/m4/sys_uio_h.m4
@@ -1,5 +1,5 @@
 # sys_uio_h.m4 serial 1
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2017 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.
diff --git a/m4/tempname.m4 b/m4/tempname.m4
index acf4c8d..a59f4c0 100644
--- a/m4/tempname.m4
+++ b/m4/tempname.m4
@@ -1,6 +1,6 @@
 #serial 5
 
-# Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2017 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index eb2a631..b925678 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -1,6 +1,6 @@
 # Configure a more-standard replacement for <time.h>.
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc.
 
 # serial 9
 
diff --git a/m4/time_r.m4 b/m4/time_r.m4
index 21b4a2c..3e24ccb 100644
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
@@ -1,6 +1,6 @@
 dnl Reentrant time functions: localtime_r, gmtime_r.
 
-dnl Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2006-2017 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.
diff --git a/m4/time_rz.m4 b/m4/time_rz.m4
index 9b1db1b..79060e0 100644
--- a/m4/time_rz.m4
+++ b/m4/time_rz.m4
@@ -1,6 +1,6 @@
 dnl Time zone functions: tzalloc, localtime_rz, etc.
 
-dnl Copyright (C) 2015-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2015-2017 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.
diff --git a/m4/timegm.m4 b/m4/timegm.m4
index 752aa43..510e25a 100644
--- a/m4/timegm.m4
+++ b/m4/timegm.m4
@@ -1,5 +1,5 @@
 # timegm.m4 serial 11
-dnl Copyright (C) 2003, 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007, 2009-2017 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.
diff --git a/m4/times.m4 b/m4/times.m4
index ad44c5c..57570de 100644
--- a/m4/times.m4
+++ b/m4/times.m4
@@ -1,5 +1,5 @@
 # times.m4 serial 2
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2017 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.
diff --git a/m4/tm_gmtoff.m4 b/m4/tm_gmtoff.m4
index ce0671f..32db008 100644
--- a/m4/tm_gmtoff.m4
+++ b/m4/tm_gmtoff.m4
@@ -1,5 +1,5 @@
 # tm_gmtoff.m4 serial 3
-dnl Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2009-2017 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.
diff --git a/m4/trunc.m4 b/m4/trunc.m4
index 4759b47..a070d78 100644
--- a/m4/trunc.m4
+++ b/m4/trunc.m4
@@ -1,5 +1,5 @@
 # trunc.m4 serial 9
-dnl Copyright (C) 2007, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2010-2017 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.
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index 544dadb..25aef19 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 68
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+# unistd_h.m4 serial 69
+dnl Copyright (C) 2006-2017 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.
@@ -145,6 +145,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_DECL_FCHDIR=1;     AC_SUBST([HAVE_DECL_FCHDIR])
   HAVE_DECL_FDATASYNC=1;  AC_SUBST([HAVE_DECL_FDATASYNC])
   HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
+  HAVE_DECL_GETLOGIN=1;   AC_SUBST([HAVE_DECL_GETLOGIN])
   HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
   HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
   HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4
index 2d4b463..47c5951 100644
--- a/m4/vasnprintf.m4
+++ b/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
 # vasnprintf.m4 serial 36
-dnl Copyright (C) 2002-2004, 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-2017 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.
diff --git a/m4/visibility.m4 b/m4/visibility.m4
index e99e3fb..ce00e72 100644
--- a/m4/visibility.m4
+++ b/m4/visibility.m4
@@ -1,5 +1,5 @@
 # visibility.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 2010-2017 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.
diff --git a/m4/vsnprintf.m4 b/m4/vsnprintf.m4
index e056f05..9c37bca 100644
--- a/m4/vsnprintf.m4
+++ b/m4/vsnprintf.m4
@@ -1,5 +1,5 @@
-# vsnprintf.m4 serial 6
-dnl Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
+# vsnprintf.m4 serial 7
+dnl Copyright (C) 2002-2004, 2007-2017 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.
@@ -46,6 +46,14 @@ AC_DEFUN([gl_REPLACE_VSNPRINTF],
   AC_LIBOBJ([vsnprintf])
   if test $ac_cv_func_vsnprintf = yes; then
     REPLACE_VSNPRINTF=1
+  else
+    AC_CHECK_DECLS_ONCE([vsnprintf])
+    if test $ac_cv_have_decl_vsnprintf = yes; then
+      dnl If the function is declared but does not appear to exist, it may be
+      dnl defined as an inline function. In order to avoid a conflict, we have
+      dnl to define rpl_vsnprintf, not vsnprintf.
+      REPLACE_VSNPRINTF=1
+    fi
   fi
   gl_PREREQ_VSNPRINTF
 ])
diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4
index 08440ec..25ce737 100644
--- a/m4/warn-on-use.m4
+++ b/m4/warn-on-use.m4
@@ -1,5 +1,5 @@
 # warn-on-use.m4 serial 5
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2017 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.
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index 924e21d..e697174 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,5 +1,5 @@
 # warnings.m4 serial 11
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index b40b732..d0e11a0 100644
--- a/m4/wchar_h.m4
+++ b/m4/wchar_h.m4
@@ -1,13 +1,13 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2017 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.
 
 dnl Written by Eric Blake.
 
-# wchar_h.m4 serial 39
+# wchar_h.m4 serial 40
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -81,8 +81,14 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
 extern int zero (void);
 int main () { return zero(); }
 ]])])
+     dnl Do not rename the object file from conftest.$ac_objext to
+     dnl conftest1.$ac_objext, as this will cause the link to fail on
+     dnl z/OS when using the XPLINK object format (due to duplicate
+     dnl CSECT names). Instead, temporarily redefine $ac_compile so
+     dnl that the object file has the latter name from the start.
+     save_ac_compile="$ac_compile"
+     ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
      if AC_TRY_EVAL([ac_compile]); then
-       mv conftest.$ac_objext conftest1.$ac_objext
        AC_LANG_CONFTEST([
          AC_LANG_SOURCE([[#define wcstod renamed_wcstod
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
@@ -95,8 +101,9 @@ int main () { return zero(); }
 #include <wchar.h>
 int zero (void) { return 0; }
 ]])])
+       dnl See note above about renaming object files.
+       ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
        if AC_TRY_EVAL([ac_compile]); then
-         mv conftest.$ac_objext conftest2.$ac_objext
          if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext 
conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
            :
          else
@@ -104,6 +111,7 @@ int zero (void) { return 0; }
          fi
        fi
      fi
+     ac_compile="$save_ac_compile"
      rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
     ])
   if test $gl_cv_header_wchar_h_correct_inline = no; then
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
index 2db8c3f..11783d2 100644
--- a/m4/wchar_t.m4
+++ b/m4/wchar_t.m4
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2017 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.
diff --git a/m4/wcrtomb.m4 b/m4/wcrtomb.m4
index 267b3c9..0aa040d 100644
--- a/m4/wcrtomb.m4
+++ b/m4/wcrtomb.m4
@@ -1,5 +1,5 @@
 # wcrtomb.m4 serial 11
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
index accc001..45ddaeb 100644
--- a/m4/wctype_h.m4
+++ b/m4/wctype_h.m4
@@ -2,7 +2,7 @@
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2017 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.
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
index 8ff2a5b..65e25a4 100644
--- a/m4/wint_t.m4
+++ b/m4/wint_t.m4
@@ -1,11 +1,12 @@
-# wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+# wint_t.m4 serial 6
+dnl Copyright (C) 2003, 2007-2017 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.
 
 dnl From Bruno Haible.
-dnl Test whether <wchar.h> has the 'wint_t' type.
+dnl Test whether <wchar.h> has the 'wint_t' type and whether gnulib's
+dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
 dnl Prerequisite: AC_PROG_CC
 
 AC_DEFUN([gt_TYPE_WINT_T],
@@ -28,5 +29,34 @@ AC_DEFUN([gt_TYPE_WINT_T],
        [gt_cv_c_wint_t=no])])
   if test $gt_cv_c_wint_t = yes; then
     AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
+
+    dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
+    dnl override 'wint_t'.
+    AC_CACHE_CHECK([whether wint_t is too small],
+      [gl_cv_type_wint_t_too_small],
+      [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+              int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
+              ]])],
+           [gl_cv_type_wint_t_too_small=no],
+           [gl_cv_type_wint_t_too_small=yes])])
+    if test $gl_cv_type_wint_t_too_small = yes; then
+      GNULIB_OVERRIDES_WINT_T=1
+    else
+      GNULIB_OVERRIDES_WINT_T=0
+    fi
+  else
+    GNULIB_OVERRIDES_WINT_T=0
   fi
+  AC_SUBST([GNULIB_OVERRIDES_WINT_T])
 ])
diff --git a/m4/write.m4 b/m4/write.m4
index d9b93f9..fd46acc 100644
--- a/m4/write.m4
+++ b/m4/write.m4
@@ -1,5 +1,5 @@
 # write.m4 serial 5
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2017 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.
diff --git a/m4/xsize.m4 b/m4/xsize.m4
index 16764e8..5f85057 100644
--- a/m4/xsize.m4
+++ b/m4/xsize.m4
@@ -1,5 +1,5 @@
 # xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2017 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.
diff --git a/maint.mk b/maint.mk
index aa23364..0cabd2f 100644
--- a/maint.mk
+++ b/maint.mk
@@ -2,7 +2,7 @@
 # This Makefile fragment tries to be general-purpose enough to be
 # used by many projects via the gnulib maintainer-makefile module.
 
-## Copyright (C) 2001-2016 Free Software Foundation, Inc.
+## Copyright (C) 2001-2017 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
@@ -55,6 +55,10 @@ VC = $(GIT)
 
 VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir)
 
+# You can override this variable in cfg.mk if your gnulib submodule lives
+# in a different location.
+gnulib_dir ?= $(srcdir)/gnulib
+
 # You can override this variable in cfg.mk to set your own regexp
 # matching files to ignore.
 VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
@@ -437,17 +441,26 @@ sc_require_config_h:
        halt='the above files do not include <config.h>'                \
          $(_sc_search_regexp)
 
+# Print each file name for which the first #include does not match
+# $(config_h_header).  Like grep -m 1, this only looks at the first match.
+perl_config_h_first_ =                                                 \
+  -e 'BEGIN {$$ret = 0}'                                               \
+  -e 'if (/^\# *include\b/) {'                                         \
+  -e '  if (not m{^\# *include $(config_h_header)}) {'                 \
+  -e '    print "$$ARGV\n";'                                           \
+  -e '    $$ret = 1;'                                                  \
+  -e '  }'                                                             \
+  -e '  \# Move on to next file after first include'                   \
+  -e '  close ARGV;'                                                   \
+  -e '}'                                                               \
+  -e 'END {exit $$ret}'
+
 # You must include <config.h> before including any other header file.
 # This can possibly be via a package-specific header, if given by cfg.mk.
 sc_require_config_h_first:
        @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then          \
-         fail=0;                                                       \
-         for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do             \
-           grep '^# *include\>' $$i | $(SED) 1q                        \
-               | grep -E '^# *include $(config_h_header)' > /dev/null  \
-             || { echo $$i; fail=1; };                                 \
-         done;                                                         \
-         test $$fail = 1 &&                                            \
+         files=$$($(VC_LIST_EXCEPT) | grep '\.c$$') &&                 \
+         perl -n $(perl_config_h_first_) $$files ||                    \
            { echo '$(ME): the above files include some other header'   \
                'before <config.h>' 1>&2; exit 1; } || :;               \
        else :;                                                         \
@@ -648,17 +661,14 @@ sc_prohibit_strings_without_use:
        re='\<(strn?casecmp|ffs(ll)?)\>'                                \
          $(_sc_header_without_use)
 
-# Get the list of symbol names with this:
-# perl -lne '/^# *define ([A-Z]\w+)\(/ and print $1' lib/intprops.h|fmt
-_intprops_names =                                                      \
-  TYPE_IS_INTEGER TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM                        
\
-  INT_BITS_STRLEN_BOUND INT_STRLEN_BOUND INT_BUFSIZE_BOUND             \
-  INT_ADD_RANGE_OVERFLOW INT_SUBTRACT_RANGE_OVERFLOW                   \
-  INT_NEGATE_RANGE_OVERFLOW INT_MULTIPLY_RANGE_OVERFLOW                        
\
-  INT_DIVIDE_RANGE_OVERFLOW INT_REMAINDER_RANGE_OVERFLOW               \
-  INT_LEFT_SHIFT_RANGE_OVERFLOW INT_ADD_OVERFLOW INT_SUBTRACT_OVERFLOW \
-  INT_NEGATE_OVERFLOW INT_MULTIPLY_OVERFLOW INT_DIVIDE_OVERFLOW                
\
-  INT_REMAINDER_OVERFLOW INT_LEFT_SHIFT_OVERFLOW
+# Extract the raw list of symbol names with this:
+gl_extract_define_simple = \
+  /^\# *define ([A-Z]\w+)\(/ and print $$1
+# Filter out duplicates and convert to a space-separated list:
+_intprops_names = \
+  $(shell f=$(gnulib_dir)/lib/intprops.h;                              \
+    perl -lne '$(gl_extract_define_simple)' $$f | sort -u | tr '\n' ' ')
+# Remove trailing space and convert to a regular expression:
 _intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names)))
 # Prohibit the inclusion of intprops.h without an actual use.
 sc_prohibit_intprops_without_use:
@@ -708,15 +718,6 @@ sc_changelog:
          $(_sc_search_regexp)
 
 # Ensure that each .c file containing a "main" function also
-# calls set_program_name.
-sc_program_name:
-       @require='set_program_name *\(.*\);'                            \
-       in_vc_files='\.c$$'                                             \
-       containing='\<main *('                                          \
-       halt='the above files do not call set_program_name'             \
-         $(_sc_search_regexp)
-
-# Ensure that each .c file containing a "main" function also
 # calls bindtextdomain.
 sc_bindtextdomain:
        @require='bindtextdomain *\('                                   \
@@ -953,8 +954,13 @@ perl_filename_lineno_text_ =                               
                \
     -e '    print "$$ARGV:$$n:$$v\n";'                                 \
     -e '  }'
 
+prohibit_doubled_words_ = \
+    the then in an on if is it but for or at and do to
+# expand the regex before running the check to avoid using expensive captures
+prohibit_doubled_word_expanded_ = \
+    $(join $(prohibit_doubled_words_),$(addprefix 
\s+,$(prohibit_doubled_words_)))
 prohibit_doubled_word_RE_ ?= \
-  /\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims
+    /\b(?:$(subst $(_sp),|,$(prohibit_doubled_word_expanded_)))\b/gims
 prohibit_doubled_word_ =                                               \
     -e 'while ($(prohibit_doubled_word_RE_))'                          \
     $(perl_filename_lineno_text_)
@@ -977,10 +983,11 @@ sc_prohibit_doubled_word:
 # Also prohibit a prefix matching "\w+ +".
 # @pxref gets the same see/also treatment and should be parenthesized;
 # presume it must *not* start a sentence.
+# POSIX spells it "timestamp" rather than "time\s+stamp", so we do, too.
 bad_xref_re_ ?= (?:[\w,:;] +|(?:see|also)\s+)address@hidden
 bad_pxref_re_ ?= (?:[.!?]|(?:see|also))address@hidden
 prohibit_undesirable_word_seq_RE_ ?=                                   \
-  /(?:\bcan\s+not\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims
+  /(?:\bcan\s+not\b|\btime\s+stamps?\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims
 prohibit_undesirable_word_seq_ =                                       \
     -e 'while ($(prohibit_undesirable_word_seq_RE_))'                  \
     $(perl_filename_lineno_text_)
@@ -1123,6 +1130,21 @@ fix_po_file_diag = \
 'you have changed the set of files with translatable diagnostics;\n\
 apply the above patch\n'
 
+# Generate a list of files in which to search for translatable strings.
+perl_translatable_files_list_ =                                                
\
+  -e 'foreach $$file (@ARGV) {'                                                
\
+  -e ' \# Consider only file extensions with one or two letters'       \
+  -e ' $$file =~ /\...?$$/ or next;'                                   \
+  -e ' \# Ignore m4 and mk files'                                      \
+  -e ' $$file =~ /\.m[4k]$$/ and next;'                                \
+  -e ' \# Ignore a .c or .h file with a corresponding .l or .y file'   \
+  -e ' $$file =~ /(.+)\.[ch]$$/ && (-e "$${1}.l" || -e "$${1}.y")'     \
+  -e '   and next;'                                                    \
+  -e ' \# Skip unreadable files'                                       \
+  -e ' -r $$file or next;'                                             \
+  -e ' print "$$file ";'                                               \
+  -e '}'
+
 # Verify that all source files using _() (more specifically, files that
 # match $(_gl_translatable_string_re)) are listed in po/POTFILES.in.
 po_file ?= $(srcdir)/po/POTFILES.in
@@ -1132,21 +1154,8 @@ sc_po_check:
        @if test -f $(po_file); then                                    \
          grep -E -v '^(#|$$)' $(po_file)                               \
            | grep -v '^src/false\.c$$' | sort > address@hidden;                
        \
-         files=;                                                       \
-         for file in $$($(VC_LIST_EXCEPT)) $(generated_files); do      \
-           test -r $$file || continue;                                 \
-           case $$file in                                              \
-             *.m4|*.mk) continue ;;                                    \
-             *.?|*.??) ;;                                              \
-             *) continue;;                                             \
-           esac;                                                       \
-           case $$file in                                              \
-           *.[ch])                                                     \
-             base=`expr " $$file" : ' \(.*\)\..'`;                     \
-             { test -f $$base.l || test -f $$base.y; } && continue;;   \
-           esac;                                                       \
-           files="$$files $$file";                                     \
-         done;                                                         \
+         files=$$(perl $(perl_translatable_files_list_)                \
+           $$($(VC_LIST_EXCEPT)) $(generated_files));                  \
          grep -E -l '$(_gl_translatable_string_re)' $$files            \
            | $(SED) 's|^$(_dot_escaped_srcdir)/||' | sort -u > address@hidden; 
\
          diff -u -L $(po_file) -L $(po_file) address@hidden address@hidden     
                \
@@ -1284,7 +1293,6 @@ vc-diff-check:
 
 rel-files = $(DIST_ARCHIVES)
 
-gnulib_dir ?= $(srcdir)/gnulib
 gnulib-version = $$(cd $(gnulib_dir)                           \
                     && { git describe || git rev-parse --short=10 HEAD; } )
 bootstrap-tools ?= autoconf,automake,gnulib
@@ -1494,7 +1502,10 @@ gen-coverage:
                --highlight --frames --legend \
                --title "$(PACKAGE_NAME)"
 
-coverage: init-coverage build-coverage gen-coverage
+coverage:
+       $(MAKE) init-coverage
+       $(MAKE) build-coverage
+       $(MAKE) gen-coverage
 
 # Some projects carry local adjustments for gnulib modules via patches in
 # a gnulib patch directory whose default name is gl/ (defined in bootstrap



reply via email to

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