From MAILER-DAEMON Wed Jul 20 13:40:47 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bPvUF-0001pj-3Q
	for mharc-libidn-commit@gnu.org; Wed, 20 Jul 2016 13:40:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46197)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1bPvUC-0001pH-Fz
	for libidn-commit@gnu.org; Wed, 20 Jul 2016 13:40:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1bPvUB-0006Kd-6l
	for libidn-commit@gnu.org; Wed, 20 Jul 2016 13:40:44 -0400
Received: from vcs.savannah.gnu.org ([208.118.235.72]:55163)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1bPvUB-0006KO-1K
	for libidn-commit@gnu.org; Wed, 20 Jul 2016 13:40:43 -0400
Received: by vcs.savannah.gnu.org (Postfix, from userid 66976)
	id E50B8220159; Wed, 20 Jul 2016 17:40:42 +0000 (UTC)
From: "Simon Josefsson" <simon@josefsson.org>
To: libidn-commit@gnu.org
Subject: [SCM] GNU libidn annotated tag, libidn-1-33, created. libidn-1-33
X-Git-Refname: refs/tags/libidn-1-33
X-Git-Reftype: annotated tag
X-Git-Oldrev: 0000000000000000000000000000000000000000
X-Git-Newrev: bb59fe5da9ca73fb8fb782cc946961003919cf49
Message-Id: <20160720174042.E50B8220159@vcs.savannah.gnu.org>
Date: Wed, 20 Jul 2016 17:40:42 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.72
X-BeenThere: libidn-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: Commit messages for GNU Libidn <libidn-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libidn-commit>,
	<mailto:libidn-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libidn-commit/>
List-Post: <mailto:libidn-commit@gnu.org>
List-Help: <mailto:libidn-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libidn-commit>,
	<mailto:libidn-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jul 2016 17:40:45 -0000

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

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

The annotated tag, libidn-1-33 has been created
        at  bb59fe5da9ca73fb8fb782cc946961003919cf49 (tag)
   tagging  87d779b13f3343f1de101d5fdaf4065c8fb30be8 (commit)
  replaces  libidn-1-32
 tagged by  Simon Josefsson
        on  Wed Jul 20 19:40:23 2016 +0200

- Log -----------------------------------------------------------------
1.33
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAABCAAGBQJXj7eHAAoJEIYLf7sy+BGdK4oH/R/6nu5wT1mlsDpuyexgo+B4
4VGkj6nPuRp3W5DjADLlvThqli0bJB+3cU7aPCU1+EYD7hC4RSJTQWAmhewzuZqE
0TxDUilXeXij53cV28Hctj3cPL26KRHQg+02LMI4tnoJ1OVDP4DZuNcaExr7nzmz
6IyjsTRlc4967l9+/faEbynSKdamhdDcK/tSzkvJ0/FJPj+EZjA53cUHSVRctAwf
jc11f16GVOAT2BOePD++9XsGn11me6D3LnGZoVQie2jf3pei7Y6QpLrPrbal58Ok
duurBjqQWdBmEpXdRWDNUYdgKmotp2KDLscVzCSKVwsDxddOVkVwx8IhKTU7LFg=
=mdzf
-----END PGP SIGNATURE-----

Simon Josefsson (25):
      Update for 1.32.
      Bump version.
      Improve.
      Bump SO version.
      Dropped valgrind suppressions file, should no longer be needed.
      idn: Use getline instead of fgets with fixed-size buffer.
      Doc.
      Ignore more.
      Add regression check for Hanno Böck's stack OOB issue.
      Fix out-of-bounds stack read.  Report and patch by Hanno Böck.
      Add.
      Fix memory leak in last fix.
      stringprep_utf8_nfkc_normalize: Reject invalid UTF8 instead of crashing.
      Add.
      Update gnulib files.
      Bump copyright notices.
      Sync with TP.
      Really fix bug when reading \00 inputs.
      Doc fix.
      Ignore more.
      Update gl override patches.
      Update gnulib files.
      Ignore more.
      Doc fix.
      Version 1.33.

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


hooks/post-receive
-- 
GNU libidn


From MAILER-DAEMON Wed Jul 20 13:40:58 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bPvUQ-0001rh-Gw
	for mharc-libidn-commit@gnu.org; Wed, 20 Jul 2016 13:40:58 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46208)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1bPvUH-0001qe-GK
	for libidn-commit@gnu.org; Wed, 20 Jul 2016 13:40:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1bPvU8-0006K6-MO
	for libidn-commit@gnu.org; Wed, 20 Jul 2016 13:40:48 -0400
Received: from vcs.savannah.gnu.org ([208.118.235.72]:55157)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1bPvU8-0006K1-9M
	for libidn-commit@gnu.org; Wed, 20 Jul 2016 13:40:40 -0400
Received: by vcs.savannah.gnu.org (Postfix, from userid 66976)
	id 0BD2B220159; Wed, 20 Jul 2016 17:40:39 +0000 (UTC)
From: "Simon Josefsson" <simon@josefsson.org>
To: libidn-commit@gnu.org
Subject: [SCM] GNU libidn branch, master, updated. libidn-1-32-25-g87d779b
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7f06bc9edb80c1169d8fd4e887a982d719f1a1c9
X-Git-Newrev: 87d779b13f3343f1de101d5fdaf4065c8fb30be8
Message-Id: <20160720174040.0BD2B220159@vcs.savannah.gnu.org>
Date: Wed, 20 Jul 2016 17:40:39 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.72
X-BeenThere: libidn-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: Commit messages for GNU Libidn <libidn-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libidn-commit>,
	<mailto:libidn-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libidn-commit/>
List-Post: <mailto:libidn-commit@gnu.org>
List-Help: <mailto:libidn-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libidn-commit>,
	<mailto:libidn-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Jul 2016 17:40:57 -0000

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

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

The branch, master has been updated
       via  87d779b13f3343f1de101d5fdaf4065c8fb30be8 (commit)
       via  0bb408dd1cfe4fdc10f678729d27dbe5f271a446 (commit)
       via  7ed9a56c22c5ebb6b61992b63ea9a4fc6279f253 (commit)
       via  39c9648262ddd0d7d01d02b16a163a08e96f21d7 (commit)
       via  b2e9176dc40fba299edae5508c05e8ff03017d8e (commit)
      from  7f06bc9edb80c1169d8fd4e887a982d719f1a1c9 (commit)

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

- Log -----------------------------------------------------------------
commit 87d779b13f3343f1de101d5fdaf4065c8fb30be8
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Jul 20 19:25:58 2016 +0200

    Version 1.33.

commit 0bb408dd1cfe4fdc10f678729d27dbe5f271a446
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Jul 20 18:40:35 2016 +0200

    Doc fix.

commit 7ed9a56c22c5ebb6b61992b63ea9a4fc6279f253
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Jul 20 18:00:03 2016 +0200

    Ignore more.

commit 39c9648262ddd0d7d01d02b16a163a08e96f21d7
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Jul 20 17:51:26 2016 +0200

    Update gnulib files.

commit b2e9176dc40fba299edae5508c05e8ff03017d8e
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Jul 20 17:49:16 2016 +0200

    Update gl override patches.

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

Summary of changes:
 .gitignore                         |    2 +
 NEWS                               |    2 +-
 build-aux/gendocs.sh               |   40 ++++++-------
 gl/intprops.h                      |  110 +++++++++++++++++++++---------------
 gl/m4/dup2.m4                      |   14 ++++-
 gl/m4/extern-inline.m4             |    1 +
 gl/m4/getcwd.m4                    |    4 +-
 gl/m4/getdelim.m4                  |    4 +-
 gl/m4/getline.m4                   |    5 +-
 gl/m4/malloc.m4                    |   11 ++--
 gl/m4/manywarnings.m4              |   14 ++++-
 gl/m4/nocrash.m4                   |    3 +-
 gl/m4/realloc.m4                   |   11 ++--
 gl/m4/stdbool.m4                   |   34 ++++++-----
 gl/m4/stdint.m4                    |   29 +++++++++-
 gl/override/lib/gettext.h.diff     |   14 +++--
 gl/stddef.in.h                     |    6 +-
 gl/stdint.in.h                     |   14 ++---
 gl/verify.h                        |    2 +-
 gltests/Makefile.am                |    5 ++
 gltests/binary-io.h                |    2 +-
 gltests/dup2.c                     |   51 +++++++++++++++++
 gltests/init.sh                    |   31 +++++-----
 gltests/stdalign.in.h              |    6 +-
 gltests/test-getline.c             |    4 +-
 gltests/test-intprops.c            |   37 ++++--------
 gltests/test-stat.c                |    1 +
 gltests/test-stat.h                |    1 +
 gltests/wchar.in.h                 |    7 ++-
 lib/gl/m4/extern-inline.m4         |    1 +
 lib/gl/m4/malloc.m4                |   11 ++--
 lib/gl/m4/stdbool.m4               |   34 ++++++-----
 lib/gl/m4/stdint.m4                |   29 +++++++++-
 lib/gl/override/lib/gettext.h.diff |   14 +++--
 lib/gl/stddef.in.h                 |    6 +-
 lib/gl/stdint.in.h                 |   14 ++---
 lib/gltests/Makefile.am            |    5 ++
 lib/gltests/init.sh                |   31 +++++-----
 lib/gltests/intprops.h             |  110 +++++++++++++++++++++---------------
 lib/gltests/setlocale.c            |    1 +
 lib/gltests/stdalign.in.h          |    6 +-
 lib/gltests/test-intprops.c        |   37 ++++--------
 lib/gltests/test-localename.c      |   40 ++++++++++---
 lib/gltests/test-setlocale1.c      |    2 +
 lib/gltests/verify.h               |    2 +-
 lib/gltests/wchar.in.h             |    7 ++-
 maint.mk                           |    3 +-
 tests/tst_toascii64oob.c           |   11 +++-
 48 files changed, 533 insertions(+), 296 deletions(-)

diff --git a/.gitignore b/.gitignore
index 437b434..c18482f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -435,6 +435,8 @@ lib/gltests/test-c-strcasecmp
 lib/gltests/test-c-strcasecmp.o
 lib/gltests/test-c-strncasecmp
 lib/gltests/test-c-strncasecmp.o
+lib/gltests/test-ctype
+lib/gltests/test-ctype.o
 lib/gltests/test-environ
 lib/gltests/test-environ.o
 lib/gltests/test-iconv
diff --git a/NEWS b/NEWS
index 5fa080c..a082f90 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@ Libidn NEWS -- History of user-visible changes.                 -*- outline -*-
 Copyright (C) 2002-2016 Simon Josefsson
 See the end for copying conditions.
 
-* Version 1.33 (unreleased) [beta]
+* Version 1.33 (released 2016-07-20) [beta]
 
 ** libidn: Fix out-of-bounds stack read in idna_to_ascii_4i.
 See tests/tst_toascii64oob.c for regression check (and the comment in
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 1d1e1e7..fef6280 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,7 +2,7 @@
 # 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-01-01.00
+scriptversion=2016-05-20.09
 
 # Copyright 2003-2016 Free Software Foundation, Inc.
 #
@@ -52,6 +52,24 @@ templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_templ
 unset CDPATH
 unset use_texi2html
 
+MANUAL_TITLE=
+PACKAGE=
+EMAIL=webmasters@gnu.org  # please override with --email
+commonarg= # passed to all makeinfo/texi2html invcations.
+dirargs=   # passed to all tools (-I dir).
+dirs=      # -I directories.
+htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
+infoarg=--no-split
+generate_ascii=true
+generate_html=true
+generate_info=true
+generate_tex=true
+outdir=manual
+source_extra=
+split=node
+srcfile=
+texarg="-t @finalout"
+
 version="gendocs.sh $scriptversion
 
 Copyright 2016 Free Software Foundation, Inc.
@@ -74,7 +92,7 @@ Options:
   -I DIR       append DIR to the Texinfo search path.
   --common ARG pass ARG in all invocations.
   --html ARG   pass ARG to makeinfo or texi2html for HTML targets,
-                 instead of --css-ref=/software/gnulib/manual.css.
+                 instead of '$htmlarg'.
   --info ARG   pass ARG to makeinfo for Info, instead of --no-split.
   --no-ascii   skip generating the plain text output.
   --no-html    skip generating the html output.
@@ -137,24 +155,6 @@ SETLANG setting in the source.
 Email bug reports or enhancement requests to bug-gnulib@gnu.org.
 "
 
-MANUAL_TITLE=
-PACKAGE=
-EMAIL=webmasters@gnu.org  # please override with --email
-commonarg= # passed to all makeinfo/texi2html invcations.
-dirargs=   # passed to all tools (-I dir).
-dirs=      # -I directories.
-htmlarg=--css-ref=/software/gnulib/manual.css
-infoarg=--no-split
-generate_ascii=true
-generate_html=true
-generate_info=true
-generate_tex=true
-outdir=manual
-source_extra=
-split=node
-srcfile=
-texarg="-t @finalout"
-
 while test $# -gt 0; do
   case $1 in
     -s)          shift; srcfile=$1;;
diff --git a/gl/intprops.h b/gl/intprops.h
index e1a6107..e1fce5c 100644
--- a/gl/intprops.h
+++ b/gl/intprops.h
@@ -1,10 +1,10 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2005, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2016 Free Software Foundation, Inc.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -21,6 +21,7 @@
 #define _GL_INTPROPS_H
 
 #include <limits.h>
+#include <verify.h>
 
 /* Return a value with the common real type of E and V and the value of V.  */
 #define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
@@ -36,17 +37,6 @@
    an integer.  */
 #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
 
-/* True if negative values of the signed integer type T use two's
-   complement, ones' complement, or signed magnitude representation,
-   respectively.  Much GNU code assumes two's complement, but some
-   people like to be portable to all possible C hosts.  */
-#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
-#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
-#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
-
-/* True if the signed integer expression E uses two's complement.  */
-#define _GL_INT_TWOS_COMPLEMENT(e) (~ _GL_INT_CONVERT (e, 0) == -1)
-
 /* True if the real type T is signed.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
 
@@ -55,18 +45,10 @@
 #define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
 
 
-/* Minimum and maximum values for integer types and expressions.  These
-   macros have undefined behavior if T is signed and has padding bits.
-   If this is a problem for you, please let us know how to fix it for
-   your host.  */
+/* Minimum and maximum values for integer types and expressions.  */
 
 /* The maximum and minimum values for the integer type T.  */
-#define TYPE_MINIMUM(t)                                                 \
-  ((t) (! TYPE_SIGNED (t)                                               \
-        ? (t) 0                                                         \
-        : TYPE_SIGNED_MAGNITUDE (t)                                     \
-        ? ~ (t) 0                                                       \
-        : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
 #define TYPE_MAXIMUM(t)                                                 \
   ((t) (! TYPE_SIGNED (t)                                               \
         ? (t) -1                                                        \
@@ -76,7 +58,7 @@
    after integer promotion.  E should not have side effects.  */
 #define _GL_INT_MINIMUM(e)                                              \
   (EXPR_SIGNED (e)                                                      \
-   ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e)         \
+   ? ~ _GL_SIGNED_INT_MAXIMUM (e)                                       \
    : _GL_INT_CONVERT (e, 0))
 #define _GL_INT_MAXIMUM(e)                                              \
   (EXPR_SIGNED (e)                                                      \
@@ -85,8 +67,25 @@
 #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
   (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
 
+/* This include file assumes that signed types are two's complement without
+   padding bits; the above macros have undefined behavior otherwise.
+   If this is a problem for you, please let us know how to fix it for your host.
+   As a sanity check, test the assumption for some signed types that
+   <limits.h> bounds.  */
+verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
+verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
+verify (TYPE_MINIMUM (short int) == SHRT_MIN);
+verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
+verify (TYPE_MINIMUM (int) == INT_MIN);
+verify (TYPE_MAXIMUM (int) == INT_MAX);
+verify (TYPE_MINIMUM (long int) == LONG_MIN);
+verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+#ifdef LLONG_MAX
+verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
+verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+#endif
 
-/* Return 1 if the __typeof__ keyword works.  This could be done by
+/* 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__ \
      || (0x5110 <= __SUNPRO_C && !__STDC__))
@@ -223,24 +222,35 @@
    ? (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__)
 
 /* 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.  */
-#define _GL_ADD_OVERFLOW(a, b, min, max)                                \
-  ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
-   : (a) < 0 ? (b) <= (a) + (b)                                         \
-   : (b) < 0 ? (a) <= (a) + (b)                                         \
-   : (a) + (b) < (b))
-#define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
-  ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max)             \
-   : (a) < 0 ? 1                                                        \
-   : (b) < 0 ? (a) - (b) <= (a)                                         \
-   : (a) < (b))
-#define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
-  (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a))))       \
-   || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#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)
+#else
+# define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+   ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
+    : (a) < 0 ? (b) <= (a) + (b)                                         \
+    : (b) < 0 ? (a) <= (a) + (b)                                         \
+    : (a) + (b) < (b))
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
+   ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max)             \
+    : (a) < 0 ? 1                                                        \
+    : (b) < 0 ? (a) - (b) <= (a)                                         \
+    : (a) < (b))
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
+   (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a))))       \
+    || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#endif
 #define _GL_DIVIDE_OVERFLOW(a, b, min, max)                             \
   ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max)  \
    : (a) < 0 ? (b) <= (a) + (b) - 1                                     \
@@ -305,8 +315,12 @@
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
 #define INT_SUBTRACT_OVERFLOW(a, b) \
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
-#define INT_NEGATE_OVERFLOW(a) \
-  INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+#else
+# define INT_NEGATE_OVERFLOW(a) \
+   INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#endif
 #define INT_MULTIPLY_OVERFLOW(a, b) \
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
 #define INT_DIVIDE_OVERFLOW(a, b) \
@@ -326,7 +340,7 @@
                       _GL_INT_MINIMUM (0 * (b) + (a)),          \
                       _GL_INT_MAXIMUM (0 * (b) + (a)))
 
-/* Compute A + B, A - B, A * B, respectively, storing the result into *R.
+/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
    Return 1 if the result overflows.  See above for restrictions.  */
 #define INT_ADD_WRAPV(a, b, r) \
   _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW)
@@ -351,9 +365,10 @@
 # define _GL__GENERIC_BOGUS 0
 #endif
 
-/* Store A <op> B into *R, where OP specifies the operation.
-   BUILTIN is the builtin operation, and OVERFLOW the overflow predicate.
-   See above for restrictions.  */
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+   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)
 # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
 #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
@@ -404,7 +419,8 @@
 /* Store the low-order bits of A <op> B into *R, where the operation
    is given by OP.  Use the unsigned type UT for calculation to avoid
    overflow problems.  *R's type is T, with extremal values TMIN and
-   TMAX.  T must be a signed integer type.  */
+   TMAX.  T must be a signed integer type.  Return 1 if the result
+   overflows.  */
 #define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
   (sizeof ((a) op (b)) < sizeof (t) \
    ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4
index 63d6d8e..5b68312 100644
--- a/gl/m4/dup2.m4
+++ b/gl/m4/dup2.m4
@@ -1,4 +1,4 @@
-#serial 24
+#serial 25
 dnl Copyright (C) 2002, 2005, 2007, 2009-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,
@@ -62,6 +62,16 @@ AC_DEFUN([gl_FUNC_DUP2],
                result |= 32;
              dup2 (2, 255);
              dup2 (2, 256);
+             /* On OS/2 kLIBC, dup2() does not work on a directory fd.  */
+             {
+               int fd = open (".", O_RDONLY);
+               if (fd == -1)
+                 result |= 64;
+               else if (dup2 (fd, fd + 1) == -1)
+                 result |= 128;
+
+               close (fd);
+             }
              return result;]])
         ],
         [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
@@ -78,6 +88,8 @@ AC_DEFUN([gl_FUNC_DUP2],
              gl_cv_func_dup2_works="guessing no" ;;
            *-android*) # implemented using dup3(), which fails if oldfd == newfd
              gl_cv_func_dup2_works="guessing no" ;;
+           os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
+             gl_cv_func_dup2_works="guessing no" ;;
            *) gl_cv_func_dup2_works="guessing yes" ;;
          esac])
       ])
diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4
index fe282a5..1e578f3 100644
--- a/gl/m4/extern-inline.m4
+++ b/gl/m4/extern-inline.m4
@@ -54,6 +54,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
       ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
       : (199901L <= __STDC_VERSION__ \
          && !defined __HP_cc \
+         && !defined __PGI \
          && !(defined __SUNPRO_C && __STDC__))) \
      && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
 # define _GL_INLINE inline
diff --git a/gl/m4/getcwd.m4 b/gl/m4/getcwd.m4
index 2b1c416..566c3c1 100644
--- a/gl/m4/getcwd.m4
+++ b/gl/m4/getcwd.m4
@@ -6,7 +6,7 @@
 # with or without modifications, as long as this notice is preserved.
 
 # Written by Paul Eggert.
-# serial 12
+# serial 13
 
 AC_DEFUN([gl_FUNC_GETCWD_NULL],
   [
@@ -15,6 +15,7 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
    AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
      [gl_cv_func_getcwd_null],
      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#	 include <stdlib.h>
 #        if HAVE_UNISTD_H
 #         include <unistd.h>
 #        else /* on Windows with MSVC */
@@ -39,6 +40,7 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
                  return 3;
                if (f[1] != '\0')
                  return 4;
+               free (f);
                return 0;
              }
 #endif
diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
index f11195a..a1a7dcc 100644
--- a/gl/m4/getdelim.m4
+++ b/gl/m4/getdelim.m4
@@ -1,4 +1,4 @@
-# getdelim.m4 serial 10
+# getdelim.m4 serial 11
 
 dnl Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
 dnl
@@ -48,7 +48,9 @@ AC_DEFUN([gl_FUNC_GETDELIM],
         size_t siz = (size_t)(~0) / 4;
         if (getdelim (&line, &siz, '\n', in) == -1)
           return 3;
+        free (line);
       }
+      fclose (in);
       return 0;
     }
     ]])], [gl_cv_func_working_getdelim=yes] dnl The library version works.
diff --git a/gl/m4/getline.m4 b/gl/m4/getline.m4
index 443871f..f44751c 100644
--- a/gl/m4/getline.m4
+++ b/gl/m4/getline.m4
@@ -1,4 +1,4 @@
-# getline.m4 serial 26
+# getline.m4 serial 27
 
 dnl Copyright (C) 1998-2003, 2005-2007, 2009-2016 Free Software Foundation,
 dnl Inc.
@@ -47,6 +47,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
         int len = getline (&line, &siz, in);
         if (!(len == 4 && line && strcmp (line, "foo\n") == 0))
           return 2;
+        free (line);
       }
       {
         /* Test result for a NULL buffer and a non-zero size.
@@ -55,7 +56,9 @@ AC_DEFUN([gl_FUNC_GETLINE],
         size_t siz = (size_t)(~0) / 4;
         if (getline (&line, &siz, in) == -1)
           return 3;
+        free (line);
       }
+      fclose (in);
       return 0;
     }
     ]])], [am_cv_func_working_getline=yes] dnl The library version works.
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
index 717e8ad..c393690 100644
--- a/gl/m4/malloc.m4
+++ b/gl/m4/malloc.m4
@@ -1,4 +1,4 @@
-# malloc.m4 serial 14
+# malloc.m4 serial 15
 dnl Copyright (C) 2007, 2009-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,
@@ -6,8 +6,8 @@ dnl with or without modifications, as long as this notice is preserved.
 
 m4_version_prereq([2.70], [] ,[
 
-# This is taken from the following Autoconf patch:
-# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+# This is adapted with modifications from upstream Autoconf here:
+# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
 AC_DEFUN([_AC_FUNC_MALLOC_IF],
 [
   AC_REQUIRE([AC_HEADER_STDC])dnl
@@ -23,7 +23,10 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
             char *malloc ();
             #endif
           ]],
-          [[return ! malloc (0);]])
+          [[char *p = malloc (0);
+            int result = !p;
+            free (p);
+            return result;]])
        ],
        [ac_cv_func_malloc_0_nonnull=yes],
        [ac_cv_func_malloc_0_nonnull=no],
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index 12d68da..90823b0 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 7
+# manywarnings.m4 serial 8
 dnl Copyright (C) 2008-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,
@@ -129,6 +129,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wdiscarded-qualifiers \
     -Wdiv-by-zero \
     -Wdouble-promotion \
+    -Wduplicated-cond \
     -Wempty-body \
     -Wendif-labels \
     -Wenum-compare \
@@ -140,7 +141,10 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wformat-signedness \
     -Wformat-y2k \
     -Wformat-zero-length \
+    -Wframe-address \
     -Wfree-nonheap-object \
+    -Whsa \
+    -Wignored-attributes \
     -Wignored-qualifiers \
     -Wimplicit \
     -Wimplicit-function-declaration \
@@ -158,6 +162,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wmain \
     -Wmaybe-uninitialized \
     -Wmemset-transposed-args \
+    -Wmisleading-indentation \
     -Wmissing-braces \
     -Wmissing-declarations \
     -Wmissing-field-initializers \
@@ -168,6 +173,8 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wnarrowing \
     -Wnested-externs \
     -Wnonnull \
+    -Wnonnull-compare \
+    -Wnull-dereference \
     -Wodr \
     -Wold-style-declaration \
     -Wold-style-definition \
@@ -184,10 +191,12 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wpragmas \
     -Wreturn-local-addr \
     -Wreturn-type \
+    -Wscalar-storage-order \
     -Wsequence-point \
     -Wshadow \
     -Wshift-count-negative \
     -Wshift-count-overflow \
+    -Wshift-negative-value \
     -Wsizeof-array-argument \
     -Wsizeof-pointer-memaccess \
     -Wstack-protector \
@@ -205,6 +214,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wswitch-default \
     -Wsync-nand \
     -Wsystem-headers \
+    -Wtautological-compare \
     -Wtrampolines \
     -Wtrigraphs \
     -Wtype-limits \
@@ -237,6 +247,8 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
   # them here so that the above 'comm' command doesn't report a false match.
   gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
   gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
+  gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2"
+  gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2"
 
   # These are needed for older GCC versions.
   if test -n "$GCC"; then
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
index ecc55c6..d8dd8f1 100644
--- a/gl/m4/nocrash.m4
+++ b/gl/m4/nocrash.m4
@@ -110,11 +110,12 @@ nocrash_init (void)
 #else
 /* Avoid a crash on POSIX systems.  */
 #include <signal.h>
+#include <unistd.h>
 /* A POSIX signal handler.  */
 static void
 exception_handler (int sig)
 {
-  exit (1);
+  _exit (1);
 }
 static void
 nocrash_init (void)
diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4
index 7b32ddf..fc22825 100644
--- a/gl/m4/realloc.m4
+++ b/gl/m4/realloc.m4
@@ -1,4 +1,4 @@
-# realloc.m4 serial 13
+# realloc.m4 serial 14
 dnl Copyright (C) 2007, 2009-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,
@@ -6,8 +6,8 @@ dnl with or without modifications, as long as this notice is preserved.
 
 m4_version_prereq([2.70], [] ,[
 
-# This is taken from the following Autoconf patch:
-# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+# This is adapted with modifications from upstream Autoconf here:
+# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
 AC_DEFUN([_AC_FUNC_REALLOC_IF],
 [
   AC_REQUIRE([AC_HEADER_STDC])dnl
@@ -23,7 +23,10 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
             char *realloc ();
             #endif
           ]],
-          [[return ! realloc (0, 0);]])
+          [[char *p = realloc (0, 0);
+            int result = !p;
+            free (p);
+            return result;]])
        ],
        [ac_cv_func_realloc_0_nonnull=yes],
        [ac_cv_func_realloc_0_nonnull=no],
diff --git a/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4
index 625520f..a556153 100644
--- a/gl/m4/stdbool.m4
+++ b/gl/m4/stdbool.m4
@@ -5,7 +5,7 @@ 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 5
+#serial 6
 
 # Prepare for substituting <stdbool.h> if it is not supported.
 
@@ -43,21 +43,25 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
         [AC_LANG_PROGRAM(
            [[
              #include <stdbool.h>
-             #ifndef bool
-              "error: bool is not defined"
-             #endif
-             #ifndef false
-              "error: false is not defined"
-             #endif
-             #if false
-              "error: false is not 0"
-             #endif
-             #ifndef true
-              "error: true is not defined"
-             #endif
-             #if true != 1
-              "error: true is not 1"
+
+             #if __cplusplus < 201103
+              #ifndef bool
+               "error: bool is not defined"
+              #endif
+              #ifndef false
+               "error: false is not defined"
+              #endif
+              #if false
+               "error: false is not 0"
+              #endif
+              #ifndef true
+               "error: true is not defined"
+              #endif
+              #if true != 1
+               "error: true is not 1"
+              #endif
              #endif
+
              #ifndef __bool_true_false_are_defined
               "error: __bool_true_false_are_defined is not defined"
              #endif
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index 0f40ce8..0b4b906 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 43
+# stdint.m4 serial 44
 dnl Copyright (C) 2001-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,
@@ -70,6 +70,8 @@ AC_DEFUN_ONCE([gl_STDINT_H],
        AC_COMPILE_IFELSE([
          AC_LANG_PROGRAM([[
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
 #include <stdint.h>
 /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
 #if !(defined WCHAR_MIN && defined WCHAR_MAX)
@@ -218,6 +220,8 @@ struct s {
           AC_RUN_IFELSE([
             AC_LANG_PROGRAM([[
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
 #include <stdint.h>
 ]
 gl_STDINT_INCLUDES
@@ -279,6 +283,29 @@ static const char *macro_values[] =
       ])
   fi
   if test "$gl_cv_header_working_stdint_h" = yes; then
+    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([[
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+]
+gl_STDINT_INCLUDES
+[
+intmax_t im = INTMAX_MAX;
+int32_t i32 = INT32_C (0x7fffffff);
+         ]])],
+         [gl_cv_header_stdint_predates_cxx11_h=no])])
+
+    if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
+      AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
+                [Define to 1 if the system <stdint.h> predates C++11.])
+      AC_DEFINE([__STDC_LIMIT_MACROS], [1],
+                [Define to 1 if the system <stdint.h> predates C++11.])
+    fi
     STDINT_H=
   else
     dnl Check for <sys/inttypes.h>, and for
diff --git a/gl/override/lib/gettext.h.diff b/gl/override/lib/gettext.h.diff
index f3546bb..03ffd2e 100644
--- a/gl/override/lib/gettext.h.diff
+++ b/gl/override/lib/gettext.h.diff
@@ -1,6 +1,6 @@
---- gl/gettext.h.orig	2012-08-02 22:38:36.802409103 +0200
-+++ gl/gettext.h	2012-08-02 22:38:45.550409325 +0200
-@@ -107,182 +107,4 @@
+--- gl/gettext.h.orig
++++ gl/gettext.h
+@@ -107,186 +107,4 @@
     initializer for static 'char[]' or 'const char[]' variables.  */
  #define gettext_noop(String) String
  
@@ -122,15 +122,17 @@
 -  if (msg_ctxt_id != NULL)
 -#endif
 -    {
+-      int found_translation;
 -      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
 -      msg_ctxt_id[msgctxt_len - 1] = '\004';
 -      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
 -      translation = dcgettext (domain, msg_ctxt_id, category);
+-      found_translation = (translation != msg_ctxt_id);
 -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 -      if (msg_ctxt_id != buf)
 -        free (msg_ctxt_id);
 -#endif
--      if (translation != msg_ctxt_id)
+-      if (found_translation)
 -        return translation;
 -    }
 -  return msgid;
@@ -168,15 +170,17 @@
 -  if (msg_ctxt_id != NULL)
 -#endif
 -    {
+-      int found_translation;
 -      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
 -      msg_ctxt_id[msgctxt_len - 1] = '\004';
 -      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
 -      translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+-      found_translation = !(translation == msg_ctxt_id || translation == msgid_plural);
 -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 -      if (msg_ctxt_id != buf)
 -        free (msg_ctxt_id);
 -#endif
--      if (!(translation == msg_ctxt_id || translation == msgid_plural))
+-      if (found_translation)
 -        return translation;
 -    }
 -  return (n == 1 ? msgid : msgid_plural);
diff --git a/gl/stddef.in.h b/gl/stddef.in.h
index c6d2317..f4c4a10 100644
--- a/gl/stddef.in.h
+++ b/gl/stddef.in.h
@@ -81,8 +81,10 @@
 # define wchar_t int
 #endif
 
-/* Some platforms lack max_align_t.  */
-#if !@HAVE_MAX_ALIGN_T@
+/* Some platforms lack max_align_t.  The check for _GCC_MAX_ALIGN_T is
+   a hack in case the configure-time test was done with g++ even though
+   we are currently compiling with gcc.  */
+#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T)
 /* On the x86, the maximum storage alignment of double, long, etc. is 4,
    but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8,
    and the C11 standard allows this.  Work around this problem by
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
index d241391..cf65ec6 100644
--- a/gl/stdint.in.h
+++ b/gl/stdint.in.h
@@ -118,15 +118,10 @@
    picky compilers.  */
 
 #define _STDINT_MIN(signed, bits, zero) \
-  ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
+  ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
 
 #define _STDINT_MAX(signed, bits, zero) \
-  ((signed) \
-   ? ~ _STDINT_MIN (signed, bits, zero) \
-   : /* The expression for the unsigned case.  The subtraction of (signed) \
-        is a nop in the unsigned case and avoids "signed integer overflow" \
-        warnings in the signed case.  */ \
-     ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+  (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
 #if !GNULIB_defined_stdint_types
 
@@ -288,12 +283,17 @@ typedef gl_uint_fast32_t gl_uint_fast16_t;
 
 /* 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
 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
 
 /* 7.18.1.5. Greatest-width integer types */
 
diff --git a/gl/verify.h b/gl/verify.h
index 2f43837..5c8381d 100644
--- a/gl/verify.h
+++ b/gl/verify.h
@@ -263,7 +263,7 @@ template <int w>
 # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
 #elif 1200 <= _MSC_VER
 # define assume(R) __assume (R)
-#elif (defined lint \
+#elif ((defined GCC_LINT || defined lint) \
        && (__has_builtin (__builtin_trap) \
            || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))))
   /* Doing it this way helps various packages when configured with
diff --git a/gltests/Makefile.am b/gltests/Makefile.am
index 0b7a6b3..422b79a 100644
--- a/gltests/Makefile.am
+++ b/gltests/Makefile.am
@@ -946,6 +946,11 @@ EXTRA_DIST += test-vc-list-files-git.sh test-vc-list-files-cvs.sh
 TESTS_ENVIRONMENT += MAKE='$(MAKE)'
 TESTS += test-verify test-verify.sh
 check_PROGRAMS += test-verify
+
+# This test expects compilation of test-verify.c to fail, and
+# each time it fails, the makefile rule does not perform the usual
+#  "mv -f $name.Tpo $name.po, so tell make clean to remove that file.
+MOSTLYCLEANFILES += .deps/test-verify.Tpo
 EXTRA_DIST += test-verify.c test-verify.sh
 
 ## end   gnulib module verify-tests
diff --git a/gltests/binary-io.h b/gltests/binary-io.h
index d5c8233..9f17c0d 100644
--- a/gltests/binary-io.h
+++ b/gltests/binary-io.h
@@ -60,7 +60,7 @@ set_binary_mode (int fd, int mode)
 
 /* SET_BINARY (fd);
    changes the file descriptor fd to perform binary I/O.  */
-#ifdef __DJGPP__
+#if defined __DJGPP__ || defined __EMX__
 # include <unistd.h> /* declares isatty() */
   /* Avoid putting stdin/stdout in binary mode if it is connected to
      the console, because that would make it impossible for the user
diff --git a/gltests/dup2.c b/gltests/dup2.c
index c913f47..5d026f2 100644
--- a/gltests/dup2.c
+++ b/gltests/dup2.c
@@ -85,6 +85,57 @@ ms_windows_dup2 (int fd, int desired_fd)
 
 #  define dup2 ms_windows_dup2
 
+# elif defined __KLIBC__
+
+#  include <InnoTekLIBC/backend.h>
+
+static int
+klibc_dup2dirfd (int fd, int desired_fd)
+{
+  int tempfd;
+  int dupfd;
+
+  tempfd = open ("NUL", O_RDONLY);
+  if (tempfd == -1)
+    return -1;
+
+  if (tempfd == desired_fd)
+    {
+      close (tempfd);
+
+      char path[_MAX_PATH];
+      if (__libc_Back_ioFHToPath (fd, path, sizeof (path)))
+        return -1;
+
+      return open(path, O_RDONLY);
+    }
+
+  dupfd = klibc_dup2dirfd (fd, desired_fd);
+
+  close (tempfd);
+
+  return dupfd;
+}
+
+static int
+klibc_dup2 (int fd, int desired_fd)
+{
+  int dupfd;
+  struct stat sbuf;
+
+  dupfd = dup2 (fd, desired_fd);
+  if (dupfd == -1 && errno == ENOTSUP \
+      && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
+    {
+      close (desired_fd);
+
+      return klibc_dup2dirfd (fd, desired_fd);
+    }
+
+  return dupfd;
+}
+
+#  define dup2 klibc_dup2
 # endif
 
 int
diff --git a/gltests/init.sh b/gltests/init.sh
index ee08022..97e4e4b 100644
--- a/gltests/init.sh
+++ b/gltests/init.sh
@@ -308,13 +308,19 @@ if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
       fi
     }
   fi
-elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
+elif
+  for diff_opt_ in -U3 -c '' no; do
+    test "$diff_opt_" = no && break
+    diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" </dev/null` && break
+  done
+  test "$diff_opt_" != no
+then
   if test -z "$diff_out_"; then
-    compare_ () { diff -c "$@"; }
+    compare_ () { diff $diff_opt_ "$@"; }
   else
     compare_ ()
     {
-      if diff -c "$@" > diff.out; then
+      if diff $diff_opt_ "$@" > diff.out; then
         # No differences were found, but AIX and HP-UX 'diff' produce output
         # "No differences encountered" or "There are no differences between the
         # files.". Hide this output.
@@ -466,7 +472,6 @@ setup_ ()
   fi
 
   initial_cwd_=$PWD
-  fail=0
 
   pfx_=`testdir_prefix_`
   test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
@@ -550,8 +555,9 @@ mktempd_ ()
   # Disallow any trailing slash on specified destdir:
   # it would subvert the post-mktemp "case"-based destdir test.
   case $destdir_ in
-  /) ;;
+  / | //) destdir_slash_=$destdir;;
   */) fail_ "invalid destination dir: remove trailing slash(es)";;
+  *) destdir_slash_=$destdir_/;;
   esac
 
   case $template_ in
@@ -561,20 +567,17 @@ mktempd_ ()
   esac
 
   # First, try to use mktemp.
-  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` \
-    || fail=1
+  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` &&
 
   # The resulting name must be in the specified directory.
-  case $d in "$destdir_"*);; *) fail=1;; esac
+  case $d in "$destdir_slash_"*) :;; *) false;; esac &&
 
   # It must have created the directory.
-  test -d "$d" || fail=1
+  test -d "$d" &&
 
   # It must have 0700 permissions.  Handle sticky "S" bits.
-  perms=`ls -dgo "$d" 2>/dev/null|tr S -` || fail=1
-  case $perms in drwx------*) ;; *) fail=1;; esac
-
-  test $fail = 0 && {
+  perms=`ls -dgo "$d" 2>/dev/null` &&
+  case $perms in drwx--[-S]---*) :;; *) false;; esac && {
     echo "$d"
     return
   }
@@ -593,7 +596,7 @@ mktempd_ ()
   i_=1
   while :; do
     X_=`rand_bytes_ $nx_`
-    candidate_dir_="$destdir_/$base_template_$X_"
+    candidate_dir_="$destdir_slash_$base_template_$X_"
     err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
       && { echo "$candidate_dir_"; return; }
     test $MAX_TRIES_ -le $i_ && break;
diff --git a/gltests/stdalign.in.h b/gltests/stdalign.in.h
index 9abb9aa..12f8a15 100644
--- a/gltests/stdalign.in.h
+++ b/gltests/stdalign.in.h
@@ -103,15 +103,15 @@
 # elif ((defined __APPLE__ && defined __MACH__                  \
          ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__)                 \
          : __GNUC__)                                            \
-        || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__        \
-        || __ICC || 0x590 <= __SUNPRO_C)
+        || 061200 <= __HP_cc || 061200 <= __HP_aCC                \
+        || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)
 #  define _Alignas(a) __attribute__ ((__aligned__ (a)))
 # elif 1300 <= _MSC_VER
 #  define _Alignas(a) __declspec (align (a))
 # endif
 #endif
 #if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \
-     || (defined __STDC_VERSION && 201112 <= __STDC_VERSION__))
+     || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
 # define alignas _Alignas
 #endif
 #if defined alignas || (defined __cplusplus && 201103 <= __cplusplus)
diff --git a/gltests/test-getline.c b/gltests/test-getline.c
index adf2cc4..13dcb1d 100644
--- a/gltests/test-getline.c
+++ b/gltests/test-getline.c
@@ -71,8 +71,8 @@ main (void)
   free (line);
 
   /* Test growth of buffer, must not leak.  */
-  line = malloc (1);
-  len = 0;
+  len = 1;
+  line = malloc (len);
   result = getline (&line, &len, f);
   ASSERT (result == 3);
   ASSERT (strcmp (line, "bc\n") == 0);
diff --git a/gltests/test-intprops.c b/gltests/test-intprops.c
index 174ddec..0a8ddcd 100644
--- a/gltests/test-intprops.c
+++ b/gltests/test-intprops.c
@@ -22,12 +22,9 @@
 # pragma GCC diagnostic ignored "-Woverlength-strings"
 # pragma GCC diagnostic ignored "-Wtype-limits"
 
-/* Work around a bug in GCC 5.3.1 and earlier; see:
-   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971
-   Hope it will be fixed by the time GCC 6 comes out.  */
-# if __GNUC__ < 6
-#  pragma GCC diagnostic ignored "-Woverflow"
-# endif
+/* Work around a bug in GCC 6.1 and earlier; see:
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971  */
+# pragma GCC diagnostic ignored "-Woverflow"
 
 #endif
 
@@ -94,12 +91,8 @@ main (void)
   ASSERT (TYPE_SIGNED (double));
   ASSERT (TYPE_SIGNED (long double));
 
-  /* Integer representation.  */
-  VERIFY (INT_MIN + INT_MAX < 0
-          ? (TYPE_TWOS_COMPLEMENT (int)
-             && ! TYPE_ONES_COMPLEMENT (int) && ! TYPE_SIGNED_MAGNITUDE (int))
-          : (! TYPE_TWOS_COMPLEMENT (int)
-             && (TYPE_ONES_COMPLEMENT (int) || TYPE_SIGNED_MAGNITUDE (int))));
+  /* Integer representation.  Check that it is two's complement.  */
+  VERIFY (INT_MIN + INT_MAX < 0);
 
   /* TYPE_MINIMUM, TYPE_MAXIMUM.  */
   VERIFY (TYPE_MINIMUM (char) == CHAR_MIN);
@@ -156,8 +149,7 @@ main (void)
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_##opname##_WRAPV (a, b, &result) == (v));               \
-      ASSERT (result == ((v) ? (vres) : ((a) op (b)))                     \
-              || ((v) && !TYPE_TWOS_COMPLEMENT (t)));                     \
+      ASSERT (result == ((v) ? (vres) : ((a) op (b))));                   \
     }
   #define CHECK_UNOP(op, opname, a, t, v)                                 \
     VERIFY (INT_##opname##_RANGE_OVERFLOW (a, TYPE_MINIMUM (t),           \
@@ -183,7 +175,7 @@ main (void)
   CHECK_BINOP (-, SUBTRACT, UINT_MAX, 1u, unsigned int, false, UINT_MAX - 1u);
   CHECK_BINOP (-, SUBTRACT, 0u, 1u, unsigned int, true, 0u - 1u);
 
-  CHECK_UNOP (-, NEGATE, INT_MIN, int, TYPE_TWOS_COMPLEMENT (int));
+  CHECK_UNOP (-, NEGATE, INT_MIN, int, true);
   CHECK_UNOP (-, NEGATE, 0, int, false);
   CHECK_UNOP (-, NEGATE, INT_MAX, int, false);
   CHECK_UNOP (-, NEGATE, 0u, unsigned int, false);
@@ -230,8 +222,7 @@ main (void)
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_ADD_WRAPV (a, b, &result) == (v));                      \
-      ASSERT (result == ((v) ? (vres) : ((a) + (b)))                      \
-              || ((v) && !TYPE_TWOS_COMPLEMENT (t)));                     \
+      ASSERT (result == ((v) ? (vres) : ((a) + (b))));                    \
     }
   CHECK_SSUM (-1, LONG_MIN, long int, true, LONG_MAX);
   CHECK_SUM (-1, UINT_MAX, unsigned int, false, DONTCARE);
@@ -259,8 +250,7 @@ main (void)
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_SUBTRACT_WRAPV (a, b, &result) == (v));                 \
-      ASSERT (result == ((v) ? (vres) : ((a) - (b)))                      \
-              || ((v) && !TYPE_TWOS_COMPLEMENT (t)));                     \
+      ASSERT (result == ((v) ? (vres) : ((a) - (b))));                    \
     }
   CHECK_DIFFERENCE (INT_MAX, 1u, unsigned int, UINT_MAX < INT_MAX - 1,
                     INT_MAX - 1u);
@@ -292,8 +282,7 @@ main (void)
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_MULTIPLY_WRAPV (a, b, &result) == (v));                 \
-      ASSERT (result == ((v) ? (vres) : ((a) * (b)))                      \
-              || ((v) && !TYPE_TWOS_COMPLEMENT (t)));                     \
+      ASSERT (result == ((v) ? (vres) : ((a) * (b))));                    \
     }
   CHECK_PRODUCT (-1, 1u, unsigned int, true, -1 * 1u);
   CHECK_SPRODUCT (-1, INT_MIN, int, INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
@@ -351,8 +340,7 @@ main (void)
 
   #define CHECK_QUOTIENT(a, b, v) VERIFY (INT_DIVIDE_OVERFLOW (a, b) == (v))
 
-  CHECK_QUOTIENT (INT_MIN, -1L,
-                  TYPE_TWOS_COMPLEMENT (long int) && INT_MIN == LONG_MIN);
+  CHECK_QUOTIENT (INT_MIN, -1L, INT_MIN == LONG_MIN);
   CHECK_QUOTIENT (INT_MIN, UINT_MAX, false);
   CHECK_QUOTIENT (INTMAX_MIN, UINTMAX_MAX, false);
   CHECK_QUOTIENT (INTMAX_MIN, UINT_MAX, false);
@@ -365,8 +353,7 @@ main (void)
 
   #define CHECK_REMAINDER(a, b, v) VERIFY (INT_REMAINDER_OVERFLOW (a, b) == (v))
 
-  CHECK_REMAINDER (INT_MIN, -1L,
-                   TYPE_TWOS_COMPLEMENT (long int) && INT_MIN == LONG_MIN);
+  CHECK_REMAINDER (INT_MIN, -1L, INT_MIN == LONG_MIN);
   CHECK_REMAINDER (-1, UINT_MAX, true);
   CHECK_REMAINDER ((intmax_t) -1, UINTMAX_MAX, true);
   CHECK_REMAINDER (INTMAX_MIN, UINT_MAX,
diff --git a/gltests/test-stat.c b/gltests/test-stat.c
index b1f2d12..4510e59 100644
--- a/gltests/test-stat.c
+++ b/gltests/test-stat.c
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (stat, int, (char const *, struct stat *));
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
+#include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
 
diff --git a/gltests/test-stat.h b/gltests/test-stat.h
index 28e1e24..4cf6c6d 100644
--- a/gltests/test-stat.h
+++ b/gltests/test-stat.h
@@ -95,6 +95,7 @@ test_stat_func (int (*func) (char const *, struct stat *), bool print)
   ASSERT (unlink (BASE "link2") == 0);
   ASSERT (unlink (BASE "link3") == 0);
   ASSERT (unlink (BASE "link4") == 0);
+  free (cwd);
 
   return 0;
 }
diff --git a/gltests/wchar.in.h b/gltests/wchar.in.h
index e98ab61..755600f 100644
--- a/gltests/wchar.in.h
+++ b/gltests/wchar.in.h
@@ -31,7 +31,7 @@
 @PRAGMA_COLUMNS@
 
 #if (((defined __need_mbstate_t || defined __need_wint_t)               \
-      && !defined __MINGW32__)                                          \
+      && !defined __MINGW32__ && !defined __KLIBC__)                    \
      || (defined __hpux                                                 \
          && ((defined _INTTYPES_INCLUDED && !defined strtoimax)         \
              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
@@ -445,6 +445,11 @@ _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 #  if !@HAVE_DECL_WCWIDTH@
 /* wcwidth exists but is not declared.  */
 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+#  elif defined __KLIBC__
+/* On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
+   static inline function.  The implementation of wcwidth in wcwidth.c
+   causes a "conflicting types" error. */
+#   undef wcwidth
 #  endif
 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
 # endif
diff --git a/lib/gl/m4/extern-inline.m4 b/lib/gl/m4/extern-inline.m4
index fe282a5..1e578f3 100644
--- a/lib/gl/m4/extern-inline.m4
+++ b/lib/gl/m4/extern-inline.m4
@@ -54,6 +54,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
       ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
       : (199901L <= __STDC_VERSION__ \
          && !defined __HP_cc \
+         && !defined __PGI \
          && !(defined __SUNPRO_C && __STDC__))) \
      && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
 # define _GL_INLINE inline
diff --git a/lib/gl/m4/malloc.m4 b/lib/gl/m4/malloc.m4
index 717e8ad..c393690 100644
--- a/lib/gl/m4/malloc.m4
+++ b/lib/gl/m4/malloc.m4
@@ -1,4 +1,4 @@
-# malloc.m4 serial 14
+# malloc.m4 serial 15
 dnl Copyright (C) 2007, 2009-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,
@@ -6,8 +6,8 @@ dnl with or without modifications, as long as this notice is preserved.
 
 m4_version_prereq([2.70], [] ,[
 
-# This is taken from the following Autoconf patch:
-# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+# This is adapted with modifications from upstream Autoconf here:
+# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
 AC_DEFUN([_AC_FUNC_MALLOC_IF],
 [
   AC_REQUIRE([AC_HEADER_STDC])dnl
@@ -23,7 +23,10 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
             char *malloc ();
             #endif
           ]],
-          [[return ! malloc (0);]])
+          [[char *p = malloc (0);
+            int result = !p;
+            free (p);
+            return result;]])
        ],
        [ac_cv_func_malloc_0_nonnull=yes],
        [ac_cv_func_malloc_0_nonnull=no],
diff --git a/lib/gl/m4/stdbool.m4 b/lib/gl/m4/stdbool.m4
index 625520f..a556153 100644
--- a/lib/gl/m4/stdbool.m4
+++ b/lib/gl/m4/stdbool.m4
@@ -5,7 +5,7 @@ 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 5
+#serial 6
 
 # Prepare for substituting <stdbool.h> if it is not supported.
 
@@ -43,21 +43,25 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
         [AC_LANG_PROGRAM(
            [[
              #include <stdbool.h>
-             #ifndef bool
-              "error: bool is not defined"
-             #endif
-             #ifndef false
-              "error: false is not defined"
-             #endif
-             #if false
-              "error: false is not 0"
-             #endif
-             #ifndef true
-              "error: true is not defined"
-             #endif
-             #if true != 1
-              "error: true is not 1"
+
+             #if __cplusplus < 201103
+              #ifndef bool
+               "error: bool is not defined"
+              #endif
+              #ifndef false
+               "error: false is not defined"
+              #endif
+              #if false
+               "error: false is not 0"
+              #endif
+              #ifndef true
+               "error: true is not defined"
+              #endif
+              #if true != 1
+               "error: true is not 1"
+              #endif
              #endif
+
              #ifndef __bool_true_false_are_defined
               "error: __bool_true_false_are_defined is not defined"
              #endif
diff --git a/lib/gl/m4/stdint.m4 b/lib/gl/m4/stdint.m4
index 0f40ce8..0b4b906 100644
--- a/lib/gl/m4/stdint.m4
+++ b/lib/gl/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 43
+# stdint.m4 serial 44
 dnl Copyright (C) 2001-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,
@@ -70,6 +70,8 @@ AC_DEFUN_ONCE([gl_STDINT_H],
        AC_COMPILE_IFELSE([
          AC_LANG_PROGRAM([[
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
 #include <stdint.h>
 /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
 #if !(defined WCHAR_MIN && defined WCHAR_MAX)
@@ -218,6 +220,8 @@ struct s {
           AC_RUN_IFELSE([
             AC_LANG_PROGRAM([[
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
 #include <stdint.h>
 ]
 gl_STDINT_INCLUDES
@@ -279,6 +283,29 @@ static const char *macro_values[] =
       ])
   fi
   if test "$gl_cv_header_working_stdint_h" = yes; then
+    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([[
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+]
+gl_STDINT_INCLUDES
+[
+intmax_t im = INTMAX_MAX;
+int32_t i32 = INT32_C (0x7fffffff);
+         ]])],
+         [gl_cv_header_stdint_predates_cxx11_h=no])])
+
+    if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
+      AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
+                [Define to 1 if the system <stdint.h> predates C++11.])
+      AC_DEFINE([__STDC_LIMIT_MACROS], [1],
+                [Define to 1 if the system <stdint.h> predates C++11.])
+    fi
     STDINT_H=
   else
     dnl Check for <sys/inttypes.h>, and for
diff --git a/lib/gl/override/lib/gettext.h.diff b/lib/gl/override/lib/gettext.h.diff
index 4a10e0d..4d20640 100644
--- a/lib/gl/override/lib/gettext.h.diff
+++ b/lib/gl/override/lib/gettext.h.diff
@@ -1,6 +1,6 @@
---- lib/gl/gettext.h.orig	2012-08-02 22:39:01.426409735 +0200
-+++ lib/gl/gettext.h	2012-08-02 22:39:11.198409976 +0200
-@@ -107,182 +107,4 @@
+--- lib/gl/gettext.h.orig
++++ lib/gl/gettext.h
+@@ -107,186 +107,4 @@
     initializer for static 'char[]' or 'const char[]' variables.  */
  #define gettext_noop(String) String
  
@@ -122,15 +122,17 @@
 -  if (msg_ctxt_id != NULL)
 -#endif
 -    {
+-      int found_translation;
 -      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
 -      msg_ctxt_id[msgctxt_len - 1] = '\004';
 -      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
 -      translation = dcgettext (domain, msg_ctxt_id, category);
+-      found_translation = (translation != msg_ctxt_id);
 -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 -      if (msg_ctxt_id != buf)
 -        free (msg_ctxt_id);
 -#endif
--      if (translation != msg_ctxt_id)
+-      if (found_translation)
 -        return translation;
 -    }
 -  return msgid;
@@ -168,15 +170,17 @@
 -  if (msg_ctxt_id != NULL)
 -#endif
 -    {
+-      int found_translation;
 -      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
 -      msg_ctxt_id[msgctxt_len - 1] = '\004';
 -      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
 -      translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+-      found_translation = !(translation == msg_ctxt_id || translation == msgid_plural);
 -#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
 -      if (msg_ctxt_id != buf)
 -        free (msg_ctxt_id);
 -#endif
--      if (!(translation == msg_ctxt_id || translation == msgid_plural))
+-      if (found_translation)
 -        return translation;
 -    }
 -  return (n == 1 ? msgid : msgid_plural);
diff --git a/lib/gl/stddef.in.h b/lib/gl/stddef.in.h
index edbf852..a400474 100644
--- a/lib/gl/stddef.in.h
+++ b/lib/gl/stddef.in.h
@@ -81,8 +81,10 @@
 # define wchar_t int
 #endif
 
-/* Some platforms lack max_align_t.  */
-#if !@HAVE_MAX_ALIGN_T@
+/* Some platforms lack max_align_t.  The check for _GCC_MAX_ALIGN_T is
+   a hack in case the configure-time test was done with g++ even though
+   we are currently compiling with gcc.  */
+#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T)
 /* On the x86, the maximum storage alignment of double, long, etc. is 4,
    but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8,
    and the C11 standard allows this.  Work around this problem by
diff --git a/lib/gl/stdint.in.h b/lib/gl/stdint.in.h
index deb5591..7ac0b1b 100644
--- a/lib/gl/stdint.in.h
+++ b/lib/gl/stdint.in.h
@@ -118,15 +118,10 @@
    picky compilers.  */
 
 #define _STDINT_MIN(signed, bits, zero) \
-  ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
+  ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
 
 #define _STDINT_MAX(signed, bits, zero) \
-  ((signed) \
-   ? ~ _STDINT_MIN (signed, bits, zero) \
-   : /* The expression for the unsigned case.  The subtraction of (signed) \
-        is a nop in the unsigned case and avoids "signed integer overflow" \
-        warnings in the signed case.  */ \
-     ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+  (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
 #if !GNULIB_defined_stdint_types
 
@@ -288,12 +283,17 @@ typedef gl_uint_fast32_t gl_uint_fast16_t;
 
 /* 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
 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
 
 /* 7.18.1.5. Greatest-width integer types */
 
diff --git a/lib/gltests/Makefile.am b/lib/gltests/Makefile.am
index 6a04b70..89d744b 100644
--- a/lib/gltests/Makefile.am
+++ b/lib/gltests/Makefile.am
@@ -973,6 +973,11 @@ EXTRA_DIST += verify.h
 TESTS_ENVIRONMENT += MAKE='$(MAKE)'
 TESTS += test-verify test-verify.sh
 check_PROGRAMS += test-verify
+
+# This test expects compilation of test-verify.c to fail, and
+# each time it fails, the makefile rule does not perform the usual
+#  "mv -f $name.Tpo $name.po, so tell make clean to remove that file.
+MOSTLYCLEANFILES += .deps/test-verify.Tpo
 EXTRA_DIST += test-verify.c test-verify.sh
 
 ## end   gnulib module verify-tests
diff --git a/lib/gltests/init.sh b/lib/gltests/init.sh
index ee08022..97e4e4b 100644
--- a/lib/gltests/init.sh
+++ b/lib/gltests/init.sh
@@ -308,13 +308,19 @@ if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
       fi
     }
   fi
-elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
+elif
+  for diff_opt_ in -U3 -c '' no; do
+    test "$diff_opt_" = no && break
+    diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" </dev/null` && break
+  done
+  test "$diff_opt_" != no
+then
   if test -z "$diff_out_"; then
-    compare_ () { diff -c "$@"; }
+    compare_ () { diff $diff_opt_ "$@"; }
   else
     compare_ ()
     {
-      if diff -c "$@" > diff.out; then
+      if diff $diff_opt_ "$@" > diff.out; then
         # No differences were found, but AIX and HP-UX 'diff' produce output
         # "No differences encountered" or "There are no differences between the
         # files.". Hide this output.
@@ -466,7 +472,6 @@ setup_ ()
   fi
 
   initial_cwd_=$PWD
-  fail=0
 
   pfx_=`testdir_prefix_`
   test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
@@ -550,8 +555,9 @@ mktempd_ ()
   # Disallow any trailing slash on specified destdir:
   # it would subvert the post-mktemp "case"-based destdir test.
   case $destdir_ in
-  /) ;;
+  / | //) destdir_slash_=$destdir;;
   */) fail_ "invalid destination dir: remove trailing slash(es)";;
+  *) destdir_slash_=$destdir_/;;
   esac
 
   case $template_ in
@@ -561,20 +567,17 @@ mktempd_ ()
   esac
 
   # First, try to use mktemp.
-  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` \
-    || fail=1
+  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` &&
 
   # The resulting name must be in the specified directory.
-  case $d in "$destdir_"*);; *) fail=1;; esac
+  case $d in "$destdir_slash_"*) :;; *) false;; esac &&
 
   # It must have created the directory.
-  test -d "$d" || fail=1
+  test -d "$d" &&
 
   # It must have 0700 permissions.  Handle sticky "S" bits.
-  perms=`ls -dgo "$d" 2>/dev/null|tr S -` || fail=1
-  case $perms in drwx------*) ;; *) fail=1;; esac
-
-  test $fail = 0 && {
+  perms=`ls -dgo "$d" 2>/dev/null` &&
+  case $perms in drwx--[-S]---*) :;; *) false;; esac && {
     echo "$d"
     return
   }
@@ -593,7 +596,7 @@ mktempd_ ()
   i_=1
   while :; do
     X_=`rand_bytes_ $nx_`
-    candidate_dir_="$destdir_/$base_template_$X_"
+    candidate_dir_="$destdir_slash_$base_template_$X_"
     err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
       && { echo "$candidate_dir_"; return; }
     test $MAX_TRIES_ -le $i_ && break;
diff --git a/lib/gltests/intprops.h b/lib/gltests/intprops.h
index e1a6107..e1fce5c 100644
--- a/lib/gltests/intprops.h
+++ b/lib/gltests/intprops.h
@@ -1,10 +1,10 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2005, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2016 Free Software Foundation, Inc.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -21,6 +21,7 @@
 #define _GL_INTPROPS_H
 
 #include <limits.h>
+#include <verify.h>
 
 /* Return a value with the common real type of E and V and the value of V.  */
 #define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
@@ -36,17 +37,6 @@
    an integer.  */
 #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
 
-/* True if negative values of the signed integer type T use two's
-   complement, ones' complement, or signed magnitude representation,
-   respectively.  Much GNU code assumes two's complement, but some
-   people like to be portable to all possible C hosts.  */
-#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
-#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
-#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
-
-/* True if the signed integer expression E uses two's complement.  */
-#define _GL_INT_TWOS_COMPLEMENT(e) (~ _GL_INT_CONVERT (e, 0) == -1)
-
 /* True if the real type T is signed.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
 
@@ -55,18 +45,10 @@
 #define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
 
 
-/* Minimum and maximum values for integer types and expressions.  These
-   macros have undefined behavior if T is signed and has padding bits.
-   If this is a problem for you, please let us know how to fix it for
-   your host.  */
+/* Minimum and maximum values for integer types and expressions.  */
 
 /* The maximum and minimum values for the integer type T.  */
-#define TYPE_MINIMUM(t)                                                 \
-  ((t) (! TYPE_SIGNED (t)                                               \
-        ? (t) 0                                                         \
-        : TYPE_SIGNED_MAGNITUDE (t)                                     \
-        ? ~ (t) 0                                                       \
-        : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
 #define TYPE_MAXIMUM(t)                                                 \
   ((t) (! TYPE_SIGNED (t)                                               \
         ? (t) -1                                                        \
@@ -76,7 +58,7 @@
    after integer promotion.  E should not have side effects.  */
 #define _GL_INT_MINIMUM(e)                                              \
   (EXPR_SIGNED (e)                                                      \
-   ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e)         \
+   ? ~ _GL_SIGNED_INT_MAXIMUM (e)                                       \
    : _GL_INT_CONVERT (e, 0))
 #define _GL_INT_MAXIMUM(e)                                              \
   (EXPR_SIGNED (e)                                                      \
@@ -85,8 +67,25 @@
 #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
   (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
 
+/* This include file assumes that signed types are two's complement without
+   padding bits; the above macros have undefined behavior otherwise.
+   If this is a problem for you, please let us know how to fix it for your host.
+   As a sanity check, test the assumption for some signed types that
+   <limits.h> bounds.  */
+verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
+verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
+verify (TYPE_MINIMUM (short int) == SHRT_MIN);
+verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
+verify (TYPE_MINIMUM (int) == INT_MIN);
+verify (TYPE_MAXIMUM (int) == INT_MAX);
+verify (TYPE_MINIMUM (long int) == LONG_MIN);
+verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+#ifdef LLONG_MAX
+verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
+verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+#endif
 
-/* Return 1 if the __typeof__ keyword works.  This could be done by
+/* 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__ \
      || (0x5110 <= __SUNPRO_C && !__STDC__))
@@ -223,24 +222,35 @@
    ? (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__)
 
 /* 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.  */
-#define _GL_ADD_OVERFLOW(a, b, min, max)                                \
-  ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
-   : (a) < 0 ? (b) <= (a) + (b)                                         \
-   : (b) < 0 ? (a) <= (a) + (b)                                         \
-   : (a) + (b) < (b))
-#define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
-  ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max)             \
-   : (a) < 0 ? 1                                                        \
-   : (b) < 0 ? (a) - (b) <= (a)                                         \
-   : (a) < (b))
-#define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
-  (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a))))       \
-   || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#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)
+#else
+# define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+   ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
+    : (a) < 0 ? (b) <= (a) + (b)                                         \
+    : (b) < 0 ? (a) <= (a) + (b)                                         \
+    : (a) + (b) < (b))
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
+   ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max)             \
+    : (a) < 0 ? 1                                                        \
+    : (b) < 0 ? (a) - (b) <= (a)                                         \
+    : (a) < (b))
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
+   (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a))))       \
+    || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#endif
 #define _GL_DIVIDE_OVERFLOW(a, b, min, max)                             \
   ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max)  \
    : (a) < 0 ? (b) <= (a) + (b) - 1                                     \
@@ -305,8 +315,12 @@
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
 #define INT_SUBTRACT_OVERFLOW(a, b) \
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
-#define INT_NEGATE_OVERFLOW(a) \
-  INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+#else
+# define INT_NEGATE_OVERFLOW(a) \
+   INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#endif
 #define INT_MULTIPLY_OVERFLOW(a, b) \
   _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
 #define INT_DIVIDE_OVERFLOW(a, b) \
@@ -326,7 +340,7 @@
                       _GL_INT_MINIMUM (0 * (b) + (a)),          \
                       _GL_INT_MAXIMUM (0 * (b) + (a)))
 
-/* Compute A + B, A - B, A * B, respectively, storing the result into *R.
+/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
    Return 1 if the result overflows.  See above for restrictions.  */
 #define INT_ADD_WRAPV(a, b, r) \
   _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW)
@@ -351,9 +365,10 @@
 # define _GL__GENERIC_BOGUS 0
 #endif
 
-/* Store A <op> B into *R, where OP specifies the operation.
-   BUILTIN is the builtin operation, and OVERFLOW the overflow predicate.
-   See above for restrictions.  */
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+   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)
 # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
 #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
@@ -404,7 +419,8 @@
 /* Store the low-order bits of A <op> B into *R, where the operation
    is given by OP.  Use the unsigned type UT for calculation to avoid
    overflow problems.  *R's type is T, with extremal values TMIN and
-   TMAX.  T must be a signed integer type.  */
+   TMAX.  T must be a signed integer type.  Return 1 if the result
+   overflows.  */
 #define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
   (sizeof ((a) op (b)) < sizeof (t) \
    ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
diff --git a/lib/gltests/setlocale.c b/lib/gltests/setlocale.c
index 8b3ebb3..7d366ed 100644
--- a/lib/gltests/setlocale.c
+++ b/lib/gltests/setlocale.c
@@ -381,6 +381,7 @@ static const struct table_entry language_table[] =
     { "sq", "Albanian" },
     { "sr", "Serbian (Latin)" },
     { "sr@cyrillic", "SRB" }, /* Serbian (Cyrillic) */
+    { "sv", "Swedish" },
     { "sw", "Swahili" },
     { "syr", "Syriac" },
     { "ta", "Tamil" },
diff --git a/lib/gltests/stdalign.in.h b/lib/gltests/stdalign.in.h
index 9abb9aa..12f8a15 100644
--- a/lib/gltests/stdalign.in.h
+++ b/lib/gltests/stdalign.in.h
@@ -103,15 +103,15 @@
 # elif ((defined __APPLE__ && defined __MACH__                  \
          ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__)                 \
          : __GNUC__)                                            \
-        || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__        \
-        || __ICC || 0x590 <= __SUNPRO_C)
+        || 061200 <= __HP_cc || 061200 <= __HP_aCC                \
+        || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)
 #  define _Alignas(a) __attribute__ ((__aligned__ (a)))
 # elif 1300 <= _MSC_VER
 #  define _Alignas(a) __declspec (align (a))
 # endif
 #endif
 #if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \
-     || (defined __STDC_VERSION && 201112 <= __STDC_VERSION__))
+     || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
 # define alignas _Alignas
 #endif
 #if defined alignas || (defined __cplusplus && 201103 <= __cplusplus)
diff --git a/lib/gltests/test-intprops.c b/lib/gltests/test-intprops.c
index 174ddec..0a8ddcd 100644
--- a/lib/gltests/test-intprops.c
+++ b/lib/gltests/test-intprops.c
@@ -22,12 +22,9 @@
 # pragma GCC diagnostic ignored "-Woverlength-strings"
 # pragma GCC diagnostic ignored "-Wtype-limits"
 
-/* Work around a bug in GCC 5.3.1 and earlier; see:
-   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971
-   Hope it will be fixed by the time GCC 6 comes out.  */
-# if __GNUC__ < 6
-#  pragma GCC diagnostic ignored "-Woverflow"
-# endif
+/* Work around a bug in GCC 6.1 and earlier; see:
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971  */
+# pragma GCC diagnostic ignored "-Woverflow"
 
 #endif
 
@@ -94,12 +91,8 @@ main (void)
   ASSERT (TYPE_SIGNED (double));
   ASSERT (TYPE_SIGNED (long double));
 
-  /* Integer representation.  */
-  VERIFY (INT_MIN + INT_MAX < 0
-          ? (TYPE_TWOS_COMPLEMENT (int)
-             && ! TYPE_ONES_COMPLEMENT (int) && ! TYPE_SIGNED_MAGNITUDE (int))
-          : (! TYPE_TWOS_COMPLEMENT (int)
-             && (TYPE_ONES_COMPLEMENT (int) || TYPE_SIGNED_MAGNITUDE (int))));
+  /* Integer representation.  Check that it is two's complement.  */
+  VERIFY (INT_MIN + INT_MAX < 0);
 
   /* TYPE_MINIMUM, TYPE_MAXIMUM.  */
   VERIFY (TYPE_MINIMUM (char) == CHAR_MIN);
@@ -156,8 +149,7 @@ main (void)
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_##opname##_WRAPV (a, b, &result) == (v));               \
-      ASSERT (result == ((v) ? (vres) : ((a) op (b)))                     \
-              || ((v) && !TYPE_TWOS_COMPLEMENT (t)));                     \
+      ASSERT (result == ((v) ? (vres) : ((a) op (b))));                   \
     }
   #define CHECK_UNOP(op, opname, a, t, v)                                 \
     VERIFY (INT_##opname##_RANGE_OVERFLOW (a, TYPE_MINIMUM (t),           \
@@ -183,7 +175,7 @@ main (void)
   CHECK_BINOP (-, SUBTRACT, UINT_MAX, 1u, unsigned int, false, UINT_MAX - 1u);
   CHECK_BINOP (-, SUBTRACT, 0u, 1u, unsigned int, true, 0u - 1u);
 
-  CHECK_UNOP (-, NEGATE, INT_MIN, int, TYPE_TWOS_COMPLEMENT (int));
+  CHECK_UNOP (-, NEGATE, INT_MIN, int, true);
   CHECK_UNOP (-, NEGATE, 0, int, false);
   CHECK_UNOP (-, NEGATE, INT_MAX, int, false);
   CHECK_UNOP (-, NEGATE, 0u, unsigned int, false);
@@ -230,8 +222,7 @@ main (void)
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_ADD_WRAPV (a, b, &result) == (v));                      \
-      ASSERT (result == ((v) ? (vres) : ((a) + (b)))                      \
-              || ((v) && !TYPE_TWOS_COMPLEMENT (t)));                     \
+      ASSERT (result == ((v) ? (vres) : ((a) + (b))));                    \
     }
   CHECK_SSUM (-1, LONG_MIN, long int, true, LONG_MAX);
   CHECK_SUM (-1, UINT_MAX, unsigned int, false, DONTCARE);
@@ -259,8 +250,7 @@ main (void)
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_SUBTRACT_WRAPV (a, b, &result) == (v));                 \
-      ASSERT (result == ((v) ? (vres) : ((a) - (b)))                      \
-              || ((v) && !TYPE_TWOS_COMPLEMENT (t)));                     \
+      ASSERT (result == ((v) ? (vres) : ((a) - (b))));                    \
     }
   CHECK_DIFFERENCE (INT_MAX, 1u, unsigned int, UINT_MAX < INT_MAX - 1,
                     INT_MAX - 1u);
@@ -292,8 +282,7 @@ main (void)
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_MULTIPLY_WRAPV (a, b, &result) == (v));                 \
-      ASSERT (result == ((v) ? (vres) : ((a) * (b)))                      \
-              || ((v) && !TYPE_TWOS_COMPLEMENT (t)));                     \
+      ASSERT (result == ((v) ? (vres) : ((a) * (b))));                    \
     }
   CHECK_PRODUCT (-1, 1u, unsigned int, true, -1 * 1u);
   CHECK_SPRODUCT (-1, INT_MIN, int, INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
@@ -351,8 +340,7 @@ main (void)
 
   #define CHECK_QUOTIENT(a, b, v) VERIFY (INT_DIVIDE_OVERFLOW (a, b) == (v))
 
-  CHECK_QUOTIENT (INT_MIN, -1L,
-                  TYPE_TWOS_COMPLEMENT (long int) && INT_MIN == LONG_MIN);
+  CHECK_QUOTIENT (INT_MIN, -1L, INT_MIN == LONG_MIN);
   CHECK_QUOTIENT (INT_MIN, UINT_MAX, false);
   CHECK_QUOTIENT (INTMAX_MIN, UINTMAX_MAX, false);
   CHECK_QUOTIENT (INTMAX_MIN, UINT_MAX, false);
@@ -365,8 +353,7 @@ main (void)
 
   #define CHECK_REMAINDER(a, b, v) VERIFY (INT_REMAINDER_OVERFLOW (a, b) == (v))
 
-  CHECK_REMAINDER (INT_MIN, -1L,
-                   TYPE_TWOS_COMPLEMENT (long int) && INT_MIN == LONG_MIN);
+  CHECK_REMAINDER (INT_MIN, -1L, INT_MIN == LONG_MIN);
   CHECK_REMAINDER (-1, UINT_MAX, true);
   CHECK_REMAINDER ((intmax_t) -1, UINTMAX_MAX, true);
   CHECK_REMAINDER (INTMAX_MIN, UINT_MAX,
diff --git a/lib/gltests/test-localename.c b/lib/gltests/test-localename.c
index 040c025..be8fcaf 100644
--- a/lib/gltests/test-localename.c
+++ b/lib/gltests/test-localename.c
@@ -183,6 +183,8 @@ test_locale_name (void)
         ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
         name = gl_locale_name (LC_MESSAGES, "LC_MESSAGES");
         ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
+        uselocale (LC_GLOBAL_LOCALE);
+        freelocale (locale);
       }
   }
 
@@ -194,11 +196,13 @@ test_locale_name (void)
     for (i = 0; i < SIZEOF (categories); i++)
       {
         int category_mask = categories[i].mask;
-        locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
-        if (locale != NULL)
+        locale_t loc = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
+        if (loc != NULL)
           {
-            locale = newlocale (category_mask, "de_DE.UTF-8", locale);
-            if (locale != NULL)
+            locale_t locale = newlocale (category_mask, "de_DE.UTF-8", loc);
+            if (locale == NULL)
+              freelocale (loc);
+            else
               {
                 unsigned int j;
 
@@ -212,6 +216,8 @@ test_locale_name (void)
                     else
                       ASSERT (strcmp (name_j, "fr_FR.UTF-8") == 0);
                   }
+                uselocale (LC_GLOBAL_LOCALE);
+                freelocale (locale);
               }
           }
       }
@@ -245,6 +251,8 @@ test_locale_name_thread (void)
         ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
         name = gl_locale_name_thread (LC_MESSAGES, "LC_MESSAGES");
         ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
+        uselocale (LC_GLOBAL_LOCALE);
+        freelocale (locale);
       }
   }
 
@@ -256,11 +264,13 @@ test_locale_name_thread (void)
     for (i = 0; i < SIZEOF (categories); i++)
       {
         int category_mask = categories[i].mask;
-        locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
-        if (locale != NULL)
+        locale_t loc = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
+        if (loc != NULL)
           {
-            locale = newlocale (category_mask, "de_DE.UTF-8", locale);
-            if (locale != NULL)
+            locale_t locale = newlocale (category_mask, "de_DE.UTF-8", loc);
+            if (locale == NULL)
+              freelocale (loc);
+            else
               {
                 unsigned int j;
 
@@ -275,6 +285,8 @@ test_locale_name_thread (void)
                     else
                       ASSERT (strcmp (name_j, "fr_FR.UTF-8") == 0);
                   }
+                uselocale (LC_GLOBAL_LOCALE);
+                freelocale (locale);
               }
           }
       }
@@ -444,6 +456,7 @@ test_locale_name_thread (void)
                 ASSERT (strcmp (unsaved_names[j][i], name) == 0);
               }
             uselocale (LC_GLOBAL_LOCALE);
+            freelocale (locale);
           }
       }
     /* Verify the unsaved_names are still valid.  */
@@ -453,7 +466,10 @@ test_locale_name_thread (void)
           unsigned int i;
 
           for (i = 0; i < SIZEOF (categories); i++)
-            ASSERT (strcmp (unsaved_names[j][i], saved_names[j][i]) == 0);
+            {
+              ASSERT (strcmp (unsaved_names[j][i], saved_names[j][i]) == 0);
+              free (saved_names[j][i]);
+            }
         }
   }
 #else
@@ -590,6 +606,8 @@ test_locale_name_posix (void)
         uselocale (locale);
         name = gl_locale_name_posix (LC_MESSAGES, "LC_MESSAGES");
         ASSERT (strcmp (name, "C") == 0);
+        uselocale (LC_GLOBAL_LOCALE);
+        freelocale (locale);
       }
   }
 #endif
@@ -702,6 +720,8 @@ test_locale_name_environ (void)
         uselocale (locale);
         name = gl_locale_name_environ (LC_MESSAGES, "LC_MESSAGES");
         ASSERT (strcmp (name, "C") == 0);
+        uselocale (LC_GLOBAL_LOCALE);
+        freelocale (locale);
       }
   }
 #endif
@@ -729,6 +749,8 @@ test_locale_name_default (void)
       {
         uselocale (locale);
         ASSERT (strcmp (gl_locale_name_default (), name) == 0);
+        uselocale (LC_GLOBAL_LOCALE);
+        freelocale (locale);
       }
   }
 #endif
diff --git a/lib/gltests/test-setlocale1.c b/lib/gltests/test-setlocale1.c
index 3bb9c3e..143c0d8 100644
--- a/lib/gltests/test-setlocale1.c
+++ b/lib/gltests/test-setlocale1.c
@@ -54,6 +54,8 @@ main (int argc, char *argv[])
 
   /* Test that the two results are the same.  */
   ASSERT (strcmp (name1, name2) == 0);
+  free (name1);
+  free (name2);
 
   return 0;
 }
diff --git a/lib/gltests/verify.h b/lib/gltests/verify.h
index 2f43837..5c8381d 100644
--- a/lib/gltests/verify.h
+++ b/lib/gltests/verify.h
@@ -263,7 +263,7 @@ template <int w>
 # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
 #elif 1200 <= _MSC_VER
 # define assume(R) __assume (R)
-#elif (defined lint \
+#elif ((defined GCC_LINT || defined lint) \
        && (__has_builtin (__builtin_trap) \
            || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))))
   /* Doing it this way helps various packages when configured with
diff --git a/lib/gltests/wchar.in.h b/lib/gltests/wchar.in.h
index e98ab61..755600f 100644
--- a/lib/gltests/wchar.in.h
+++ b/lib/gltests/wchar.in.h
@@ -31,7 +31,7 @@
 @PRAGMA_COLUMNS@
 
 #if (((defined __need_mbstate_t || defined __need_wint_t)               \
-      && !defined __MINGW32__)                                          \
+      && !defined __MINGW32__ && !defined __KLIBC__)                    \
      || (defined __hpux                                                 \
          && ((defined _INTTYPES_INCLUDED && !defined strtoimax)         \
              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
@@ -445,6 +445,11 @@ _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 #  if !@HAVE_DECL_WCWIDTH@
 /* wcwidth exists but is not declared.  */
 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+#  elif defined __KLIBC__
+/* On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
+   static inline function.  The implementation of wcwidth in wcwidth.c
+   causes a "conflicting types" error. */
+#   undef wcwidth
 #  endif
 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
 # endif
diff --git a/maint.mk b/maint.mk
index 9470328..aa23364 100644
--- a/maint.mk
+++ b/maint.mk
@@ -651,8 +651,7 @@ sc_prohibit_strings_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_TWOS_COMPLEMENT TYPE_ONES_COMPLEMENT		\
-  TYPE_SIGNED_MAGNITUDE TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM		\
+  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			\
diff --git a/tests/tst_toascii64oob.c b/tests/tst_toascii64oob.c
index 318168f..31b940e 100644
--- a/tests/tst_toascii64oob.c
+++ b/tests/tst_toascii64oob.c
@@ -37,7 +37,16 @@
 
 /* This test requires you to build with CFLAGS="-fsanitize=address"
    and disable valgrind since asan and valgrind conflict.  Thus
-   normally a bit uneffective, but may be useful to have around. */
+   normally a bit uneffective, but may be useful to have around.
+
+   make
+   make
+   make clean
+   make CFLAGS="-fsanitize=address" WERROR_CFLAGS=
+   make CFLAGS="-fsanitize=address" WERROR_CFLAGS= check VALGRIND=
+
+   Revert patch in URL above to trigger this self test.
+ */
 
 void
 doit (void)


hooks/post-receive
-- 
GNU libidn


From MAILER-DAEMON Fri Jul 22 06:58:13 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1bQY9l-0005WZ-Ma
	for mharc-libidn-commit@gnu.org; Fri, 22 Jul 2016 06:58:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58228)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1bQY9g-0005Ty-Eg
	for libidn-commit@gnu.org; Fri, 22 Jul 2016 06:58:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1bQY9b-0001K9-Rs
	for libidn-commit@gnu.org; Fri, 22 Jul 2016 06:58:07 -0400
Received: from vcs.savannah.gnu.org ([208.118.235.72]:59687)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1bQY9b-0001K4-NO
	for libidn-commit@gnu.org; Fri, 22 Jul 2016 06:58:03 -0400
Received: by vcs.savannah.gnu.org (Postfix, from userid 66976)
	id 6602B220159; Fri, 22 Jul 2016 10:58:03 +0000 (UTC)
From: "Simon Josefsson" <simon@josefsson.org>
To: libidn-commit@gnu.org
Subject: [SCM] GNU libidn branch, master, updated. libidn-1-33-5-g6a54066
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 87d779b13f3343f1de101d5fdaf4065c8fb30be8
X-Git-Newrev: 6a5406641df3fcce6fbae6b8f70de7b860155c7f
Message-Id: <20160722105803.6602B220159@vcs.savannah.gnu.org>
Date: Fri, 22 Jul 2016 10:58:03 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.72
X-BeenThere: libidn-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: Commit messages for GNU Libidn <libidn-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libidn-commit>,
	<mailto:libidn-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libidn-commit/>
List-Post: <mailto:libidn-commit@gnu.org>
List-Help: <mailto:libidn-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libidn-commit>,
	<mailto:libidn-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jul 2016 10:58:11 -0000

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

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

The branch, master has been updated
       via  6a5406641df3fcce6fbae6b8f70de7b860155c7f (commit)
       via  615cf2524a3f2a4313d5de1523b4aeefab4391e0 (commit)
       via  003c0b9241077f4683f14975ad6ca7000f8fe278 (commit)
       via  6dae49590be4ea866e9edad13a3b4ed7d12938da (commit)
       via  762de8266d2cb24504654cae0300a8dfb5cc8e5d (commit)
      from  87d779b13f3343f1de101d5fdaf4065c8fb30be8 (commit)

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

- Log -----------------------------------------------------------------
commit 6a5406641df3fcce6fbae6b8f70de7b860155c7f
Author: Simon Josefsson <simon@josefsson.org>
Date:   Fri Jul 22 12:50:45 2016 +0200

    Mention OpenJDK.  Suggested by Guus.

commit 615cf2524a3f2a4313d5de1523b4aeefab4391e0
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Jul 20 22:43:22 2016 +0200

    Add.

commit 003c0b9241077f4683f14975ad6ca7000f8fe278
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Jul 20 22:42:46 2016 +0200

    Sync with TP.

commit 6dae49590be4ea866e9edad13a3b4ed7d12938da
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Jul 20 22:32:18 2016 +0200

    Bump versions.

commit 762de8266d2cb24504654cae0300a8dfb5cc8e5d
Author: Simon Josefsson <simon@josefsson.org>
Date:   Wed Jul 20 22:31:18 2016 +0200

    Update for 1.33.

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

Summary of changes:
 HACKING                   |    3 +-
 NEWS                      |    7 ++
 configure.ac              |    4 +-
 doc/announce.txt          |   46 ++++++++-----
 lib/stringprep.h          |    2 +-
 po/LINGUAS                |    1 +
 po/{hu.po.in => sv.po.in} |  160 +++++++++++++++++++++++----------------------
 7 files changed, 124 insertions(+), 99 deletions(-)
 copy po/{hu.po.in => sv.po.in} (59%)

diff --git a/HACKING b/HACKING
index 11d0c09..761369c 100644
--- a/HACKING
+++ b/HACKING
@@ -25,6 +25,7 @@ We require several tools to build the software, including:
 - Perl <http://www.cpan.org/>
 - Valgrind <http://valgrind.org/> (optional)
 - Gcj <http://www.gnu.org/software/gcc/java/> (for java port)
+- OpenJDK (for java port)
 - gjdoc <http://www.gnu.org/software/classpath/cp-tools/> (for java port)
 - Mono mcs <http://www.mono.org/> (for C# port)
 - fig2dev <http://www-epb.lbl.gov/xfig/>
@@ -37,7 +38,7 @@ gNewSense/Debian/Ubuntu:
 apt-get install make git-core autoconf automake libtool gettext cvs
 apt-get install texinfo texlive texlive-generic-recommended texlive-extra-utils
 apt-get install help2man gtk-doc-tools valgrind gengetopt
-apt-get install gcj-jdk gjdoc transfig mono-mcs gperf
+apt-get install gcj-jdk gjdoc transfig mono-mcs gperf openjdk-7-jdk
 
 To download the version controlled sources:
 
diff --git a/NEWS b/NEWS
index a082f90..d1f9653 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,13 @@ Libidn NEWS -- History of user-visible changes.                 -*- outline -*-
 Copyright (C) 2002-2016 Simon Josefsson
 See the end for copying conditions.
 
+* Version 1.34 (unreleased) [beta]
+
+** i18n: Added Swedish translation.
+Thanks to Josef Andersson.
+
+** API and ABI is backwards compatible with the previous version.
+
 * Version 1.33 (released 2016-07-20) [beta]
 
 ** libidn: Fix out-of-bounds stack read in idna_to_ascii_4i.
diff --git a/configure.ac b/configure.ac
index 649ddcd..79b3424 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@ dnl You should have received a copy of the GNU General Public License
 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ(2.61)
-AC_INIT([GNU Libidn], [1.33], [bug-libidn@gnu.org])
+AC_INIT([GNU Libidn], [1.34], [bug-libidn@gnu.org])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS(config.h)
@@ -30,7 +30,7 @@ AM_SILENT_RULES([yes])
 # Interfaces added:                             AGE++
 # Interfaces removed:                           AGE=0
 AC_SUBST(LT_CURRENT, 17)
-AC_SUBST(LT_REVISION, 16)
+AC_SUBST(LT_REVISION, 17)
 AC_SUBST(LT_AGE, 6)
 
 AC_PROG_CC
diff --git a/doc/announce.txt b/doc/announce.txt
index e70cbe3..b2481e1 100644
--- a/doc/announce.txt
+++ b/doc/announce.txt
@@ -1,5 +1,5 @@
 To: help-libidn@gnu.org, info-gnu@gnu.org
-Subject: Libidn 1.32 released
+Subject: Libidn 1.33 released
 <#part sign=pgpmime>
 GNU Libidn is a fully documented implementation of the Stringprep,
 Punycode and IDNA specifications.  Libidn's purpose is to encode and
@@ -8,8 +8,20 @@ and Java libraries.
 
 Noteworthy changes since the last release (from NEWS file):
 
-** libidn: Fix crash in idna_to_unicode_8z8z and idna_to_unicode_8zlz.
-This problem was introduced in 1.31.  Reported by Adam Sampson.
+* Version 1.33 (released 2016-07-20) [beta]
+
+** libidn: Fix out-of-bounds stack read in idna_to_ascii_4i.
+See tests/tst_toascii64oob.c for regression check (and the comment in
+it how to use it).  Reported by Hanno Böck <hanno@hboeck.de>.
+
+** idn: Solve out-of-bounds-read when reading one zero byte as input.
+Also replaced fgets with getline.  Reported by Hanno Böck <hanno@hboeck.de>.
+
+** libidn: stringprep_utf8_nfkc_normalize reject invalid UTF-8.
+It was always documented to only accept UTF-8 data, but now it doesn't
+crash when presented with such data.  Reported by Hanno Böck.
+
+** Dropped valgrind suppressions file, should no longer be needed.
 
 ** API and ABI is backwards compatible with the previous version.
 
@@ -81,33 +93,33 @@ invited to join our help-libidn mailing list, see:
   https://lists.gnu.org/mailman/listinfo/help-libidn
 
 Here are the compressed sources (3.4MB):
-  ftp://ftp.gnu.org/gnu/libidn/libidn-1.32.tar.gz
-  http://ftp.gnu.org/gnu/libidn/libidn-1.32.tar.gz
+  ftp://ftp.gnu.org/gnu/libidn/libidn-1.33.tar.gz
+  http://ftp.gnu.org/gnu/libidn/libidn-1.33.tar.gz
 
 Here are GPG detached signatures:
-  ftp://ftp.gnu.org/gnu/libidn/libidn-1.32.tar.gz.sig
-  http://ftp.gnu.org/gnu/libidn/libidn-1.32.tar.gz.sig
+  ftp://ftp.gnu.org/gnu/libidn/libidn-1.33.tar.gz.sig
+  http://ftp.gnu.org/gnu/libidn/libidn-1.33.tar.gz.sig
 
 Here are the SHA-1 and SHA-224 signatures:
 
-ddd018611b98af7c67d434aa42d15d39f45129f5  libidn-1.32.tar.gz
-d142619cfce664f9055cd3d553bd5dd7846fa69c385c83f40f0e3a65  libidn-1.32.tar.gz
+57872fdc665dcc585e16f4ac0bb35374b1103f7e  libidn-1.33.tar.gz
+b9e7a2d9affe8c423ba24ff2731c7bd7307530f1f67d3f4ace921fc8  libidn-1.33.tar.gz
 
 We also provide Windows binaries built using MinGW-w64 with the build
 script windows/libidn4win.mk, for 32-bit and 64-bit x86 architecures:
 
-  ftp://ftp.gnu.org/gnu/libidn/libidn-1.32-win32.zip
-  ftp://ftp.gnu.org/gnu/libidn/libidn-1.32-win32.zip.sig
-  ftp://ftp.gnu.org/gnu/libidn/libidn-1.32-win64.zip
-  ftp://ftp.gnu.org/gnu/libidn/libidn-1.32-win64.zip.sig
+  ftp://ftp.gnu.org/gnu/libidn/libidn-1.33-win32.zip
+  ftp://ftp.gnu.org/gnu/libidn/libidn-1.33-win32.zip.sig
+  ftp://ftp.gnu.org/gnu/libidn/libidn-1.33-win64.zip
+  ftp://ftp.gnu.org/gnu/libidn/libidn-1.33-win64.zip.sig
 
 Here are the SHA-1 and SHA-224 signatures:
 
-8726607f17f8741ceb4f1779c2c63779c580e903  libidn-1.32-win32.zip
-76e08dcf387f20d65e0a1d18b2acb3938a63a392c16e7fb83cb80997  libidn-1.32-win32.zip
+a5efb361371702ad54fb6765d6402bcacfde1c16  libidn-1.33-win32.zip
+f18fa46b2f6d4621719e3a07fdc0cb625ca0d025fe7b53d162b5bd36  libidn-1.33-win32.zip
 
-27f9fb841ac6ab31e1cbd37dd18b0db378797149  libidn-1.32-win64.zip
-4c5d5d7c528f560c4ee86053d78134839601aeb15f5e8f4136ad8a5d  libidn-1.32-win64.zip
+521c0ecb9dbd7d4b4e5be15c8c84eb89d6de39d5  libidn-1.33-win64.zip
+2a84e0ba1cfc14f37afc4e4638c71dec797a10837d5bdf2b3e0c68c7  libidn-1.33-win64.zip
 
 The software is cryptographically signed by the author using an OpenPGP
 key identified by the following information:
diff --git a/lib/stringprep.h b/lib/stringprep.h
index 35fa1a7..8eb8b15 100644
--- a/lib/stringprep.h
+++ b/lib/stringprep.h
@@ -51,7 +51,7 @@ extern "C"
 {
 # endif
 
-# define STRINGPREP_VERSION "1.33"
+# define STRINGPREP_VERSION "1.34"
 
 /* Error codes. */
   typedef enum
diff --git a/po/LINGUAS b/po/LINGUAS
index 11a8f86..72f25de 100644
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -16,6 +16,7 @@ pl
 pt_BR
 ro
 sr
+sv
 uk
 vi
 zh_CN
diff --git a/po/hu.po.in b/po/sv.po.in
similarity index 59%
copy from po/hu.po.in
copy to po/sv.po.in
index da001ee..f567be7 100644
--- a/po/hu.po.in
+++ b/po/sv.po.in
@@ -1,157 +1,157 @@
-# Hungarian translation for libidn.
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Swedish translation for libidn
+# Copyright © xxxx - 2016 Free Software Foundation, Inc.
 # This file is distributed under the same license as the libidn package.
+# Josef Andersson <josef.andersson@fripost.org>, 2016.
 #
-# Balázs Úr <urbalazs@gmail.com>, 2014.
 msgid ""
 msgstr ""
 "Project-Id-Version: libidn 1.29\n"
 "Report-Msgid-Bugs-To: bug-libidn@gnu.org\n"
 "POT-Creation-Date: 2014-08-10 22:50+0200\n"
-"PO-Revision-Date: 2014-08-31 15:46+0200\n"
-"Last-Translator: Balázs Úr <urbalazs@gmail.com>\n"
-"Language-Team: Hungarian <translation-team-hu@lists.sourceforge.net>\n"
-"Language: hu\n"
+"PO-Revision-Date: 2016-07-16 19:36+0100\n"
+"Last-Translator: Josef Andersson <josef.andersson@fripost.org>\n"
+"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
+"Language: sv\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.8.7.1\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Lokalize 1.5\n"
 
 #: lib/strerror-idna.c:82 lib/strerror-pr29.c:66 lib/strerror-punycode.c:66
 #: lib/strerror-stringprep.c:86 lib/strerror-tld.c:68
 msgid "Success"
-msgstr "Sikerült"
+msgstr "Lyckades"
 
 #: lib/strerror-idna.c:86 lib/strerror-pr29.c:74
 msgid "String preparation failed"
-msgstr "A szöveg előkészítés sikertelen."
+msgstr "Misslyckades med strängförberedelse"
 
 #: lib/strerror-idna.c:90
 msgid "Punycode failed"
-msgstr "Punycode sikertelen"
+msgstr "Misslyckades med punycode"
 
 #: lib/strerror-idna.c:94
 msgid "Non-digit/letter/hyphen in input"
-msgstr "Nem szám/betű/kötőjel a bemeneten"
+msgstr "Icke-siffra/bokstav/bindestreck i indata"
 
 #: lib/strerror-idna.c:98
 msgid "Forbidden leading or trailing minus sign (`-')"
-msgstr "Tiltott kezdő vagy befejező mínusz jel („-”)"
+msgstr "Förbjudet inledande eller eftersläpande minustecken (”-”)"
 
 #: lib/strerror-idna.c:102
 msgid "Output would be too large or too small"
-msgstr "A kimenet túl nagy vagy túl kicsi lenne"
+msgstr "Utdata skulle vara för stort eller för litet"
 
 #: lib/strerror-idna.c:106
 msgid "Input does not start with ACE prefix (`xn--')"
-msgstr "A bemenet nem ACE előtaggal („xn--”) kezdődik"
+msgstr "Indata startar inte med ACE-prefix (”xn--”)"
 
 #: lib/strerror-idna.c:110
 msgid "String not idempotent under ToASCII"
-msgstr "A szöveg nem idempotens a ToASCII alatt"
+msgstr "Strängen är inte idempotent under ToASCII"
 
 #: lib/strerror-idna.c:114
 msgid "Input already contain ACE prefix (`xn--')"
-msgstr "A bemenet már tartalmaz ACE előtagot („xn--”)"
+msgstr "Indata innehåller redan ACE-prefix (”xn--”)"
 
 #: lib/strerror-idna.c:118 lib/strerror-tld.c:84
 msgid "System iconv failed"
-msgstr "Rendszer iconv sikertelen"
+msgstr "Misslyckades med systemanrop iconv"
 
 #: lib/strerror-idna.c:122 lib/strerror-stringprep.c:130 lib/strerror-tld.c:80
 msgid "Cannot allocate memory"
-msgstr "Nem lehet memóriát lefoglalni"
+msgstr "Kan inte allokera minne"
 
 #: lib/strerror-idna.c:126
 msgid "System dlopen failed"
-msgstr "Rendszer dlopen sikertelen"
+msgstr "Misslyckades med systemanrop dlopen"
 
 #: lib/strerror-idna.c:130 lib/strerror-pr29.c:78 lib/strerror-punycode.c:82
 #: lib/strerror-stringprep.c:134 lib/strerror-tld.c:92
 msgid "Unknown error"
-msgstr "Ismeretlen hiba"
+msgstr "Okänt fel"
 
 #: lib/strerror-pr29.c:70
 msgid "String not idempotent under Unicode NFKC normalization"
-msgstr "A szöveg nem idempotens a Unicode NFKC normalizálás alatt"
+msgstr "Strängen inte idempotent under Unicode NFKC-normalisering"
 
 #: lib/strerror-punycode.c:70
 msgid "Invalid input"
-msgstr "Érvénytelen bemenet"
+msgstr "Ogiltig indata"
 
 #: lib/strerror-punycode.c:74 lib/strerror-stringprep.c:110
 msgid "Output would exceed the buffer space provided"
-msgstr "A kimenet túllépné a megadott pufferméretet"
+msgstr "Utdata skulle överskrida tillhandahållet buffertutrymme"
 
 #: lib/strerror-punycode.c:78
 msgid "String size limit exceeded"
-msgstr "A szövegméret korlát elérve"
+msgstr "Strängstorleken överskriden"
 
 #: lib/strerror-stringprep.c:90
 msgid "Forbidden unassigned code points in input"
-msgstr "Tiltott nem hozzárendelt kódpontok a bemeneten"
+msgstr "Förbjudna otilldelade kodpunkter i indata"
 
 #: lib/strerror-stringprep.c:94
 msgid "Prohibited code points in input"
-msgstr "Tiltott kódpontok a bemeneten"
+msgstr "Förbjudna kodpunkter i indata"
 
 #: lib/strerror-stringprep.c:98
 msgid "Conflicting bidirectional properties in input"
-msgstr "Ütköző kétirányú tulajdonságok a bemeneten"
+msgstr "Motsägelsefulla dubbelriktade egenskaper i indata"
 
 #: lib/strerror-stringprep.c:102
 msgid "Malformed bidirectional string"
-msgstr "Helytelenül formázott kétirányú szöveg"
+msgstr "Felaktig dubbelriktad sträng"
 
 #: lib/strerror-stringprep.c:106
 msgid "Prohibited bidirectional code points in input"
-msgstr "Tiltott kétirányú kódpontok a bemeneten"
+msgstr "Förbjudna dubbelriktade kodpunkter i indata"
 
 #: lib/strerror-stringprep.c:114
 msgid "Error in stringprep profile definition"
-msgstr "Hiba a stringprep profil definícióban"
+msgstr "Fel i profildefinition för stringprep"
 
 #: lib/strerror-stringprep.c:118
 msgid "Flag conflict with profile"
-msgstr "Jelzőütközés a profillal"
+msgstr "Märk konflikt med profil"
 
 #: lib/strerror-stringprep.c:122
 msgid "Unknown profile"
-msgstr "Ismeretlen profil"
+msgstr "Okänd profil"
 
 #: lib/strerror-stringprep.c:126
 msgid "Unicode normalization failed (internal error)"
-msgstr "Unicode normalizálás sikertelen (belső hiba)"
+msgstr "Misslyckades med Unicode-normalisering (internt fel)"
 
 #: lib/strerror-tld.c:72
 msgid "Code points prohibited by top-level domain"
-msgstr "A felsőszintű tartomány tiltja a kódpontokat"
+msgstr "Kodpunkter förbjudna hos toppnivådomän"
 
 #: lib/strerror-tld.c:76
 msgid "Missing input"
-msgstr "Hiányzó bemenet"
+msgstr "Saknar indata"
 
 #: lib/strerror-tld.c:88
 msgid "No top-level domain found in input"
-msgstr "Nem található felsőszintű tartomány a bemeneten"
+msgstr "Inga toppnivådomäner funna i indata"
 
 #: src/idn.c:65
 #, c-format
 msgid "Try `%s --help' for more information.\n"
-msgstr "További információkért próbálja a(z) „%s --help” parancsot.\n"
+msgstr "Prova ”%s --help” för mer information.\n"
 
 #: src/idn.c:69
 #, c-format
 msgid "Usage: %s [OPTION]... [STRINGS]...\n"
-msgstr "Használat: %s [KAPCSOLÓ]… [SZÖVEGEK]…\n"
+msgstr "Användning: %s [FLAGGA]… [STRÄNGAR]…\n"
 
 #: src/idn.c:72
 msgid ""
 "Internationalized Domain Name (IDN) convert STRINGS, or standard input.\n"
 "\n"
 msgstr ""
-"Internationalized Domain Name (IDN) átalakított SZÖVEGEK vagy szabványos bemenet.\n"
+"Internationaliserat domännamn (IDN) konverterar STRÄNGAR, eller standard in.\n"
 "\n"
 
 #: src/idn.c:76
@@ -167,26 +167,24 @@ msgid ""
 "\n"
 "Mandatory arguments to long options are mandatory for short options too.\n"
 msgstr ""
-"Parancssoros felület a nemzetközivé tett tartománynév könyvtárhoz.\n"
+"Kommandoradsgränssnitt till biblioteket för internationaliserade domännamn.\n"
 "\n"
-"Minden szöveg a területi beállítás szerint előnyben részesített\n"
-"karakterkészlet használatával kódolva várt. Használja a „--debug”\n"
-"kapcsolót annak kiderítésére, hogy melyik ez a karakterkészlet.\n"
-"Felülbírálhatja a CHARSET környezeti változó beállításban használt\n"
-"karakterkészletet.\n"
+"Alla strängar förväntas vara kodade i den teckenuppsättning din lokal\n"
+"använder. Använd ”--debug” för att ta reda på vad denna teckenuppsättning är. Du\n"
+"kan åsidosätta den använda teckenuppsättningen genom att sätta miljövariabeln CHARSET.\n"
 "\n"
-"Egy „-” kezdetű szöveg feldolgozásához, például „-izé”, használja a „--”\n"
-"jelet a paraméterek végének jelzéséhez, úgymint „idn --quiet -a -- -izé”.\n"
+"För att bearbeta en sträng som börjar med ”-”, till exempel ”-foo”, använd ”--”\n"
+"för signalera slut på parametrar, som i ”idn --quiet -a -- -foo”.\n"
 "\n"
-"A hosszú kapcsolók kötelező argumentumai a rövid kapcsolóknál is kötelezőek.\n"
+"Obligatoriska argument för långa flaggor är obligatoriska också för korta flaggor.\n"
 
 #: src/idn.c:88
 msgid ""
 "  -h, --help               Print help and exit\n"
 "  -V, --version            Print version and exit\n"
 msgstr ""
-"  -h, --help               Súgó kiírása és kilépés\n"
-"  -V, --version            Verzió kiírása és kilépés\n"
+"  -h, --help               Skriv ut hjälp och avsluta\n"
+"  -V, --version            Skriv ut version och avsluta\n"
 
 #: src/idn.c:92
 msgid ""
@@ -196,31 +194,31 @@ msgid ""
 "  -a, --idna-to-ascii      Convert to ACE according to IDNA (default mode)\n"
 "  -u, --idna-to-unicode    Convert from ACE according to IDNA\n"
 msgstr ""
-"  -s, --stringprep         Szöveg előkészítése a nameprep profil szerint\n"
-"  -d, --punycode-decode    Punycode dekódolása\n"
-"  -e, --punycode-encode    Punycode kódolása\n"
-"  -a, --idna-to-ascii      Átalakítás ACE-re az IDNA szerint (alap mód)\n"
-"  -u, --idna-to-unicode    Átalakítás ACE-ről az IDNA szerint\n"
+"  -s, --stringprep         Förbered sträng efter nameprep-profil\n"
+"  -d, --punycode-decode    Avkoda punycode\n"
+"  -e, --punycode-encode    Koda punycode\n"
+"  -a, --idna-to-ascii      Konvertera till ACE utifrån IDNA (standardläge)\n"
+"  -u, --idna-to-unicode    Konvertera från ACE utifrån IDNA\n"
 
 #: src/idn.c:99
 msgid ""
 "      --allow-unassigned   Toggle IDNA AllowUnassigned flag (default off)\n"
 "      --usestd3asciirules  Toggle IDNA UseSTD3ASCIIRules flag (default off)\n"
 msgstr ""
-"      --allow-unassigned   IDNA AllowUnassigned jelző váltása (alap: off)\n"
-"      --usestd3asciirules  IDNA UseSTD3ASCIIRules jelző váltása (alap: off)\n"
+"      --allow-unassigned   Växla IDNA AllowUnassigned-flaggan (av som standard)\n"
+"      --usestd3asciirules  Växla IDNA UseSTD3ASCIIRules-flaggan (av som standard)\n"
 
 #: src/idn.c:103
 msgid ""
 "      --no-tld             Don't check string for TLD specific rules\n"
 "                             Only for --idna-to-ascii and --idna-to-unicode\n"
 msgstr ""
-"      --no-tld             Ne ellenőrizzen szöveget TLD specifikus szabályokhoz\n"
-"                             Csak --idna-to-ascii és --idna-to-unicode esetén\n"
+"      --no-tld             Kontrollera inte sträng efter TLD-specifika regler\n"
+"                             Endast för --idna-to-ascii och --idna-to-unicode\n"
 
 #: src/idn.c:107
 msgid "  -n, --nfkc               Normalize string according to Unicode v3.2 NFKC\n"
-msgstr "  -n, --nfkc               Szöveg normalizálása a Unicode v3.2 NFKC szerint\n"
+msgstr "  -n, --nfkc               Normalisera sträng utefter Unicode v3.2 NFKC\n"
 
 #: src/idn.c:110
 msgid ""
@@ -229,59 +227,59 @@ msgid ""
 "                             `iSCSI', `Nodeprep', `Resourceprep', \n"
 "                             `trace', `SASLprep'\n"
 msgstr ""
-"  -p, --profile=SZÖVEG     Inkább a megadott stringprep profil használata\n"
-"                             Érvényes stringprep profilok: „Nameprep”,\n"
-"                             „iSCSI”, „Nodeprep”, „Resourceprep”, \n"
-"                             „trace”, „SASLprep”\n"
+"  -p, --profile=STRING     Använd specificerad stringprep-profil istället\n"
+"                             Giltiga stringprep-profiler: ”Nameprep”,\n"
+"                             ”iSCSI”, ”Nodeprep”, ”Resourceprep”, \n"
+"                             ”trace”, ”SASLprep”\n"
 
 #: src/idn.c:116
 msgid ""
 "      --debug              Print debugging information\n"
 "      --quiet              Silent operation\n"
 msgstr ""
-"      --debug              Hibakeresési információk kiírása\n"
-"      --quiet              Csendes működés\n"
+"      --debug              Skriv ut felsökningsinformation\n"
+"      --quiet              Tyst åtgärd\n"
 
 #: src/idn.c:172
 #, c-format
 msgid "only one of -s, -e, -d, -a, -u or -n can be specified"
-msgstr "csak a következők egyike adható meg: -s, -e, -d, -a, -u vagy -n"
+msgstr "kan endast specificera en av -s, -e, -d, -a, -u eller -n"
 
 #: src/idn.c:182
 #, c-format
 msgid "Charset `%s'.\n"
-msgstr "Karakterkészlet: „%s”.\n"
+msgstr "Teckenuppsättning ”%s”.\n"
 
 #: src/idn.c:187
 #, c-format
 msgid "Type each input string on a line by itself, terminated by a newline character.\n"
-msgstr "Minden bemeneti szöveget önmagával egy sorba gépeljen be, egy új sor karakterrel lezárva.\n"
+msgstr "Skriv varje inmatningssträng på en egen rad, avslutad med nyradstecken.\n"
 
 #: src/idn.c:202
 #, c-format
 msgid "input error"
-msgstr "bemeneti hiba"
+msgstr "indatafel"
 
 #: src/idn.c:212 src/idn.c:274 src/idn.c:357 src/idn.c:434 src/idn.c:515
 #, c-format
 msgid "could not convert from %s to UTF-8"
-msgstr "nem lehet átalakítani: %s -> UTF-8"
+msgstr "kunde inte konvertera från %s till UTF-8"
 
 #: src/idn.c:220 src/idn.c:245 src/idn.c:281 src/idn.c:498 src/idn.c:527
 #: src/idn.c:551
 #, c-format
 msgid "could not convert from UTF-8 to UCS-4"
-msgstr "nem lehet átalakítani: UTF-8 -> UCS-4"
+msgstr "kunde inte konvertera från UTF-8 till UCS-4"
 
 #: src/idn.c:237
 #, c-format
 msgid "stringprep_profile: %s"
-msgstr "stringprep_profile: %s"
+msgstr "stringprep_profil: %s"
 
 #: src/idn.c:260 src/idn.c:302 src/idn.c:345 src/idn.c:503 src/idn.c:564
 #, c-format
 msgid "could not convert from UTF-8 to %s"
-msgstr "nem lehet átalakítani: UTF-8 -> %s"
+msgstr "kunde inte konvertera från UTF-8 till %s"
 
 #: src/idn.c:295
 #, c-format
@@ -301,7 +299,7 @@ msgstr "punycode_decode: %s"
 #: src/idn.c:340 src/idn.c:364 src/idn.c:442
 #, c-format
 msgid "could not convert from UCS-4 to UTF-8"
-msgstr "nem lehet átalakítani: UCS-4 -> UTF-8"
+msgstr "kunde inte konvertera från UCS-4 till UTF-8"
 
 #: src/idn.c:381
 #, c-format
@@ -316,7 +314,7 @@ msgstr "idna_to_unicode_8z4z (TLD): %s"
 #: src/idn.c:409 src/idn.c:482
 #, c-format
 msgid "tld_check_4z (position %lu): %s"
-msgstr "tld_check_4z (%lu. pozíció): %s"
+msgstr "tld_check_4z (position %lu): %s"
 
 #: src/idn.c:412 src/idn.c:488
 #, c-format
@@ -331,4 +329,10 @@ msgstr "idna_to_unicode_8z4z: %s"
 #: src/idn.c:540
 #, c-format
 msgid "could not do NFKC normalization"
-msgstr "nem lehet NFKC normalizálást végrehajtani"
+msgstr "kunde inte genomföra NFKC-normalisering"
+
+#~ msgid "Could not convert string in locale encoding"
+#~ msgstr "Det gick inte att konvertera strängen till lokal kodning"
+
+#~ msgid "Could not convert string in locale encoding."
+#~ msgstr "Kunde inte konvertera sträng i lokal kodning."


hooks/post-receive
-- 
GNU libidn


