]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Rely on gnulib's secure_getenv()
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 28 May 2016 07:55:53 +0000 (09:55 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 28 May 2016 07:58:16 +0000 (09:58 +0200)
242 files changed:
gl/Makefile.am
gl/alloca.in.h
gl/asnprintf.c
gl/asprintf.c
gl/byteswap.in.h
gl/c-ctype.c
gl/c-ctype.h
gl/errno.in.h
gl/float+.h
gl/float.c
gl/float.in.h
gl/fstat.c
gl/ftell.c
gl/ftello.c
gl/getdelim.c
gl/getline.c
gl/gettext.h
gl/gettimeofday.c
gl/hash-pjw-bare.c
gl/hash-pjw-bare.h
gl/intprops.h
gl/itold.c
gl/lseek.c
gl/m4/00gnulib.m4
gl/m4/absolute-header.m4
gl/m4/alloca.m4
gl/m4/byteswap.m4
gl/m4/ctype.m4 [new file with mode: 0644]
gl/m4/errno_h.m4
gl/m4/exponentd.m4
gl/m4/extensions.m4
gl/m4/extern-inline.m4
gl/m4/fcntl-o.m4
gl/m4/fcntl_h.m4
gl/m4/fdopen.m4
gl/m4/float_h.m4
gl/m4/fpieee.m4
gl/m4/fseeko.m4
gl/m4/fstat.m4
gl/m4/ftell.m4
gl/m4/ftello.m4
gl/m4/func.m4
gl/m4/getdelim.m4
gl/m4/getline.m4
gl/m4/getpagesize.m4
gl/m4/gettimeofday.m4
gl/m4/gnulib-cache.m4
gl/m4/gnulib-common.m4
gl/m4/gnulib-comp.m4
gl/m4/gnulib-tool.m4
gl/m4/include_next.m4
gl/m4/intmax_t.m4
gl/m4/inttypes-pri.m4
gl/m4/inttypes.m4
gl/m4/inttypes_h.m4
gl/m4/largefile.m4
gl/m4/ld-output-def.m4
gl/m4/ld-version-script.m4
gl/m4/lib-ld.m4
gl/m4/lib-link.m4
gl/m4/lib-prefix.m4
gl/m4/longlong.m4
gl/m4/lseek.m4
gl/m4/malloc.m4
gl/m4/manywarnings.m4
gl/m4/math_h.m4
gl/m4/memchr.m4
gl/m4/memmem.m4
gl/m4/minmax.m4
gl/m4/mmap-anon.m4
gl/m4/msvc-inval.m4
gl/m4/msvc-nothrow.m4
gl/m4/multiarch.m4
gl/m4/netdb_h.m4
gl/m4/netinet_in_h.m4
gl/m4/off_t.m4
gl/m4/printf.m4
gl/m4/read-file.m4
gl/m4/realloc.m4
gl/m4/secure_getenv.m4 [new file with mode: 0644]
gl/m4/size_max.m4
gl/m4/snprintf.m4
gl/m4/socklen.m4
gl/m4/sockpfaf.m4
gl/m4/ssize_t.m4
gl/m4/stdalign.m4
gl/m4/stdbool.m4
gl/m4/stddef_h.m4
gl/m4/stdint.m4
gl/m4/stdint_h.m4
gl/m4/stdio_h.m4
gl/m4/stdlib_h.m4
gl/m4/strcase.m4
gl/m4/string_h.m4
gl/m4/strings_h.m4
gl/m4/strndup.m4
gl/m4/strnlen.m4
gl/m4/strtok_r.m4
gl/m4/strverscmp.m4
gl/m4/sys_socket_h.m4
gl/m4/sys_stat_h.m4
gl/m4/sys_time_h.m4
gl/m4/sys_types_h.m4
gl/m4/sys_uio_h.m4
gl/m4/time_h.m4
gl/m4/time_r.m4
gl/m4/ungetc.m4
gl/m4/unistd_h.m4
gl/m4/valgrind-tests.m4
gl/m4/vasnprintf.m4
gl/m4/vasprintf.m4
gl/m4/vsnprintf.m4
gl/m4/warn-on-use.m4
gl/m4/warnings.m4
gl/m4/wchar_h.m4
gl/m4/wchar_t.m4
gl/m4/wint_t.m4
gl/m4/xsize.m4
gl/malloc.c
gl/memchr.c
gl/memmem.c
gl/minmax.h
gl/msvc-inval.c
gl/msvc-inval.h
gl/msvc-nothrow.c
gl/msvc-nothrow.h
gl/netdb.in.h
gl/netinet_in.in.h
gl/printf-args.c
gl/printf-args.h
gl/printf-parse.c
gl/printf-parse.h
gl/read-file.c
gl/read-file.h
gl/realloc.c
gl/secure_getenv.c [new file with mode: 0644]
gl/size_max.h
gl/snprintf.c
gl/stdalign.in.h
gl/stdbool.in.h
gl/stddef.in.h
gl/stdint.in.h
gl/stdio-impl.h
gl/stdio.in.h
gl/stdlib.in.h
gl/str-two-way.h
gl/strcasecmp.c
gl/string.in.h
gl/strings.in.h
gl/strncasecmp.c
gl/strndup.c
gl/strnlen.c
gl/strtok_r.c
gl/strverscmp.c
gl/sys_socket.c
gl/sys_socket.in.h
gl/sys_stat.in.h
gl/sys_time.in.h
gl/sys_types.in.h
gl/sys_uio.in.h
gl/tests/Makefile.am
gl/tests/binary-io.c
gl/tests/binary-io.h
gl/tests/ctype.in.h [new file with mode: 0644]
gl/tests/fcntl.in.h
gl/tests/fdopen.c
gl/tests/fpucw.h
gl/tests/getpagesize.c
gl/tests/init.sh
gl/tests/inttypes.in.h
gl/tests/macros.h
gl/tests/signature.h
gl/tests/test-alloca-opt.c
gl/tests/test-binary-io.c
gl/tests/test-byteswap.c
gl/tests/test-c-ctype.c
gl/tests/test-ctype.c [new file with mode: 0644]
gl/tests/test-errno.c
gl/tests/test-fcntl-h.c
gl/tests/test-fdopen.c
gl/tests/test-fgetc.c
gl/tests/test-float.c
gl/tests/test-fputc.c
gl/tests/test-fread.c
gl/tests/test-fstat.c
gl/tests/test-ftell.c
gl/tests/test-ftell3.c
gl/tests/test-ftello.c
gl/tests/test-ftello3.c
gl/tests/test-ftello4.c
gl/tests/test-func.c
gl/tests/test-fwrite.c
gl/tests/test-getdelim.c
gl/tests/test-getline.c
gl/tests/test-gettimeofday.c
gl/tests/test-iconv.c
gl/tests/test-init.sh
gl/tests/test-intprops.c
gl/tests/test-inttypes.c
gl/tests/test-memchr.c
gl/tests/test-netdb.c
gl/tests/test-netinet_in.c
gl/tests/test-read-file.c
gl/tests/test-snprintf.c
gl/tests/test-stdalign.c
gl/tests/test-stdbool.c
gl/tests/test-stddef.c
gl/tests/test-stdint.c
gl/tests/test-stdio.c
gl/tests/test-stdlib.c
gl/tests/test-string.c
gl/tests/test-strings.c
gl/tests/test-strnlen.c
gl/tests/test-strverscmp.c
gl/tests/test-sys_socket.c
gl/tests/test-sys_stat.c
gl/tests/test-sys_time.c
gl/tests/test-sys_types.c
gl/tests/test-sys_uio.c
gl/tests/test-sys_wait.h
gl/tests/test-time.c
gl/tests/test-unistd.c
gl/tests/test-vasnprintf.c
gl/tests/test-vasprintf.c
gl/tests/test-vc-list-files-cvs.sh
gl/tests/test-vc-list-files-git.sh
gl/tests/test-verify.c
gl/tests/test-vsnprintf.c
gl/tests/test-wchar.c
gl/tests/zerosize-ptr.h
gl/time.in.h
gl/time_r.c
gl/unistd.c
gl/unistd.in.h
gl/vasnprintf.c
gl/vasnprintf.h
gl/vasprintf.c
gl/verify.h
gl/vsnprintf.c
gl/wchar.in.h
gl/xsize.h
lib/mem.h

index e5e982009aec540a5b4661e2a1c98805c1326ee8..13eed87cdf84e8c066f3c32c5356beaf2c748a74 100644 (file)
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2015 Free Software Foundation, Inc.
+# Copyright (C) 2002-2016 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files --lgpl=2 alloca byteswap c-ctype extensions func gendocs getline gettext-h gettimeofday hash-pjw-bare havelib iconv intprops lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file snprintf stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r unistd valgrind-tests vasprintf vsnprintf warnings
+# Reproduce by: gnulib-tool --import --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files --lgpl=2 alloca byteswap c-ctype extensions func gendocs getline gettext-h gettimeofday hash-pjw-bare havelib iconv intprops lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file secure_getenv snprintf stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r unistd valgrind-tests vasprintf vsnprintf warnings
 
 AUTOMAKE_OPTIONS = 1.9.6 gnits
 
@@ -443,6 +443,15 @@ EXTRA_libgnu_la_SOURCES += realloc.c
 
 ## end   gnulib module realloc-posix
 
+## begin gnulib module secure_getenv
+
+
+EXTRA_DIST += secure_getenv.c
+
+EXTRA_libgnu_la_SOURCES += secure_getenv.c
+
+## end   gnulib module secure_getenv
+
 ## begin gnulib module size_max
 
 libgnu_la_SOURCES += size_max.h
index 16a27c690d5e5919d1cfe71638f50868e25f98da..a87da81818da5283460309caf6cdbdc95d7d0376 100644 (file)
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2015 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2016 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
index 375503cb045cd3fbfbcfa079fb0db9e4f1d4fca5..d89877cd8eb2847ec1d25ae20311abac50ae7d96 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index ff0fba0cdf22a7186c145f814a817c8a93c43eb8..ee2b58f2d8be315dbab55d48659eac67e877a8ce 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2007, 2009-2015 Free Software Foundation,
+   Copyright (C) 1999, 2002, 2006-2007, 2009-2016 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify
index 03168960624b0f931800d697aa7f225373722ead..31c1c6ea8fa6c944a95fea0b30444a49144ea5d7 100644 (file)
@@ -1,5 +1,5 @@
 /* byteswap.h - Byte swapping
-   Copyright (C) 2005, 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
    Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
 
    This program is free software: you can redistribute it and/or modify
index 932d676dfea5ad188cf76e2645482602013cc5e3..5d9d4d87a61a27ca8bd0444826177977d03260b5 100644 (file)
@@ -1,395 +1,3 @@
-/* Character handling in C locale.
-
-   Copyright 2000-2003, 2006, 2009-2015 Free Software Foundation, Inc.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 2.1 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this program; if not, see <http://www.gnu.org/licenses/>.  */
-
 #include <config.h>
-
-/* Specification.  */
-#define NO_C_CTYPE_MACROS
+#define C_CTYPE_INLINE _GL_EXTERN_INLINE
 #include "c-ctype.h"
-
-/* The function isascii is not locale dependent. Its use in EBCDIC is
-   questionable. */
-bool
-c_isascii (int c)
-{
-  return (c >= 0x00 && c <= 0x7f);
-}
-
-bool
-c_isalnum (int c)
-{
-#if C_CTYPE_CONSECUTIVE_DIGITS \
-    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
-  return ((c >= '0' && c <= '9')
-          || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z'));
-#else
-  return ((c >= '0' && c <= '9')
-          || (c >= 'A' && c <= 'Z')
-          || (c >= 'a' && c <= 'z'));
-#endif
-#else
-  switch (c)
-    {
-    case '0': case '1': case '2': case '3': case '4': case '5':
-    case '6': case '7': case '8': case '9':
-    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-    case 'Y': case 'Z':
-    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-    case 'y': case 'z':
-      return 1;
-    default:
-      return 0;
-    }
-#endif
-}
-
-bool
-c_isalpha (int c)
-{
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
-  return ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z');
-#else
-  return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
-#endif
-#else
-  switch (c)
-    {
-    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-    case 'Y': case 'Z':
-    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-    case 'y': case 'z':
-      return 1;
-    default:
-      return 0;
-    }
-#endif
-}
-
-bool
-c_isblank (int c)
-{
-  return (c == ' ' || c == '\t');
-}
-
-bool
-c_iscntrl (int c)
-{
-#if C_CTYPE_ASCII
-  return ((c & ~0x1f) == 0 || c == 0x7f);
-#else
-  switch (c)
-    {
-    case ' ': case '!': case '"': case '#': case '$': case '%':
-    case '&': case '\'': case '(': case ')': case '*': case '+':
-    case ',': case '-': case '.': case '/':
-    case '0': case '1': case '2': case '3': case '4': case '5':
-    case '6': case '7': case '8': case '9':
-    case ':': case ';': case '<': case '=': case '>': case '?':
-    case '@':
-    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-    case 'Y': case 'Z':
-    case '[': case '\\': case ']': case '^': case '_': case '`':
-    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-    case 'y': case 'z':
-    case '{': case '|': case '}': case '~':
-      return 0;
-    default:
-      return 1;
-    }
-#endif
-}
-
-bool
-c_isdigit (int c)
-{
-#if C_CTYPE_CONSECUTIVE_DIGITS
-  return (c >= '0' && c <= '9');
-#else
-  switch (c)
-    {
-    case '0': case '1': case '2': case '3': case '4': case '5':
-    case '6': case '7': case '8': case '9':
-      return 1;
-    default:
-      return 0;
-    }
-#endif
-}
-
-bool
-c_islower (int c)
-{
-#if C_CTYPE_CONSECUTIVE_LOWERCASE
-  return (c >= 'a' && c <= 'z');
-#else
-  switch (c)
-    {
-    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-    case 'y': case 'z':
-      return 1;
-    default:
-      return 0;
-    }
-#endif
-}
-
-bool
-c_isgraph (int c)
-{
-#if C_CTYPE_ASCII
-  return (c >= '!' && c <= '~');
-#else
-  switch (c)
-    {
-    case '!': case '"': case '#': case '$': case '%': case '&':
-    case '\'': case '(': case ')': case '*': case '+': case ',':
-    case '-': case '.': case '/':
-    case '0': case '1': case '2': case '3': case '4': case '5':
-    case '6': case '7': case '8': case '9':
-    case ':': case ';': case '<': case '=': case '>': case '?':
-    case '@':
-    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-    case 'Y': case 'Z':
-    case '[': case '\\': case ']': case '^': case '_': case '`':
-    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-    case 'y': case 'z':
-    case '{': case '|': case '}': case '~':
-      return 1;
-    default:
-      return 0;
-    }
-#endif
-}
-
-bool
-c_isprint (int c)
-{
-#if C_CTYPE_ASCII
-  return (c >= ' ' && c <= '~');
-#else
-  switch (c)
-    {
-    case ' ': case '!': case '"': case '#': case '$': case '%':
-    case '&': case '\'': case '(': case ')': case '*': case '+':
-    case ',': case '-': case '.': case '/':
-    case '0': case '1': case '2': case '3': case '4': case '5':
-    case '6': case '7': case '8': case '9':
-    case ':': case ';': case '<': case '=': case '>': case '?':
-    case '@':
-    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-    case 'Y': case 'Z':
-    case '[': case '\\': case ']': case '^': case '_': case '`':
-    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-    case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-    case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-    case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-    case 'y': case 'z':
-    case '{': case '|': case '}': case '~':
-      return 1;
-    default:
-      return 0;
-    }
-#endif
-}
-
-bool
-c_ispunct (int c)
-{
-#if C_CTYPE_ASCII
-  return ((c >= '!' && c <= '~')
-          && !((c >= '0' && c <= '9')
-               || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z')));
-#else
-  switch (c)
-    {
-    case '!': case '"': case '#': case '$': case '%': case '&':
-    case '\'': case '(': case ')': case '*': case '+': case ',':
-    case '-': case '.': case '/':
-    case ':': case ';': case '<': case '=': case '>': case '?':
-    case '@':
-    case '[': case '\\': case ']': case '^': case '_': case '`':
-    case '{': case '|': case '}': case '~':
-      return 1;
-    default:
-      return 0;
-    }
-#endif
-}
-
-bool
-c_isspace (int c)
-{
-  return (c == ' ' || c == '\t'
-          || c == '\n' || c == '\v' || c == '\f' || c == '\r');
-}
-
-bool
-c_isupper (int c)
-{
-#if C_CTYPE_CONSECUTIVE_UPPERCASE
-  return (c >= 'A' && c <= 'Z');
-#else
-  switch (c)
-    {
-    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-    case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-    case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-    case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-    case 'Y': case 'Z':
-      return 1;
-    default:
-      return 0;
-    }
-#endif
-}
-
-bool
-c_isxdigit (int c)
-{
-#if C_CTYPE_CONSECUTIVE_DIGITS \
-    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
-  return ((c >= '0' && c <= '9')
-          || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'F'));
-#else
-  return ((c >= '0' && c <= '9')
-          || (c >= 'A' && c <= 'F')
-          || (c >= 'a' && c <= 'f'));
-#endif
-#else
-  switch (c)
-    {
-    case '0': case '1': case '2': case '3': case '4': case '5':
-    case '6': case '7': case '8': case '9':
-    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-      return 1;
-    default:
-      return 0;
-    }
-#endif
-}
-
-int
-c_tolower (int c)
-{
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-  return (c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c);
-#else
-  switch (c)
-    {
-    case 'A': return 'a';
-    case 'B': return 'b';
-    case 'C': return 'c';
-    case 'D': return 'd';
-    case 'E': return 'e';
-    case 'F': return 'f';
-    case 'G': return 'g';
-    case 'H': return 'h';
-    case 'I': return 'i';
-    case 'J': return 'j';
-    case 'K': return 'k';
-    case 'L': return 'l';
-    case 'M': return 'm';
-    case 'N': return 'n';
-    case 'O': return 'o';
-    case 'P': return 'p';
-    case 'Q': return 'q';
-    case 'R': return 'r';
-    case 'S': return 's';
-    case 'T': return 't';
-    case 'U': return 'u';
-    case 'V': return 'v';
-    case 'W': return 'w';
-    case 'X': return 'x';
-    case 'Y': return 'y';
-    case 'Z': return 'z';
-    default: return c;
-    }
-#endif
-}
-
-int
-c_toupper (int c)
-{
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-  return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c);
-#else
-  switch (c)
-    {
-    case 'a': return 'A';
-    case 'b': return 'B';
-    case 'c': return 'C';
-    case 'd': return 'D';
-    case 'e': return 'E';
-    case 'f': return 'F';
-    case 'g': return 'G';
-    case 'h': return 'H';
-    case 'i': return 'I';
-    case 'j': return 'J';
-    case 'k': return 'K';
-    case 'l': return 'L';
-    case 'm': return 'M';
-    case 'n': return 'N';
-    case 'o': return 'O';
-    case 'p': return 'P';
-    case 'q': return 'Q';
-    case 'r': return 'R';
-    case 's': return 'S';
-    case 't': return 'T';
-    case 'u': return 'U';
-    case 'v': return 'V';
-    case 'w': return 'W';
-    case 'x': return 'X';
-    case 'y': return 'Y';
-    case 'z': return 'Z';
-    default: return c;
-    }
-#endif
-}
index d57cf4376714c575d593a3df7a9da89c0f8ed8ff..80d704135db5f1288f3360767138d4ef772c9c64 100644 (file)
@@ -5,7 +5,7 @@
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
-   Copyright (C) 2000-2003, 2006, 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2006, 2008-2016 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -25,6 +25,13 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdbool.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef C_CTYPE_INLINE
+# define C_CTYPE_INLINE _GL_INLINE
+#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -39,38 +46,6 @@ extern "C" {
    characters.  */
 
 
-/* Check whether the ASCII optimizations apply. */
-
-/* ANSI C89 (and ISO C99 5.2.1.3 too) already guarantees that
-   '0', '1', ..., '9' have consecutive integer values.  */
-#define C_CTYPE_CONSECUTIVE_DIGITS 1
-
-#if ('A' <= 'Z') \
-    && ('A' + 1 == 'B') && ('B' + 1 == 'C') && ('C' + 1 == 'D') \
-    && ('D' + 1 == 'E') && ('E' + 1 == 'F') && ('F' + 1 == 'G') \
-    && ('G' + 1 == 'H') && ('H' + 1 == 'I') && ('I' + 1 == 'J') \
-    && ('J' + 1 == 'K') && ('K' + 1 == 'L') && ('L' + 1 == 'M') \
-    && ('M' + 1 == 'N') && ('N' + 1 == 'O') && ('O' + 1 == 'P') \
-    && ('P' + 1 == 'Q') && ('Q' + 1 == 'R') && ('R' + 1 == 'S') \
-    && ('S' + 1 == 'T') && ('T' + 1 == 'U') && ('U' + 1 == 'V') \
-    && ('V' + 1 == 'W') && ('W' + 1 == 'X') && ('X' + 1 == 'Y') \
-    && ('Y' + 1 == 'Z')
-#define C_CTYPE_CONSECUTIVE_UPPERCASE 1
-#endif
-
-#if ('a' <= 'z') \
-    && ('a' + 1 == 'b') && ('b' + 1 == 'c') && ('c' + 1 == 'd') \
-    && ('d' + 1 == 'e') && ('e' + 1 == 'f') && ('f' + 1 == 'g') \
-    && ('g' + 1 == 'h') && ('h' + 1 == 'i') && ('i' + 1 == 'j') \
-    && ('j' + 1 == 'k') && ('k' + 1 == 'l') && ('l' + 1 == 'm') \
-    && ('m' + 1 == 'n') && ('n' + 1 == 'o') && ('o' + 1 == 'p') \
-    && ('p' + 1 == 'q') && ('q' + 1 == 'r') && ('r' + 1 == 's') \
-    && ('s' + 1 == 't') && ('t' + 1 == 'u') && ('u' + 1 == 'v') \
-    && ('v' + 1 == 'w') && ('w' + 1 == 'x') && ('x' + 1 == 'y') \
-    && ('y' + 1 == 'z')
-#define C_CTYPE_CONSECUTIVE_LOWERCASE 1
-#endif
-
 #if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
     && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
     && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
@@ -96,11 +71,84 @@ extern "C" {
     && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
 /* The character set is ASCII or one of its variants or extensions, not EBCDIC.
    Testing the value of '\n' and '\r' is not relevant.  */
-#define C_CTYPE_ASCII 1
+# define C_CTYPE_ASCII 1
+#elif ! (' ' == '\x40' && '0' == '\xf0'                     \
+         && 'A' == '\xc1' && 'J' == '\xd1' && 'S' == '\xe2' \
+         && 'a' == '\x81' && 'j' == '\x91' && 's' == '\xa2')
+# error "Only ASCII and EBCDIC are supported"
 #endif
 
+#if 'A' < 0
+# error "EBCDIC and char is signed -- not supported"
+#endif
+
+/* Cases for control characters.  */
+
+#define _C_CTYPE_CNTRL \
+   case '\a': case '\b': case '\f': case '\n': \
+   case '\r': case '\t': case '\v': \
+   _C_CTYPE_OTHER_CNTRL
+
+/* ASCII control characters other than those with \-letter escapes.  */
+
+#if C_CTYPE_ASCII
+# define _C_CTYPE_OTHER_CNTRL \
+    case '\x00': case '\x01': case '\x02': case '\x03': \
+    case '\x04': case '\x05': case '\x06': case '\x0e': \
+    case '\x0f': case '\x10': case '\x11': case '\x12': \
+    case '\x13': case '\x14': case '\x15': case '\x16': \
+    case '\x17': case '\x18': case '\x19': case '\x1a': \
+    case '\x1b': case '\x1c': case '\x1d': case '\x1e': \
+    case '\x1f': case '\x7f'
+#else
+   /* Use EBCDIC code page 1047's assignments for ASCII control chars;
+      assume all EBCDIC code pages agree about these assignments.  */
+# define _C_CTYPE_OTHER_CNTRL \
+    case '\x00': case '\x01': case '\x02': case '\x03': \
+    case '\x07': case '\x0e': case '\x0f': case '\x10': \
+    case '\x11': case '\x12': case '\x13': case '\x18': \
+    case '\x19': case '\x1c': case '\x1d': case '\x1e': \
+    case '\x1f': case '\x26': case '\x27': case '\x2d': \
+    case '\x2e': case '\x32': case '\x37': case '\x3c': \
+    case '\x3d': case '\x3f'
+#endif
 
-/* Function declarations. */
+/* Cases for lowercase hex letters, and lowercase letters, all offset by N.  */
+
+#define _C_CTYPE_LOWER_A_THRU_F_N(n) \
+   case 'a' + (n): case 'b' + (n): case 'c' + (n): case 'd' + (n): \
+   case 'e' + (n): case 'f' + (n)
+#define _C_CTYPE_LOWER_N(n) \
+   _C_CTYPE_LOWER_A_THRU_F_N(n): \
+   case 'g' + (n): case 'h' + (n): case 'i' + (n): case 'j' + (n): \
+   case 'k' + (n): case 'l' + (n): case 'm' + (n): case 'n' + (n): \
+   case 'o' + (n): case 'p' + (n): case 'q' + (n): case 'r' + (n): \
+   case 's' + (n): case 't' + (n): case 'u' + (n): case 'v' + (n): \
+   case 'w' + (n): case 'x' + (n): case 'y' + (n): case 'z' + (n)
+
+/* Cases for hex letters, digits, lower, punct, and upper.  */
+
+#define _C_CTYPE_A_THRU_F \
+   _C_CTYPE_LOWER_A_THRU_F_N (0): \
+   _C_CTYPE_LOWER_A_THRU_F_N ('A' - 'a')
+#define _C_CTYPE_DIGIT                     \
+   case '0': case '1': case '2': case '3': \
+   case '4': case '5': case '6': case '7': \
+   case '8': case '9'
+#define _C_CTYPE_LOWER _C_CTYPE_LOWER_N (0)
+#define _C_CTYPE_PUNCT \
+   case '!': case '"': case '#': case '$':  \
+   case '%': case '&': case '\'': case '(': \
+   case ')': case '*': case '+': case ',':  \
+   case '-': case '.': case '/': case ':':  \
+   case ';': case '<': case '=': case '>':  \
+   case '?': case '@': case '[': case '\\': \
+   case ']': case '^': case '_': case '`':  \
+   case '{': case '|': case '}': case '~'
+#define _C_CTYPE_UPPER _C_CTYPE_LOWER_N ('A' - 'a')
+
+
+/* Function definitions.  */
 
 /* Unlike the functions in <ctype.h>, which require an argument in the range
    of the 'unsigned char' type, the functions here operate on values that are
@@ -117,179 +165,202 @@ extern "C" {
          if (c_isalpha (*s)) ...
  */
 
-extern bool c_isascii (int c) _GL_ATTRIBUTE_CONST; /* not locale dependent */
-
-extern bool c_isalnum (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_isalpha (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_isblank (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_iscntrl (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_isdigit (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_islower (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_isgraph (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_isprint (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_ispunct (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_isspace (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_isupper (int c) _GL_ATTRIBUTE_CONST;
-extern bool c_isxdigit (int c) _GL_ATTRIBUTE_CONST;
-
-extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
-extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
-
-
-#if (defined __GNUC__ && !defined __STRICT_ANSI__ && defined __OPTIMIZE__ \
-     && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS)
-
-/* ASCII optimizations. */
-
-#undef c_isascii
-#define c_isascii(c) \
-  ({ int __c = (c); \
-     (__c >= 0x00 && __c <= 0x7f); \
-   })
+C_CTYPE_INLINE bool
+c_isalnum (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_DIGIT:
+    _C_CTYPE_LOWER:
+    _C_CTYPE_UPPER:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#if C_CTYPE_CONSECUTIVE_DIGITS \
-    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
-#undef c_isalnum
-#define c_isalnum(c) \
-  ({ int __c = (c); \
-     ((__c >= '0' && __c <= '9') \
-      || ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z')); \
-   })
-#else
-#undef c_isalnum
-#define c_isalnum(c) \
-  ({ int __c = (c); \
-     ((__c >= '0' && __c <= '9') \
-      || (__c >= 'A' && __c <= 'Z') \
-      || (__c >= 'a' && __c <= 'z')); \
-   })
-#endif
-#endif
+C_CTYPE_INLINE bool
+c_isalpha (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_LOWER:
+    _C_CTYPE_UPPER:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
-#undef c_isalpha
-#define c_isalpha(c) \
-  ({ int __c = (c); \
-     ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z'); \
-   })
-#else
-#undef c_isalpha
-#define c_isalpha(c) \
-  ({ int __c = (c); \
-     ((__c >= 'A' && __c <= 'Z') || (__c >= 'a' && __c <= 'z')); \
-   })
-#endif
-#endif
+/* The function isascii is not locale dependent.
+   Its use in EBCDIC is questionable. */
+C_CTYPE_INLINE bool
+c_isascii (int c)
+{
+  switch (c)
+    {
+    case ' ':
+    _C_CTYPE_CNTRL:
+    _C_CTYPE_DIGIT:
+    _C_CTYPE_LOWER:
+    _C_CTYPE_PUNCT:
+    _C_CTYPE_UPPER:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#undef c_isblank
-#define c_isblank(c) \
-  ({ int __c = (c); \
-     (__c == ' ' || __c == '\t'); \
-   })
+C_CTYPE_INLINE bool
+c_isblank (int c)
+{
+  return c == ' ' || c == '\t';
+}
 
-#if C_CTYPE_ASCII
-#undef c_iscntrl
-#define c_iscntrl(c) \
-  ({ int __c = (c); \
-     ((__c & ~0x1f) == 0 || __c == 0x7f); \
-   })
-#endif
+C_CTYPE_INLINE bool
+c_iscntrl (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_CNTRL:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#if C_CTYPE_CONSECUTIVE_DIGITS
-#undef c_isdigit
-#define c_isdigit(c) \
-  ({ int __c = (c); \
-     (__c >= '0' && __c <= '9'); \
-   })
-#endif
+C_CTYPE_INLINE bool
+c_isdigit (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_DIGIT:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#if C_CTYPE_CONSECUTIVE_LOWERCASE
-#undef c_islower
-#define c_islower(c) \
-  ({ int __c = (c); \
-     (__c >= 'a' && __c <= 'z'); \
-   })
-#endif
+C_CTYPE_INLINE bool
+c_isgraph (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_DIGIT:
+    _C_CTYPE_LOWER:
+    _C_CTYPE_PUNCT:
+    _C_CTYPE_UPPER:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#if C_CTYPE_ASCII
-#undef c_isgraph
-#define c_isgraph(c) \
-  ({ int __c = (c); \
-     (__c >= '!' && __c <= '~'); \
-   })
-#endif
+C_CTYPE_INLINE bool
+c_islower (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_LOWER:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#if C_CTYPE_ASCII
-#undef c_isprint
-#define c_isprint(c) \
-  ({ int __c = (c); \
-     (__c >= ' ' && __c <= '~'); \
-   })
-#endif
+C_CTYPE_INLINE bool
+c_isprint (int c)
+{
+  switch (c)
+    {
+    case ' ':
+    _C_CTYPE_DIGIT:
+    _C_CTYPE_LOWER:
+    _C_CTYPE_PUNCT:
+    _C_CTYPE_UPPER:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#if C_CTYPE_ASCII
-#undef c_ispunct
-#define c_ispunct(c) \
-  ({ int _c = (c); \
-     (c_isgraph (_c) && ! c_isalnum (_c)); \
-   })
-#endif
+C_CTYPE_INLINE bool
+c_ispunct (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_PUNCT:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#undef c_isspace
-#define c_isspace(c) \
-  ({ int __c = (c); \
-     (__c == ' ' || __c == '\t' \
-      || __c == '\n' || __c == '\v' || __c == '\f' || __c == '\r'); \
-   })
-
-#if C_CTYPE_CONSECUTIVE_UPPERCASE
-#undef c_isupper
-#define c_isupper(c) \
-  ({ int __c = (c); \
-     (__c >= 'A' && __c <= 'Z'); \
-   })
-#endif
+C_CTYPE_INLINE bool
+c_isspace (int c)
+{
+  switch (c)
+    {
+    case ' ': case '\t': case '\n': case '\v': case '\f': case '\r':
+      return true;
+    default:
+      return false;
+    }
+}
 
-#if C_CTYPE_CONSECUTIVE_DIGITS \
-    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
-#undef c_isxdigit
-#define c_isxdigit(c) \
-  ({ int __c = (c); \
-     ((__c >= '0' && __c <= '9') \
-      || ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'F')); \
-   })
-#else
-#undef c_isxdigit
-#define c_isxdigit(c) \
-  ({ int __c = (c); \
-     ((__c >= '0' && __c <= '9') \
-      || (__c >= 'A' && __c <= 'F') \
-      || (__c >= 'a' && __c <= 'f')); \
-   })
-#endif
-#endif
+C_CTYPE_INLINE bool
+c_isupper (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_UPPER:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#undef c_tolower
-#define c_tolower(c) \
-  ({ int __c = (c); \
-     (__c >= 'A' && __c <= 'Z' ? __c - 'A' + 'a' : __c); \
-   })
-#undef c_toupper
-#define c_toupper(c) \
-  ({ int __c = (c); \
-     (__c >= 'a' && __c <= 'z' ? __c - 'a' + 'A' : __c); \
-   })
-#endif
+C_CTYPE_INLINE bool
+c_isxdigit (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_DIGIT:
+    _C_CTYPE_A_THRU_F:
+      return true;
+    default:
+      return false;
+    }
+}
 
-#endif /* optimizing for speed */
+C_CTYPE_INLINE int
+c_tolower (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_UPPER:
+      return c - 'A' + 'a';
+    default:
+      return c;
+    }
+}
 
+C_CTYPE_INLINE int
+c_toupper (int c)
+{
+  switch (c)
+    {
+    _C_CTYPE_LOWER:
+      return c - 'a' + 'A';
+    default:
+      return c;
+    }
+}
 
 #ifdef __cplusplus
 }
 #endif
 
+_GL_INLINE_HEADER_END
+
 #endif /* C_CTYPE_H */
index 4d68ea0e5383581a89006d7eed6e98d7f6e984fb..f1fcf1fb3eee498be30e7f759d3f4ea76a5e1fe7 100644 (file)
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index ac1b02d526c50276947dd8abc0366ea29d25a9ae..49a9dfc0f628b7351b092af44066912495dfc2d8 100644 (file)
@@ -1,5 +1,5 @@
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software; you can redistribute it and/or modify
index 9869971e8517e920a6fbac20dace10ffb024ccac..a2c7fe6af0b8de00f86df1e4a694282525be0237 100644 (file)
@@ -1,5 +1,5 @@
 /* Auxiliary definitions for <float.h>.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
index 98bd7f74e69380faeb07e50db37338c40126590d..c80126116bf4b015cc2e63376d7792c24c80c040 100644 (file)
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 6433514c937c2d7916be22a7987cb624e22fe595..b2104d3bdd716427f2a7a7f8574a763442c2cf27 100644 (file)
@@ -1,5 +1,5 @@
 /* fstat() replacement.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 01dc62f180ce8b19269483138eebee762aea48ec..0c77bd2ac3e120bb502bf29c830e45bac7929659 100644 (file)
@@ -1,5 +1,5 @@
 /* An ftell() function that works around platform bugs.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index c74bd4c8e35dc61ceb1b48489709c3c0fd57162d..d1b00d1247d9fb4454011d973c3f3ee8533e9a2a 100644 (file)
@@ -1,5 +1,5 @@
 /* An ftello() function that works around platform bugs.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index f87b708763eee631c0ff66d6b635af0aa2279ea4..46f145aba4c5ec1dddf00bb3f9202d19a7ca8c1a 100644 (file)
@@ -1,5 +1,5 @@
 /* getdelim.c --- Implementation of replacement getdelim function.
-   Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2015 Free Software
+   Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2016 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
index 2f3e4ce3ce7d85401afa3166c857047e1f7abad7..08b8f0796a34a35dc2f2ed21f0bd29cdd3d08a3e 100644 (file)
@@ -1,5 +1,5 @@
 /* getline.c --- Implementation of replacement getline function.
-   Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public License as
index 7d3ea3cbf16040c2cbdbea249fb616e4fe7b0be6..4aa138ea1349cd98ba13f5ea194092cc86e9c23a 100644 (file)
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2015 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2016 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -225,15 +225,17 @@ dcpgettext_expr (const char *domain,
   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;
@@ -271,15 +273,17 @@ dcnpgettext_expr (const char *domain,
   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);
index ab76abfb288f8bac50a001fe4297c32063d8d4eb..df01908d50130b9b6382cf9860fa2b6f6ba8a6a1 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide gettimeofday for systems that don't have it or for which it's broken.
 
-   Copyright (C) 2001-2003, 2005-2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 6dab917d6103fd1420675042ce58081653cac872..3e25cae8784d4838b1d50e9d92d2b891bf855cba 100644 (file)
@@ -1,6 +1,6 @@
 /* hash-pjw-bare.c -- compute a hash value from a provided buffer.
 
-   Copyright (C) 2012-2015 Free Software Foundation, Inc.
+   Copyright (C) 2012-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published
index 2aa39acf849957b92eb535f715a7ac91dac6b35b..af4892af926a9dba086edcc7dfffbf15f5922cb8 100644 (file)
@@ -1,5 +1,5 @@
 /* hash-pjw-bare.h -- declaration for a simple hash function
-   Copyright (C) 2012-2015 Free Software Foundation, Inc.
+   Copyright (C) 2012-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published
@@ -20,5 +20,5 @@
    and return the hash code.  Note that unlike hash_pjw(), it does not
    return it modulo a table size.
    The result is platform dependent: it depends on the size of the 'size_t'
-   type and on the signedness of the 'char' type.  */
+   type.  */
 extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE;
index 2ae151b92953d8d65237393540c023258145cee6..0be799dfe3042d157fff934b3732752bdd7bcf3b 100644 (file)
@@ -1,10 +1,10 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2005, 2009-2015 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 Lesser General Public License as published by
-   the Free Software Foundation; either version 2.1 of the License, or
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published
+   by the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -21,9 +21,9 @@
 #define _GL_INTPROPS_H
 
 #include <limits.h>
+#include <verify.h>
 
-/* Return an integer value, converted to the same type as the integer
-   expression E after integer type promotion.  V is the unconverted value.  */
+/* 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))
 
 /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
    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 arithmetic type T is signed.  */
+/* True if the real type T is signed.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
 
-/* Return 1 if the integer expression E, after integer promotion, has
-   a signed type.  */
-#define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+/* Return 1 if the real expression E, after promotion, has a
+   signed or floating type.  */
+#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                                                        \
 /* The maximum and minimum values for the type of the expression E,
    after integer promotion.  E should not have side effects.  */
 #define _GL_INT_MINIMUM(e)                                              \
-  (_GL_INT_SIGNED (e)                                                   \
-   ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e)         \
+  (EXPR_SIGNED (e)                                                      \
+   ? ~ _GL_SIGNED_INT_MAXIMUM (e)                                       \
    : _GL_INT_CONVERT (e, 0))
 #define _GL_INT_MAXIMUM(e)                                              \
-  (_GL_INT_SIGNED (e)                                                   \
+  (EXPR_SIGNED (e)                                                      \
    ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
    : _GL_INT_NEGATE_CONVERT (e, 1))
 #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
   (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
 
+/* 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__))
     : (a) % - (b))                                                      \
    == 0)
 
-
-/* Integer overflow checks.
+/* Check for integer overflow, and report low order bits of answer.
 
    The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
    might not yield numerically correct answers due to arithmetic overflow.
-   They work correctly on all known practical hosts, and do not rely
+   The INT_<op>_WRAPV macros also store the low-order bits of the answer.
+   These macros work correctly on all known practical hosts, and do not rely
    on undefined behavior due to signed arithmetic overflow.
 
-   Example usage:
+   Example usage, assuming A and B are long int:
 
-     long int i = ...;
-     long int j = ...;
-     if (INT_MULTIPLY_OVERFLOW (i, j))
-       printf ("multiply would overflow");
+     if (INT_MULTIPLY_OVERFLOW (a, b))
+       printf ("result would overflow\n");
      else
-       printf ("product is %ld", i * j);
+       printf ("result is %ld (no overflow)\n", a * b);
+
+   Example usage with WRAPV flavor:
+
+     long int result;
+     bool overflow = INT_MULTIPLY_WRAPV (a, b, &result);
+     printf ("result is %ld (%s)\n", result,
+             overflow ? "after overflow" : "no overflow");
+
+   Restrictions on these macros:
 
    These macros do not check for all possible numerical problems or
    undefined or unspecified behavior: they do not check for division
    These macros may evaluate their arguments zero or multiple times, so the
    arguments should not have side effects.
 
+   The WRAPV macros are not constant expressions.  They support only
+   +, binary -, and *.  The result type must be signed.
+
    These macros are tuned for their last argument being a constant.
 
    Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
                       _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.
+   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)
+#define INT_SUBTRACT_WRAPV(a, b, r) \
+  _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW)
+#define INT_MULTIPLY_WRAPV(a, b, r) \
+  _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+
+#ifndef __has_builtin
+# define __has_builtin(x) 0
+#endif
+
+/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+   https://llvm.org/bugs/show_bug.cgi?id=25390
+   For now, assume all versions of GCC-like compilers generate bogus
+   warnings for _Generic.  This matters only for older compilers that
+   lack __builtin_add_overflow.  */
+#if __GNUC__
+# define _GL__GENERIC_BOGUS 1
+#else
+# 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.  */
+#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
+# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+   (_Generic \
+    (*(r), \
+     signed char: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
+                        signed char, SCHAR_MIN, SCHAR_MAX), \
+     short int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
+                        short int, SHRT_MIN, SHRT_MAX), \
+     int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                        int, INT_MIN, INT_MAX), \
+     long int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                        long int, LONG_MIN, LONG_MAX), \
+     long long int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+                        long long int, LLONG_MIN, LLONG_MAX)))
+#else
+# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+   (sizeof *(r) == sizeof (signed char) \
+    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
+                       signed char, SCHAR_MIN, SCHAR_MAX) \
+    : sizeof *(r) == sizeof (short int) \
+    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
+                       short int, SHRT_MIN, SHRT_MAX) \
+    : sizeof *(r) == sizeof (int) \
+    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                       int, INT_MIN, INT_MAX) \
+    : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
+# ifdef LLONG_MAX
+#  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+    (sizeof *(r) == sizeof (long int) \
+     ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                        long int, LONG_MIN, LONG_MAX) \
+     : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+                        long long int, LLONG_MIN, LLONG_MAX))
+# else
+#  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+    _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                     long int, LONG_MIN, LONG_MAX))
+# endif
+#endif
+
+/* 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.  */
+#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) \
+   : _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax))
+#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \
+  ((overflow (a, b) \
+    || (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \
+    || (tmax) < ((a) op (b))) \
+   ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 1) \
+   : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 0))
+
+/* Return A <op> B, where the operation is given by OP.  Use the
+   unsigned type UT for calculation to avoid overflow problems.
+   Convert the result to type T without overflow by subtracting TMIN
+   from large values before converting, and adding it afterwards.
+   Compilers can optimize all the operations except OP.  */
+#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax) \
+  (((ut) (a) op (ut) (b)) <= (tmax) \
+   ? (t) ((ut) (a) op (ut) (b)) \
+   : ((t) (((ut) (a) op (ut) (b)) - (tmin)) + (tmin)))
+
 #endif /* _GL_INTPROPS_H */
index 9361e11512a9239a91ed3f9cc5330c3f088c3ecd..fde7619fc4e537b7c73335e92a325e94f4e7c878 100644 (file)
@@ -1,5 +1,5 @@
 /* Replacement for 'int' to 'long double' conversion routine.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
index 021e15c5b74e9b0ff66e95fb0db972a1c57a8d61..071742b131d48599446d9ffda73c55de8c870a72 100644 (file)
@@ -1,5 +1,5 @@
 /* An lseek() function that detects pipes.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index c7103ed52f505ac77e5c54a229dedee39eae3ffe..bb37e32aa3cae3becf55ab00208c97ec7fca9263 100644 (file)
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 3
-dnl Copyright (C) 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 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,
 dnl with or without modifications, as long as this notice is preserved.
index bc19dfc3010071ff39ef3cfe4922450611b13ff9..7ffc38d7a2b98c2d87e330d3d333414d366406ec 100644 (file)
@@ -1,5 +1,5 @@
 # absolute-header.m4 serial 16
-dnl Copyright (C) 2006-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
index 8408bed2882a3eff189abc3c823f72b1076088cd..2382ff1eeeaf60a25374540f2b1c52aaee666dae 100644 (file)
@@ -1,5 +1,5 @@
 # alloca.m4 serial 14
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2015 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index ec5d46cde2eddaa31dbd9944e4f6fb10b943cca4..27f0fd69d2043797533d53fe4709fb974c13cde6 100644 (file)
@@ -1,5 +1,5 @@
 # byteswap.m4 serial 4
-dnl Copyright (C) 2005, 2007, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 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,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/ctype.m4 b/gl/m4/ctype.m4
new file mode 100644 (file)
index 0000000..a2165aa
--- /dev/null
@@ -0,0 +1,32 @@
+# ctype_h.m4 serial 6
+dnl Copyright (C) 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,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_CTYPE_H],
+[
+  AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+
+  dnl <ctype.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_NEXT_HEADERS([ctype.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <ctype.h>
+    ]], [isblank])
+])
+
+AC_DEFUN([gl_CTYPE_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_CTYPE_H_DEFAULTS],
+[
+  GNULIB_ISBLANK=0; AC_SUBST([GNULIB_ISBLANK])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_ISBLANK=1;   AC_SUBST([HAVE_ISBLANK])
+])
index cfaa687615348895e0c4c38a7c7dfb662b2073ef..b111fce0532d183187e1ec66f562ed569a2a7dcb 100644 (file)
@@ -1,5 +1,5 @@
 # errno_h.m4 serial 12
-dnl Copyright (C) 2004, 2006, 2008-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 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,
 dnl with or without modifications, as long as this notice is preserved.
index 84f1691a655730dd77c4b7300b4571c29fc0e726..7869a7d6cb752be848377a553d528a0f68cf6443 100644 (file)
@@ -1,5 +1,5 @@
 # exponentd.m4 serial 3
-dnl Copyright (C) 2007-2008, 2010-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-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,
 dnl with or without modifications, as long as this notice is preserved.
index 35bc49c97bffdf361a23de1f3bb1da243d9d5038..6d378ec41c182424adedae2e50458756e06715e4 100644 (file)
@@ -1,7 +1,7 @@
 # serial 13  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2015 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
index 72800650e6f23e481623892512083d6f5071b06a..1e578f3deb426f10df4f03c5948282aa989f9a89 100644 (file)
@@ -1,6 +1,6 @@
 dnl 'extern inline' a la ISO C99.
 
-dnl Copyright 2012-2015 Free Software Foundation, Inc.
+dnl Copyright 2012-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,
 dnl with or without modifications, as long as this notice is preserved.
@@ -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
index 891a62fb6a36a93332669c95235c6d1b383a1aff..24fcf88d09458ebbfa6cd066ff2792f079d0ab64 100644 (file)
@@ -1,5 +1,5 @@
 # fcntl-o.m4 serial 4
-dnl Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 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,
 dnl with or without modifications, as long as this notice is preserved.
index b279162a17ce5c28901aeca6c33a6b9b98252a39..ef0d78dde1c80500009d42fa2ecf59faf13273a9 100644 (file)
@@ -1,6 +1,6 @@
 # serial 15
 # Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
index 8c57b9931c0333b65ed8e3cd392db8a418b1a38e..685a1bb9c99935a18a3e650fcd3bd70aeca216b4 100644 (file)
@@ -1,5 +1,5 @@
 # fdopen.m4 serial 3
-dnl Copyright (C) 2011-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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,
 dnl with or without modifications, as long as this notice is preserved.
index e4853f3b091aa699c8771d50511321bca0d87f83..e2887eb5c64ec5e007b4315aca61071b4b52d7c5 100644 (file)
@@ -1,5 +1,5 @@
 # float_h.m4 serial 9
-dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index a4e48997ed97f3be53cfbd9acf2fee9658baca09..e11ac9f09c18dfdaf66761578c6bfef1a8e81312 100644 (file)
@@ -1,5 +1,5 @@
-# fpieee.m4 serial 2
-dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+# fpieee.m4 serial 2  -*- coding: utf-8 -*-
+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,
 dnl with or without modifications, as long as this notice is preserved.
index 84555e2cba986e25b9a08e065666d1bee4aff1b3..6c7f551bda9c2a08f39439d524465a18a0fbd1a3 100644 (file)
@@ -1,5 +1,5 @@
 # fseeko.m4 serial 17
-dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index d6a928827e1774cf28455a74c5abc9b41769140a..29f9b81654aced034ce5ace3282a77b1d6083822 100644 (file)
@@ -1,5 +1,5 @@
 # fstat.m4 serial 4
-dnl Copyright (C) 2011-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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,
 dnl with or without modifications, as long as this notice is preserved.
index 77989192dcd34521dd98e244a00760845aa8a03b..6701f0a76c1485c89119289a1a45f828d810d7ad 100644 (file)
@@ -1,5 +1,5 @@
 # ftell.m4 serial 3
-dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index 3825cf2d0f634a5d784e08cc34a61a346b00c9cb..3f4808bf372c50c14f3a9c0594a5b5742bf91fc2 100644 (file)
@@ -1,5 +1,5 @@
 # ftello.m4 serial 11
-dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index fcc74ff2c2191eef7f2ef259e1144bfd91c697bc..f537b157dd7422a384870657f67c8b9b623c3b1d 100644 (file)
@@ -1,5 +1,5 @@
 # func.m4 serial 2
-dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index af9b1faa9acd831b512932f2e1b287ccc88d183d..a1a7dcc52616b96361c2e5fb825bf2be381d56c0 100644 (file)
@@ -1,6 +1,6 @@
-# getdelim.m4 serial 10
+# getdelim.m4 serial 11
 
-dnl Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
 dnl
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -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.
index a35f3a295bce56ce9eda56114a1fb92bc7b695fc..f44751cd4b8b966541729aa0b6b9f0fc1289c3c4 100644 (file)
@@ -1,6 +1,6 @@
-# getline.m4 serial 26
+# getline.m4 serial 27
 
-dnl Copyright (C) 1998-2003, 2005-2007, 2009-2015 Free Software Foundation,
+dnl Copyright (C) 1998-2003, 2005-2007, 2009-2016 Free Software Foundation,
 dnl Inc.
 dnl
 dnl This file is free software; the Free Software Foundation
@@ -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.
index 7057a21d0f74c41d7a6b79018ee578d5b4eb1857..8902b7b56bf9b9996f60195f169099a38f677fc0 100644 (file)
@@ -1,5 +1,5 @@
 # getpagesize.m4 serial 9
-dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2015 Free Software Foundation,
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2016 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index ce246e18bc2b7d452c19d56818f4527abd7f07f1..4ae5d63fe3e6e4c77f7299caa1a0fec9fc2fb695 100644 (file)
@@ -1,6 +1,6 @@
 # serial 21
 
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2015 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
index 1a0d96067f3021a1210f78be420abf3de5ab8259..ba1b6fb8a4aeb45d69278cd270ed56e6d6823d3e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2015 Free Software Foundation, Inc.
+# Copyright (C) 2002-2016 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files --lgpl=2 alloca byteswap c-ctype extensions func gendocs getline gettext-h gettimeofday hash-pjw-bare havelib iconv intprops lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file snprintf stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r unistd valgrind-tests vasprintf vsnprintf warnings
+#   gnulib-tool --import --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files --lgpl=2 alloca byteswap c-ctype extensions func gendocs getline gettext-h gettimeofday hash-pjw-bare havelib iconv intprops lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file secure_getenv snprintf stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r unistd valgrind-tests vasprintf vsnprintf warnings
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gl/override])
@@ -56,6 +56,7 @@ gl_MODULES([
   netinet_in
   pmccabe2html
   read-file
+  secure_getenv
   snprintf
   stdint
   strcase
index 40e82f6e27fff92db63f693abdab53c22e2b4f27..f8454c8a0149ddcf1b74c5d8877bfb6c32aadf46 100644 (file)
@@ -1,5 +1,5 @@
 # gnulib-common.m4 serial 36
-dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
@@ -253,9 +253,10 @@ AC_DEFUN([gl_PROG_AR_RANLIB],
 [
   dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
   dnl as "cc", and GCC as "gcc". They have different object file formats and
-  dnl library formats. In particular, the GNU binutils programs ar, ranlib
+  dnl library formats. In particular, the GNU binutils programs ar and ranlib
   dnl produce libraries that work only with gcc, not with cc.
   AC_REQUIRE([AC_PROG_CC])
+  AC_BEFORE([$0], [AM_PROG_AR])
   AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
     [
       AC_EGREP_CPP([Amsterdam],
@@ -267,25 +268,37 @@ Amsterdam
         [gl_cv_c_amsterdam_compiler=yes],
         [gl_cv_c_amsterdam_compiler=no])
     ])
-  if test -z "$AR"; then
-    if test $gl_cv_c_amsterdam_compiler = yes; then
+
+  dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not
+  dnl building with __ACK__.
+  if test $gl_cv_c_amsterdam_compiler = yes; then
+    if test -z "$AR"; then
       AR='cc -c.a'
-      if test -z "$ARFLAGS"; then
-        ARFLAGS='-o'
-      fi
-    else
-      dnl Use the Automake-documented default values for AR and ARFLAGS,
-      dnl but prefer ${host}-ar over ar (useful for cross-compiling).
-      AC_CHECK_TOOL([AR], [ar], [ar])
-      if test -z "$ARFLAGS"; then
-        ARFLAGS='cr'
-      fi
     fi
-  else
     if test -z "$ARFLAGS"; then
-      ARFLAGS='cr'
+      ARFLAGS='-o'
     fi
+  else
+    dnl AM_PROG_AR was added in automake v1.11.2.  AM_PROG_AR does not AC_SUBST
+    dnl ARFLAGS variable (it is filed into Makefile.in directly by automake
+    dnl script on-demand, if not specified by ./configure of course).
+    dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above
+    dnl will be ignored.  Also, pay attention to call AM_PROG_AR in else block
+    dnl because AM_PROG_AR is written so it could re-set AR variable even for
+    dnl __ACK__.  It may seem like its easier to avoid calling the macro here,
+    dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
+    dnl default value and automake should usually know them).
+    m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:])
+  fi
+
+  dnl In case the code above has not helped with setting AR/ARFLAGS, use
+  dnl Automake-documented default values for AR and ARFLAGS, but prefer
+  dnl ${host}-ar over ar (useful for cross-compiling).
+  AC_CHECK_TOOL([AR], [ar], [ar])
+  if test -z "$ARFLAGS"; then
+    ARFLAGS='cr'
   fi
+
   AC_SUBST([AR])
   AC_SUBST([ARFLAGS])
   if test -z "$RANLIB"; then
index b5977951dfa65f6106faea0b132faad1a23eeeab..b4d6dff73941e2c631d062f4a09ec2aa9a0dcef8 100644 (file)
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2015 Free Software Foundation, Inc.
+# Copyright (C) 2002-2016 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,7 +37,11 @@ AC_DEFUN([gl_EARLY],
   m4_pattern_allow([^gl_ES$])dnl a valid locale name
   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+
+  # Pre-early section.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_REQUIRE([gl_PROG_AR_RANLIB])
+
   # Code from module absolute-header:
   # Code from module alloca:
   # Code from module alloca-opt:
@@ -48,10 +52,11 @@ AC_DEFUN([gl_EARLY],
   # Code from module byteswap-tests:
   # Code from module c-ctype:
   # Code from module c-ctype-tests:
+  # Code from module ctype:
+  # Code from module ctype-tests:
   # Code from module errno:
   # Code from module errno-tests:
   # Code from module extensions:
-  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   # Code from module extern-inline:
   # Code from module fcntl-h:
   # Code from module fcntl-h-tests:
@@ -118,6 +123,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module read-file:
   # Code from module read-file-tests:
   # Code from module realloc-posix:
+  # Code from module secure_getenv:
   # Code from module size_max:
   # Code from module snippet/_Noreturn:
   # Code from module snippet/arg-nonnull:
@@ -293,11 +299,11 @@ AC_SUBST([LTALLOCA])
   fi
   gl_STRING_MODULE_INDICATOR([memmem])
   gl_MINMAX
-  gl_MSVC_INVAL
+  AC_REQUIRE([gl_MSVC_INVAL])
   if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
     AC_LIBOBJ([msvc-inval])
   fi
-  gl_MSVC_NOTHROW
+  AC_REQUIRE([gl_MSVC_NOTHROW])
   if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
     AC_LIBOBJ([msvc-nothrow])
   fi
@@ -312,6 +318,12 @@ AC_SUBST([LTALLOCA])
     AC_LIBOBJ([realloc])
   fi
   gl_STDLIB_MODULE_INDICATOR([realloc-posix])
+  gl_FUNC_SECURE_GETENV
+  if test $HAVE_SECURE_GETENV = 0; then
+    AC_LIBOBJ([secure_getenv])
+    gl_PREREQ_SECURE_GETENV
+  fi
+  gl_STDLIB_MODULE_INDICATOR([secure_getenv])
   gl_SIZE_MAX
   gl_FUNC_SNPRINTF
   gl_STDIO_MODULE_INDICATOR([snprintf])
@@ -433,6 +445,7 @@ changequote([, ])dnl
   AC_SUBST([gltests_WITNESS])
   gl_module_indicator_condition=$gltests_WITNESS
   m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+  gl_CTYPE_H
   gl_FCNTL_H
   gl_FUNC_FDOPEN
   if test $REPLACE_FDOPEN = 1; then
@@ -608,6 +621,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/read-file.c
   lib/read-file.h
   lib/realloc.c
+  lib/secure_getenv.c
   lib/size_max.h
   lib/snprintf.c
   lib/stdalign.in.h
@@ -648,6 +662,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/absolute-header.m4
   m4/alloca.m4
   m4/byteswap.m4
+  m4/ctype.m4
   m4/errno_h.m4
   m4/exponentd.m4
   m4/extensions.m4
@@ -697,6 +712,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/printf.m4
   m4/read-file.m4
   m4/realloc.m4
+  m4/secure_getenv.m4
   m4/size_max.m4
   m4/snprintf.m4
   m4/socklen.m4
@@ -743,6 +759,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-binary-io.sh
   tests/test-byteswap.c
   tests/test-c-ctype.c
+  tests/test-ctype.c
   tests/test-errno.c
   tests/test-fcntl-h.c
   tests/test-fdopen.c
@@ -804,6 +821,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/zerosize-ptr.h
   tests=lib/binary-io.c
   tests=lib/binary-io.h
+  tests=lib/ctype.in.h
   tests=lib/fcntl.in.h
   tests=lib/fdopen.c
   tests=lib/fpucw.h
index fede1fc3bd1f08ab8e174ca8ce139e8f1f536219..0d2ee444b4fbfb890176b9a69c397b628fe71f16 100644 (file)
@@ -1,5 +1,5 @@
 # gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 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,
 dnl with or without modifications, as long as this notice is preserved.
index 233d254e808ded18d19b5c6937bcea8fac95608c..db0f2c0795cfac3ec2c8b932d4e6dbccc3c0bb27 100644 (file)
@@ -1,5 +1,5 @@
 # include_next.m4 serial 23
-dnl Copyright (C) 2006-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
index 4bd8155c83d5151fe2860f51565a548d9bc9fc93..9559accabf74509a129cfcaf375afd544f10052a 100644 (file)
@@ -1,5 +1,5 @@
 # intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2015 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2016 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 0884e71e6722a59e00a160afa58127b7f1086390..ae20183db428379fbe31b291f88ca3313429f3d1 100644 (file)
@@ -1,5 +1,5 @@
 # inttypes-pri.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1997-2002, 2006, 2008-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2002, 2006, 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,
 dnl with or without modifications, as long as this notice is preserved.
index 4209ffd150926f10e6d5b5541f20f4002fd20dc6..61cdb1a8483ef2adb19e3b94b570d93c51b3ffdd 100644 (file)
@@ -1,5 +1,5 @@
 # inttypes.m4 serial 26
-dnl Copyright (C) 2006-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
index d0b5f5d98298824228a36d63943c26c4733c3672..76571199f366b99b5e4a4c44b5b3183e74c5ded0 100644 (file)
@@ -1,5 +1,5 @@
 # inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 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,
 dnl with or without modifications, as long as this notice is preserved.
index b7a6c48b68020f876a2fbaee3ecf2197421dc8c2..8bbdfaac1dbf8b7bda345d7c72149fece4a61107 100644 (file)
@@ -1,6 +1,6 @@
 # Enable large files on systems where this is not the default.
 
-# Copyright 1992-1996, 1998-2015 Free Software Foundation, Inc.
+# Copyright 1992-1996, 1998-2016 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
index c505ab2a2ec6f5179a4c3e1437098063216bbf8e..040a04fc0265b326579fb0eb621971d09c1bfdcf 100644 (file)
@@ -1,5 +1,5 @@
 # ld-output-def.m4 serial 2
-dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index 211d67b96364d949662d8e5065fe791ab52bebf3..330c2ccf09fae8597fcb0553a2afefdeb9b4527c 100644 (file)
@@ -1,5 +1,5 @@
 # ld-version-script.m4 serial 4
-dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index 91ca9117098c5b50974fad2350c79d6d326796c1..6209de65d964341ed03575212bedb6807a227729 100644 (file)
@@ -1,5 +1,5 @@
 # lib-ld.m4 serial 6
-dnl Copyright (C) 1996-2003, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 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,
 dnl with or without modifications, as long as this notice is preserved.
index d8d5d1f0e12092ce60a31b8338ef18f7a4c4a014..2f518553bc4a30a04c468216f427d45ce46caf8e 100644 (file)
@@ -1,5 +1,5 @@
 # lib-link.m4 serial 26 (gettext-0.18.2)
-dnl Copyright (C) 2001-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index 0465f477c0498d8a85224bc7fc3f5a46aac291ca..6851031d3913feb62dda2184793969a01bb09b51 100644 (file)
@@ -1,5 +1,5 @@
 # lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 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,
 dnl with or without modifications, as long as this notice is preserved.
index d57bc700d4f5c5bacbc6bda57798073913c93c9e..36d8b12421266e7fe5d4d34f52fddf272712b11b 100644 (file)
@@ -1,5 +1,5 @@
 # longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-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,
 dnl with or without modifications, as long as this notice is preserved.
index f337abf1a86b680cb2c6ed8d083c8c6c0f2d55bb..4a954400730df04a198c69f843519b5fa187da1d 100644 (file)
@@ -1,5 +1,5 @@
 # lseek.m4 serial 10
-dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index 31368ab97fbc790d2b269a667e112002fcad129d..c393690e27d95917afb601352af3d3b0dfbb86ce 100644 (file)
@@ -1,13 +1,13 @@
-# malloc.m4 serial 14
-dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+# 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,
 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],
index b4e38d94463183d8626dd59d74506c138c027cff..90823b0acf4145236941f88a35f39274d4b81a39 100644 (file)
@@ -1,5 +1,5 @@
-# manywarnings.m4 serial 7
-dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
+# 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,
 dnl with or without modifications, as long as this notice is preserved.
@@ -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
index 7d0f58346b787f664ded1124ff4efdee42187de6..35d07ee5f54d094855d0c1ff3de9ac801704d723 100644 (file)
@@ -1,5 +1,5 @@
 # math_h.m4 serial 114
-dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index cb958d86268913758b1f1f2bb2560b1cabfa6b01..25d32f0ec99966f29cc0157bbf600c01fe640129 100644 (file)
@@ -1,5 +1,5 @@
 # memchr.m4 serial 12
-dnl Copyright (C) 2002-2004, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 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,
 dnl with or without modifications, as long as this notice is preserved.
index b190a7cb9bcfa696718855ca7c7084a38d454a20..981ede76b40a473f60421cf91f02e8ed5413bb92 100644 (file)
@@ -1,5 +1,5 @@
 # memmem.m4 serial 24
-dnl Copyright (C) 2002-2004, 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index 0df832c8337e539f3e005661d077374d1738221a..9c43e6452c6a4dc9d24e0a1cdc5f3ea760934526 100644 (file)
@@ -1,5 +1,5 @@
 # minmax.m4 serial 4
-dnl Copyright (C) 2005, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 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,
 dnl with or without modifications, as long as this notice is preserved.
index 92a88d05fb0fe1dffc21c81ca4f876a0a65151c8..853c89dc9b5a32ff7dbf906de3317017dd0cf594 100644 (file)
@@ -1,5 +1,5 @@
 # mmap-anon.m4 serial 10
-dnl Copyright (C) 2005, 2007, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 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,
 dnl with or without modifications, as long as this notice is preserved.
index 9446fa585010885bf6d9806a2f20b2cb77605ebc..f5e4c89309ed91f4c544e316710162f7743819da 100644 (file)
@@ -1,5 +1,5 @@
 # msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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,
 dnl with or without modifications, as long as this notice is preserved.
index 5d72a042da6dbaaff2c104bfad9ac73c51038812..58f5c0bc205234e1363ff7da6ae11a447c60e624 100644 (file)
@@ -1,5 +1,5 @@
 # msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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,
 dnl with or without modifications, as long as this notice is preserved.
index fc575c1d43739153c89d05f32ec69eeaa32bf485..43b5d057508bd0c498eb21f92ac8504f32840f45 100644 (file)
@@ -1,5 +1,5 @@
 # multiarch.m4 serial 7
-dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index fce208014c340dff5143fa87c621c99c33480da6..4e5206cebe28a6abbdf9f1360a1dd38fd2bc115a 100644 (file)
@@ -1,5 +1,5 @@
 # netdb_h.m4 serial 11
-dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index 42ac0084424528b8f878175c9f513e7d25faf01d..93dcc689478239645f8622b91e45bfeddabe2af9 100644 (file)
@@ -1,5 +1,5 @@
 # netinet_in_h.m4 serial 5
-dnl Copyright (C) 2006-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
index 0eb14678be143389a8934a205958684deb5e0769..282751b47b430203446acfca657bb4d422218749 100644 (file)
@@ -1,5 +1,5 @@
 # off_t.m4 serial 1
-dnl Copyright (C) 2012-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-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,
 dnl with or without modifications, as long as this notice is preserved.
index d06746aae78f872a63d5c1dbfed3a4ac996ef92a..e495e0cbc58d5551f258e2c0b0e453c05b30327c 100644 (file)
@@ -1,5 +1,5 @@
 # printf.m4 serial 52
-dnl Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index 67e50bd1e04664376a2ffb815ec906d1c9150433..aa23b5840c3d03a090b04d0c40808e25f69d32d3 100644 (file)
@@ -1,5 +1,5 @@
 # read-file.m4 serial 3
-dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 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,
 dnl with or without modifications, as long as this notice is preserved.
index 0e1d3386e70eb0ee1447111e774d83eb82cea6a3..fc2282544dd9dcef3d9f5e661f032adc50e4fd57 100644 (file)
@@ -1,13 +1,13 @@
-# realloc.m4 serial 13
-dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+# 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,
 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/secure_getenv.m4 b/gl/m4/secure_getenv.m4
new file mode 100644 (file)
index 0000000..00194c8
--- /dev/null
@@ -0,0 +1,25 @@
+# Look up an environment variable more securely.
+dnl Copyright 2013-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,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SECURE_GETENV],
+[
+  dnl Persuade glibc <stdlib.h> to declare secure_getenv().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([secure_getenv])
+  if test $ac_cv_func_secure_getenv = no; then
+    HAVE_SECURE_GETENV=0
+  fi
+])
+
+# Prerequisites of lib/secure_getenv.c.
+AC_DEFUN([gl_PREREQ_SECURE_GETENV], [
+  AC_CHECK_FUNCS([__secure_getenv])
+  if test $ac_cv_func___secure_getenv = no; then
+    AC_CHECK_FUNCS([issetugid])
+  fi
+])
index 186e3fddabf374042cb0955d29408ec49409c2f0..de69025d62b6cbfa1525f1eecd417ef35dd941fb 100644 (file)
@@ -1,5 +1,5 @@
 # size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 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,
 dnl with or without modifications, as long as this notice is preserved.
index 8ae70050c8e5e8344e1c6c08c97114148fb423cb..f876b559959c00e59b0e23240865ad989bccef94 100644 (file)
@@ -1,5 +1,5 @@
 # snprintf.m4 serial 6
-dnl Copyright (C) 2002-2004, 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index bcabed3ef0f9c35acee35c2cfe9a156fbf87cf72..634c43a35c1a5b34ee461541d394ac1532420b6a 100644 (file)
@@ -1,5 +1,5 @@
 # socklen.m4 serial 10
-dnl Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 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,
 dnl with or without modifications, as long as this notice is preserved.
index 50eb7619da97a25737d5a10cd71ea5f4902d4cc9..dce8b8f01e3af1f02bae12b9571f33f86abf40c5 100644 (file)
@@ -1,5 +1,5 @@
 # sockpfaf.m4 serial 8
-dnl Copyright (C) 2004, 2006, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 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,
 dnl with or without modifications, as long as this notice is preserved.
index 25bd45143438219b005f5643c6ba793d58660708..3e7b9e6e024036b08a8f1c74e5c71ef755aeb579 100644 (file)
@@ -1,5 +1,5 @@
 # ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-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,
 dnl with or without modifications, as long as this notice is preserved.
index 033b0d39e4ad60c257613ebc116835b77aa5d7c1..49980cd636e289b858d809c5498bf23c9bee0e54 100644 (file)
@@ -1,6 +1,6 @@
 # Check for stdalign.h that conforms to C11.
 
-dnl Copyright 2011-2015 Free Software Foundation, Inc.
+dnl Copyright 2011-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,
 dnl with or without modifications, as long as this notice is preserved.
index 7273b8224658daca8ddfa4dd7ea39400d3d7185e..625520ff078bbe1ae4c3c93a546d9f14abedfdb9 100644 (file)
@@ -1,6 +1,6 @@
 # Check for stdbool.h that conforms to C99.
 
-dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 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,
 dnl with or without modifications, as long as this notice is preserved.
index 231050274adec7b2ec70e76775c3739b3166d0bf..c045c65f9f845682c0f6f02a6f277cb5c986f7be 100644 (file)
@@ -1,6 +1,6 @@
 dnl A placeholder for <stddef.h>, for platforms that have issues.
 # stddef_h.m4 serial 5
-dnl Copyright (C) 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 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,
 dnl with or without modifications, as long as this notice is preserved.
index 4011a4942a1abe3dc7ff22642e709b32443f13e1..0b4b9060dbbb48c599a0dc33326db10ebcde7e02 100644 (file)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 43
-dnl Copyright (C) 2001-2015 Free Software Foundation, Inc.
+# 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,
 dnl with or without modifications, as long as this notice is preserved.
@@ -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
index 5097c0b0dcbd73c847e43543d8e0848111e140a2..f823b94c338ea6dc802e7ac8373988e900f681da 100644 (file)
@@ -1,5 +1,5 @@
 # stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 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,
 dnl with or without modifications, as long as this notice is preserved.
index f60cc2156e00cccbbc135fd4cc3e1d4b63be3fba..0e387585d27fd9080da7380c91570c8cb7de6c55 100644 (file)
@@ -1,5 +1,5 @@
 # stdio_h.m4 serial 46
-dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index 0b4c623ec714087a76c62302080e87b7a30a4c79..19107c4199631631d193f34b5d69eff5548360a6 100644 (file)
@@ -1,5 +1,5 @@
 # stdlib_h.m4 serial 42
-dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index ece6722aff7062bc736cbdbc42691396ba8c7f3a..eefc047f7fd1135348719ce80a2e7034584c6584 100644 (file)
@@ -1,5 +1,5 @@
 # strcase.m4 serial 11
-dnl Copyright (C) 2002, 2005-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-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,
 dnl with or without modifications, as long as this notice is preserved.
index 55d09ef407800fd5c591aeec58e7494673f983c5..0c5ec6f9a09e3b5028e9c5a06f4f3641a4e27f5a 100644 (file)
@@ -1,6 +1,6 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2015 Free Software Foundation, Inc.
+# Copyright (C) 2007-2016 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
index 28b754b6ef31608120f30a0493860705ae5736e7..62a62e20b34986312184b5d037dad69a23e721b5 100644 (file)
@@ -1,7 +1,7 @@
 # Configure a replacement for <strings.h>.
 # serial 6
 
-# Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
index e6e2300dec866f7180eee794611e849cd715827c..ac48a228f42f95a6b79a973156a33aaacbfc173c 100644 (file)
@@ -1,5 +1,5 @@
-# strndup.m4 serial 21
-dnl Copyright (C) 2002-2003, 2005-2015 Free Software Foundation, Inc.
+# strndup.m4 serial 22
+dnl Copyright (C) 2002-2003, 2005-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,
 dnl with or without modifications, as long as this notice is preserved.
@@ -31,11 +31,14 @@ AC_DEFUN([gl_FUNC_STRNDUP],
   #endif
   char *strndup (const char *, size_t);
 #endif
+  int result;
   char *s;
   s = strndup ("some longer string", 15);
   free (s);
   s = strndup ("shorter string", 13);
-  return s[13] != '\0';]])],
+  result = s[13] != '\0';
+  free (s);
+  return result;]])],
          [gl_cv_func_strndup_works=yes],
          [gl_cv_func_strndup_works=no],
          [
index 5f85d3fa7dd46254fc6d9a00cd384b180478f837..67b38597a84701c79bcb743ecfd4ff6348fde04c 100644 (file)
@@ -1,5 +1,5 @@
 # strnlen.m4 serial 13
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2015 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 9ed6a25c91bb05bf995c5508b74c9eecb40e9f61..d010307bbc80171a8c8872740e8667cf1d5062d4 100644 (file)
@@ -1,5 +1,5 @@
 # strtok_r.m4 serial 13
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2015 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index c6c17d160b76949b14885a516bf763213d7a9a34..5524294c2ebd167220c981962195bdf67b9ee1c2 100644 (file)
@@ -1,5 +1,5 @@
 # strverscmp.m4 serial 8
-dnl Copyright (C) 2002, 2005-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-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,
 dnl with or without modifications, as long as this notice is preserved.
index eaeabe7d966ea969fceed76f2a3afbcb2dca091f..ae500c76053040a3985d5d835fd54299264aff0a 100644 (file)
@@ -1,5 +1,5 @@
 # sys_socket_h.m4 serial 23
-dnl Copyright (C) 2005-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-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,
 dnl with or without modifications, as long as this notice is preserved.
index 6c909e816a7444f62d8ce81c8da9bff886f27018..3d43b6f5ef24c48e6646026c63c2f69e0fb95471 100644 (file)
@@ -1,5 +1,5 @@
 # sys_stat_h.m4 serial 28   -*- Autoconf -*-
-dnl Copyright (C) 2006-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
index 28c8b1acbbaca7341f0de92fec1c26d0b90cdbdd..3061a9c185f9f919822d462d8de214cc3a051703 100644 (file)
@@ -1,7 +1,7 @@
 # Configure a replacement for <sys/time.h>.
 # serial 8
 
-# Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
index 2232aece63ec0f4d42469f3885ea211f8ff9d51b..b0aabb4786228ca39fa7685398442264c4434ccf 100644 (file)
@@ -1,5 +1,5 @@
 # sys_types_h.m4 serial 5
-dnl Copyright (C) 2011-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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,
 dnl with or without modifications, as long as this notice is preserved.
index 3dfbcbe6e6c5ebd96f8670825d05089a69b3b430..d4d967fd57687121d62360a7beea329e7abb6233 100644 (file)
@@ -1,5 +1,5 @@
 # sys_uio_h.m4 serial 1
-dnl Copyright (C) 2011-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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,
 dnl with or without modifications, as long as this notice is preserved.
index 754b469a0d9c2b7cc20e7f19cc330491720d8dbb..eb2a631e2cebcb3ef5c276088ef701c1ab149e80 100644 (file)
@@ -1,6 +1,6 @@
 # Configure a more-standard replacement for <time.h>.
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2015 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
 
 # serial 9
 
index 8df7e139cf2efa043b12f8726cf7dbb65375917e..21b4a2cc18e4e1e6e93b1660ca4835e9aa3842a9 100644 (file)
@@ -1,6 +1,6 @@
 dnl Reentrant time functions: localtime_r, gmtime_r.
 
-dnl Copyright (C) 2003, 2006-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
index 2a34b3019f5ae196d130ffea3bb9f030d07dfdd0..e5d10eb9ffc450fbaaa891628145b87691e0db1f 100644 (file)
@@ -1,5 +1,5 @@
 # ungetc.m4 serial 3
-dnl Copyright (C) 2009-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 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,
 dnl with or without modifications, as long as this notice is preserved.
index b3c581f7b25e6efc72480e758356f2c39b02e2c1..544dadb4122ff3c21f005b786b85b51f1f51ca4e 100644 (file)
@@ -1,5 +1,5 @@
 # unistd_h.m4 serial 68
-dnl Copyright (C) 2006-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
index 19601e002c1a30bda7f0533c23f39b18df0a00c7..b80bda60bc71635975e1b7a62b0c36f162653d13 100644 (file)
@@ -1,5 +1,5 @@
 # valgrind-tests.m4 serial 3
-dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index 4708f2b8e296b5f89662265ff55c05dd0fc0dc7e..2d4b46310b437d1035fd7d678507c4de12e31ac2 100644 (file)
@@ -1,5 +1,5 @@
 # vasnprintf.m4 serial 36
-dnl Copyright (C) 2002-2004, 2006-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
index b785dc328990d1904248ff3e5b5b8ff6d2e4ba85..d7866b1929d1ace656387f98e63483cb94afc1e8 100644 (file)
@@ -1,5 +1,5 @@
 # vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2015 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2016 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 28be6fd18622f40dd778ffc4a10af5f339dc9183..e056f05cd572286d245bad1e5dc53da311088e2c 100644 (file)
@@ -1,5 +1,5 @@
 # vsnprintf.m4 serial 6
-dnl Copyright (C) 2002-2004, 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index 1e98dc9b77512ecd0b479afdf7516397ad0616cc..08440ec593b129d02c82edd945fa9a0681678ce3 100644 (file)
@@ -1,5 +1,5 @@
 # warn-on-use.m4 serial 5
-dnl Copyright (C) 2010-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-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,
 dnl with or without modifications, as long as this notice is preserved.
index 5ae01def133fb451019e908a8056aff7b4988e7e..924e21d5e876ded7f5830745239cf4b52a88475e 100644 (file)
@@ -1,5 +1,5 @@
 # warnings.m4 serial 11
-dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
+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,
 dnl with or without modifications, as long as this notice is preserved.
index 9d1b0f8b6d2f51f63c7caac9285b5ce626f610d8..b40b73237d5f16bb12b1f9f4fb573e2e7811a1cd 100644 (file)
@@ -1,6 +1,6 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index dc964e67e261d0166afb14b4dcb45872d6b114fd..2db8c3f2f629af7fdb27b85efa469cea7d9cb516 100644 (file)
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 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,
 dnl with or without modifications, as long as this notice is preserved.
index ca3fd449a14ec3127a14070cbdb76b8db44225e7..8ff2a5b5a28023c5894592d245f551bfb9663cd9 100644 (file)
@@ -1,5 +1,5 @@
 # wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-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,
 dnl with or without modifications, as long as this notice is preserved.
index 98faf7de0b27391e10c9dd6a792f46457f84f6e3..16764e89ddcdc8200362e25fb1f081c555560b4e 100644 (file)
@@ -1,5 +1,5 @@
 # xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2015 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 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,
 dnl with or without modifications, as long as this notice is preserved.
index e1c1880c4774069227cde796a8765c96f3f857db..ce1e6869d9d8023c1ac7ae76a82f1280b089b93c 100644 (file)
@@ -1,6 +1,6 @@
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997-1998, 2006-2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 5be1bb7afd0a1b866660e88efba44e1ae6b91740..4865cb8c77a13b12e800d05def78372fc5b6f497 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2015
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2016
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
index 658b165e4e9f820b8d1436d0ba4efb9a46c0d8b6..407af7e31723eb159886e2335e4398b3818a9747 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2015 Free Software
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2016 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
index 0d87ef3d4b5aabe56521b1991cb9dc350b97bfdd..971bd38a342734317fc7ef105a89a3047cb56e3b 100644 (file)
@@ -1,5 +1,5 @@
 /* MIN, MAX macros.
-   Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2015 Free Software
+   Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2016 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
index acec415288bae3f76ed48ae4ae67063e4b2e64e1..add72b0ca5d1111178d536a74dac05de1fc69cf3 100644 (file)
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 544283c9bc82e64acba03706b4e616b72dd00645..e2bc97787b0fde26a70e5ac5cca327e3581ddd36 100644 (file)
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index dc8f6e091efc63f94aabdd83508f6161566080a1..d36b1e0b93b6914d8e404ab81f813777b82a5ce8 100644 (file)
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index c75799c5b6940452b0e084728911f5f058fa56e7..7dc914b0c36ffde2777504a9809430c1aa601715 100644 (file)
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index fe269a4c8eb26fd8e87e0a277290f7e1f5a02647..055925928e17f9c1a592117f23d1eddaf1b7d863 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide a netdb.h header file for systems lacking it (read: MinGW).
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-2016 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
index 1a87ce7b55c92c7e96b21cbeed8f567d0c72b5ae..4411af3cf82356f1247bcd31435f45bf8da22cfc 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for <netinet/in.h>.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 4475d60ec148ece37acaee6e87b00b8bd8240c75..aabe48349c1a63946d075ef484f5cb9644510eea 100644 (file)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2015 Free Software
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2016 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
index 7363ccc18f69a05b86e5744e4de0e8a3076ed570..f58bf0864ccdbaced2f29eaf5bba415e2ee863f7 100644 (file)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2015 Free Software
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2016 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
index ab21cfdb5fa94c1878b26b1802ab2d702f0b8e1c..7c14a6ddc53fe3028c42e0a423040394d3e9a70d 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2015 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 366266020ea19a01646323541e95283929ca4872..887cde4eb3108220a347793ed5d519ad0fe7567c 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2015 Free Software
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2016 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
index a64838011565d89fee0364d269b0c047e0a479f9..56d6c72c0ff030ad1e36559148d1d397624a6e76 100644 (file)
@@ -1,5 +1,5 @@
 /* read-file.c -- read file contents into a string
-   Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
    Written by Simon Josefsson and Bruno Haible.
 
    This program is free software; you can redistribute it and/or modify
index 165583c80bcac6fc0ae62d37041c08585cd7c164..078be42078c44cccbc5813ba69c39c95b885543c 100644 (file)
@@ -1,5 +1,5 @@
 /* read-file.h -- read file contents into a string
-   Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
index d9774861b08034e61be39986cfa43c9b2d91ee19..5653e7ae89ed5c0ebb859b2aa442e259c199fe83 100644 (file)
@@ -1,6 +1,6 @@
 /* realloc() function that is glibc compatible.
 
-   Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2015 Free Software
+   Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2016 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/gl/secure_getenv.c b/gl/secure_getenv.c
new file mode 100644 (file)
index 0000000..896ceee
--- /dev/null
@@ -0,0 +1,41 @@
+/* Look up an environment variable more securely.
+
+   Copyright 2013-2016 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published
+   by the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#if !HAVE___SECURE_GETENV
+# if HAVE_ISSETUGID
+#  include <unistd.h>
+# else
+#  undef issetugid
+#  define issetugid() 1
+# endif
+#endif
+
+char *
+secure_getenv (char const *name)
+{
+#if HAVE___SECURE_GETENV
+  return __secure_getenv (name);
+#else
+  if (issetugid ())
+    return 0;
+  return getenv (name);
+#endif
+}
index b7a99a580dcbb5fc2e94dfcd29b78fb0fe8ea172..5e89e69be458b46665f2576ae91cd71cf5bb5f61 100644 (file)
@@ -1,5 +1,5 @@
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
index bccb6521caac7fb8f2ee320e0ce9843e9984a158..070485b0dbdc5d1e16d7a86e93ec331d705d09ae 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2015 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2016 Free Software Foundation, Inc.
    Written by Simon Josefsson and Paul Eggert.
 
    This program is free software; you can redistribute it and/or modify
index 39873a7d294c51e6f115e0d52d5c4a4fa8eb127c..9aac795a9e24d308e87e7e82aff576cc7ea069c3 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C11 <stdalign.h>.
 
-   Copyright 2011-2015 Free Software Foundation, Inc.
+   Copyright 2011-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 #undef _Alignas
 #undef _Alignof
 
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+/* GCC releases before GCC 4.9 had a bug in _Alignof.  See GCC bug 52023
+   <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.  */
+#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+     || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9)))
 # ifdef __cplusplus
 #  if 201103 <= __cplusplus
 #   define _Alignof(type) alignof (type)
@@ -64,7 +67,9 @@
 #  define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
 # endif
 #endif
-#define alignof _Alignof
+#if ! (defined __cplusplus && 201103 <= __cplusplus)
+# define alignof _Alignof
+#endif
 #define __alignof_is_defined 1
 
 /* alignas (A), also known as _Alignas (A), aligns a variable or type
 # elif ((defined __APPLE__ && defined __MACH__                  \
          ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__)                 \
          : __GNUC__)                                            \
-        || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__        \
-        || __ICC || 0x5110 <= __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 __STDC_VERSION && 201112 <= __STDC_VERSION__)
+#if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \
+     || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
 # define alignas _Alignas
+#endif
+#if defined alignas || (defined __cplusplus && 201103 <= __cplusplus)
 # define __alignas_is_defined 1
 #endif
 
index 2bd9ec02796d209b421797be19f8b42261041dc0..25a76d37b92be6ef26aa96d09f860f709d240d52 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2016 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
index 5398faf78b24ac498ce2fd1cef7ef5efc61286bb..a400474bd1a8d27cc5e0a72986afdf92d7ccc1f1 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2009-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 # 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
index 6608d5fe0849bf927841fec2ade7ac6245aec5e9..35a41bb7d72bdad329f7b720595d88786da875e1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2016 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
    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 */
 
index bf6e7c828bcf70ef99a5fb3acf72de6560f31909..4c02c9f614ba3e0fec07a52b28e0cca921a5c641 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation details of FILE streams.
-   Copyright (C) 2007-2008, 2010-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008, 2010-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 5ba9413269ee893b3fd523d4f7b174322cdc1395..8db24a8fc56b2df85a87c92ef3b7479aff47a6b9 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 2a09628f65c6571f59b05556b87d106a20148a52..ab0b614f6ce49134e3a962e8b9c1a7d106818221 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2015 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 0d59e9bf77065e0af9cd083bd3f3838f7f222b5b..43b5a7e2b6a7201974ac194d5fc6ac62a79cedda 100644 (file)
@@ -1,5 +1,5 @@
 /* Byte-wise substring search, using the Two-Way algorithm.
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Eric Blake <ebb9@byu.net>, 2008.
 
index 4f994bff74f0f392f4a01b4af6cf6b78ce65c43c..1c3fabc76dd4700fe773fad42b8525cade65bdd6 100644 (file)
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison function.
-   Copyright (C) 1998-1999, 2005-2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2007, 2009-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 47e11883ece98cb85516cccef87c9a0043d36597..c6f610d207cb4ab4fb3da1ca47c55de92589ec3a 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2015 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 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 Lesser General Public License as published by
index ee43813ed636227217103ff9dc52c1b1be31c977..7d93355650c12bceff6207866b34eceb7f234f04 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute <strings.h>.
 
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index dda3a3dcf760be50cf1aacc9b1b2e1123c06329e..d9f22533ed1e31d92cddaaea58fc7422c0225be3 100644 (file)
@@ -1,5 +1,5 @@
 /* strncasecmp.c -- case insensitive string comparator
-   Copyright (C) 1998-1999, 2005-2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2007, 2009-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 058137ae43ff2f6c787947a00ca91759f5873c99..2d7fd400a33e01b0532eecc7b6a8d13554b151bc 100644 (file)
@@ -1,6 +1,6 @@
 /* A replacement function, for systems that lack strndup.
 
-   Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2015 Free Software
+   Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2016 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
index 032ba55097a78645ad67aa70405973cce8c85307..3a7492e6e24f26b8b2913983b61ce50f9e77a513 100644 (file)
@@ -1,5 +1,5 @@
 /* Find the length of STRING, but scan at most MAXLEN characters.
-   Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
index 6e3cb766148ccd168a19c3727236f4820d06d698..9cae5c61a694f5b5ecdde6d82013afbbbea427f5 100644 (file)
@@ -1,5 +1,5 @@
 /* Reentrant string tokenizer.  Generic version.
-   Copyright (C) 1991, 1996-1999, 2001, 2004, 2007, 2009-2015 Free Software
+   Copyright (C) 1991, 1996-1999, 2001, 2004, 2007, 2009-2016 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
index 9e4f00da5a831182a761fa22adf8c8ece2d8ded0..f1e3594d1dcd6cfd808b56a2a95a8aea745904fe 100644 (file)
@@ -1,5 +1,5 @@
-/* Compare strings while treating digits characters numerically.
-   Copyright (C) 1997, 2000, 2002, 2004, 2006, 2009-2015 Free Software
+/* Compare strings while treating digits numerically.  -*- coding: utf-8 -*-
+   Copyright (C) 1997, 2000, 2002, 2004, 2006, 2009-2016 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
index 3f017f8fc6964b5f1f45ee9263cecd9c9baa6fa1..3b261da039fab0d2137e22b309f66675e8e48c3e 100644 (file)
@@ -1,3 +1,4 @@
 #include <config.h>
 #define _GL_SYS_SOCKET_INLINE _GL_EXTERN_INLINE
 #include "sys/socket.h"
+typedef int dummy;
index 243eda27c00c5ed88f6e56820cccb6b3e0a1b216..d99d831d488161d2c0b3b32608cd80c1427cdf54 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide a sys/socket header file for systems lacking it (read: MinGW)
    and for systems where it is incomplete.
-   Copyright (C) 2005-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005-2016 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
index 746b858cbe27cb4311a70896ea61e5af8d71e92c..6a6f2e6d7c3daf82a505c486a601235602c07b77 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide a more complete sys/stat header file.
-   Copyright (C) 2005-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 046b3a2528733f601b9b85640f1c812ed4b5a1ad..a005712a273205fb4661be1d8a24d6734b837a05 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/time.h.
 
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 188b1d3fbef48db7b125c9800d369cdfc6e8125c..8a795e56c5a364adb7b89d9f6cace366964b414f 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/types.h.
 
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 53411bcd0e19c1b246a2663b592457e3d87e6b21..479dc31daedd7f972e9bd43df8646784ba656cee 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for <sys/uio.h>.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 6bcd811d1551e52d9feeea6c24315f9546b6b13e..fc5fd048fc63e03fe9034532a997c9cbb590bc59 100644 (file)
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2015 Free Software Foundation, Inc.
+# Copyright (C) 2002-2016 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -94,11 +94,45 @@ EXTRA_DIST += test-byteswap.c macros.h
 
 TESTS += test-c-ctype
 check_PROGRAMS += test-c-ctype
-
 EXTRA_DIST += test-c-ctype.c macros.h
 
 ## end   gnulib module c-ctype-tests
 
+## begin gnulib module ctype
+
+BUILT_SOURCES += ctype.h
+
+# We need the following in order to create <ctype.h> when the system
+# doesn't have one that works with the given compiler.
+ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
+             -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \
+             -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/ctype.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += ctype.h ctype.h-t
+
+EXTRA_DIST += ctype.in.h
+
+## end   gnulib module ctype
+
+## begin gnulib module ctype-tests
+
+TESTS += test-ctype
+check_PROGRAMS += test-ctype
+EXTRA_DIST += test-ctype.c
+
+## end   gnulib module ctype-tests
+
 ## begin gnulib module errno-tests
 
 TESTS += test-errno
@@ -654,6 +688,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
index 8bbdb44d121d750af18d7ffbed568a8fc481507d..d828bcd0153245ad8da003f7bc2ca1cc20ea5999 100644 (file)
@@ -1,3 +1,4 @@
 #include <config.h>
 #define BINARY_IO_INLINE _GL_EXTERN_INLINE
 #include "binary-io.h"
+typedef int dummy;
index f5b66c790952beb98558aa513a243876b60eb49b..9f17c0d3987b9b962c0fadbfeb7bcaa4edcd7bc2 100644 (file)
@@ -1,5 +1,5 @@
 /* Binary mode I/O.
-   Copyright (C) 2001, 2003, 2005, 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2005, 2008-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
@@ -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/gl/tests/ctype.in.h b/gl/tests/ctype.in.h
new file mode 100644 (file)
index 0000000..217812d
--- /dev/null
@@ -0,0 +1,57 @@
+/* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete.
+
+   Copyright (C) 2009-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, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible.  */
+
+/*
+ * ISO C 99 <ctype.h> for platforms on which it is incomplete.
+ * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
+ */
+
+#ifndef _@GUARD_PREFIX@_CTYPE_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* Include the original <ctype.h>.  */
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_CTYPE_H@
+
+#ifndef _@GUARD_PREFIX@_CTYPE_H
+#define _@GUARD_PREFIX@_CTYPE_H
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* Return non-zero if c is a blank, i.e. a space or tab character.  */
+#if @GNULIB_ISBLANK@
+# if !@HAVE_ISBLANK@
+_GL_EXTERN_C int isblank (int c);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef isblank
+# if HAVE_RAW_DECL_ISBLANK
+_GL_WARN_ON_USE (isblank, "isblank is unportable - "
+                 "use gnulib module isblank for portability");
+# endif
+#endif
+
+#endif /* _@GUARD_PREFIX@_CTYPE_H */
+#endif /* _@GUARD_PREFIX@_CTYPE_H */
index e2880185c6310c0ff5689a18b501379ee18bb214..b94397307e937a03cd2610ef49106833f0967653 100644 (file)
@@ -1,6 +1,6 @@
 /* Like <fcntl.h>, but with non-working flags defined to 0.
 
-   Copyright (C) 2006-2015 Free Software Foundation, Inc.
+   Copyright (C) 2006-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
index b72c0e8fe0b33ced834f91404d27d8cfeb87081a..61fbfdfc5a5bec0bf5951d816d166ef30e1ce08d 100644 (file)
@@ -1,5 +1,5 @@
 /* Open a stream with a given file descriptor.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index cedd5b427f3f5ece74b6713571d7f391864c9290..05ee0cac947c67cc96b59a3fcf8186e409869fe4 100644 (file)
@@ -1,5 +1,5 @@
-/* Manipulating the FPU control word.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+/* Manipulating the FPU control word.  -*- coding: utf-8 -*-
+   Copyright (C) 2007-2016 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software: you can redistribute it and/or modify
index 10e9c18776b53a001f8aff6c64575a0ee94bdf02..dc4a200b210c6857c010bf61beb5744e713ea166 100644 (file)
@@ -1,6 +1,6 @@
 /* getpagesize emulation for systems where it cannot be done in a C macro.
 
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index d36620610e3cd4e772ec87ac26b21e388c815802..97e4e4ba5e691ab04b376497cdddeabcf2cfa461 100644 (file)
@@ -1,6 +1,6 @@
 # source this file; set up for tests
 
-# Copyright (C) 2009-2015 Free Software Foundation, Inc.
+# Copyright (C) 2009-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
@@ -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.
@@ -327,7 +333,7 @@ elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
       fi
     }
   fi
-elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
+elif cmp -s /dev/null /dev/null 2>/dev/null; then
   compare_ () { cmp -s "$@"; }
 else
   compare_ () { cmp "$@"; }
@@ -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;
index 78846f696839df88118cf05ac559c262496a83d4..ed09db6e86e881b2fd28cc7cce94267d106ac599 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Derek Price.
    This file is part of gnulib.
 
index b6fdd1cad48d5fa1eb52e54d5013f01ca138b817..578bfe737ee82ff78e48b81df15ec69d0667f288 100644 (file)
@@ -1,5 +1,5 @@
 /* Common macros used by gnulib tests.
-   Copyright (C) 2006-2015 Free Software Foundation, Inc.
+   Copyright (C) 2006-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
index 0a6cf915d1441fd3da73ee90c5208324526b7f87..2df806788a2740d4445b07dc05198381aa815c59 100644 (file)
@@ -1,5 +1,5 @@
 /* Macro for checking that a function declaration is compliant.
-   Copyright (C) 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2009-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
index c189cc66d597e6c89515dd99cef0b0aed2023ecc..b9aaa4a147a6c170e0bf536da84ed4d4d192fcae 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of optional automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-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
index 9c3f8f2199597c0b23d6d18393bf51d8de4fbeb7..6801e9621f53d9af13c8a450818affcc9661f759 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of binary mode I/O.
-   Copyright (C) 2005, 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007-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
index 66ef8d82a33b4ae3ea9502a23ecba6bdb1beef56..909bd54d3000ba322454ece34683597ed1fc3273 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <byteswap.h> substitute.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index 81fe936ec108b215ba13b4fb62b77e3c8b635a52..184cdec6e0b796574b454a5bb504fcb84d79bc15 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of character handling in C locale.
-   Copyright (C) 2005, 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007-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
 
 #include "c-ctype.h"
 
+#include <ctype.h>
+#include <limits.h>
 #include <locale.h>
 
 #include "macros.h"
 
 static void
-test_all (void)
+test_agree_with_C_locale (void)
 {
   int c;
 
-  for (c = -0x80; c < 0x100; c++)
+  for (c = 0; c <= UCHAR_MAX; c++)
     {
-      ASSERT (c_isascii (c) == (c >= 0 && c < 0x80));
-
-      switch (c)
+      ASSERT (c_isascii (c) == (isascii (c) != 0));
+      if (c_isascii (c))
         {
-        case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-        case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-        case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-        case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-        case 'Y': case 'Z':
-        case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-        case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-        case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-        case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-        case 'y': case 'z':
-        case '0': case '1': case '2': case '3': case '4': case '5':
-        case '6': case '7': case '8': case '9':
-          ASSERT (c_isalnum (c) == 1);
-          break;
-        default:
-          ASSERT (c_isalnum (c) == 0);
-          break;
+          ASSERT (c_isalnum (c) == (isalnum (c) != 0));
+          ASSERT (c_isalpha (c) == (isalpha (c) != 0));
+          ASSERT (c_isblank (c) == (isblank (c) != 0));
+          ASSERT (c_iscntrl (c) == (iscntrl (c) != 0));
+          ASSERT (c_isdigit (c) == (isdigit (c) != 0));
+          ASSERT (c_islower (c) == (islower (c) != 0));
+          ASSERT (c_isgraph (c) == (isgraph (c) != 0));
+          ASSERT (c_isprint (c) == (isprint (c) != 0));
+          ASSERT (c_ispunct (c) == (ispunct (c) != 0));
+          ASSERT (c_isspace (c) == (isspace (c) != 0));
+          ASSERT (c_isupper (c) == (isupper (c) != 0));
+          ASSERT (c_isxdigit (c) == (isxdigit (c) != 0));
+          ASSERT (c_tolower (c) == tolower (c));
+          ASSERT (c_toupper (c) == toupper (c));
         }
+    }
+}
 
-      switch (c)
+static void
+test_all (void)
+{
+  int c;
+  int n_isascii = 0;
+
+  for (c = CHAR_MIN; c <= UCHAR_MAX; c++)
+    {
+      if (! (0 <= c && c <= CHAR_MAX))
         {
-        case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
-        case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
-        case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
-        case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-        case 'Y': case 'Z':
-        case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
-        case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
-        case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
-        case 's': case 't': case 'u': case 'v': case 'w': case 'x':
-        case 'y': case 'z':
-          ASSERT (c_isalpha (c) == 1);
-          break;
-        default:
-          ASSERT (c_isalpha (c) == 0);
-          break;
+          ASSERT (! c_isascii (c));
+          ASSERT (! c_isalnum (c));
+          ASSERT (! c_isalpha (c));
+          ASSERT (! c_isblank (c));
+          ASSERT (! c_iscntrl (c));
+          ASSERT (! c_isdigit (c));
+          ASSERT (! c_islower (c));
+          ASSERT (! c_isgraph (c));
+          ASSERT (! c_isprint (c));
+          ASSERT (! c_ispunct (c));
+          ASSERT (! c_isspace (c));
+          ASSERT (! c_isupper (c));
+          ASSERT (! c_isxdigit (c));
+          ASSERT (c_tolower (c) == c);
+          ASSERT (c_toupper (c) == c);
         }
 
+      n_isascii += c_isascii (c);
+
+#ifdef C_CTYPE_ASCII
+      ASSERT (c_isascii (c) == (0 <= c && c <= 0x7f));
+#endif
+
+      ASSERT (c_isascii (c) == (c_isprint (c) || c_iscntrl (c)));
+
+      ASSERT (c_isalnum (c) == (c_isalpha (c) || c_isdigit (c)));
+
+      ASSERT (c_isalpha (c) == (c_islower (c) || c_isupper (c)));
+
       switch (c)
         {
         case '\t': case ' ':
@@ -83,7 +103,19 @@ test_all (void)
           break;
         }
 
+#ifdef C_CTYPE_ASCII
       ASSERT (c_iscntrl (c) == ((c >= 0 && c < 0x20) || c == 0x7f));
+#endif
+
+      switch (c)
+        {
+        case '\a': case '\b': case '\f': case '\n':
+        case '\r': case '\t': case '\v':
+          ASSERT (c_iscntrl (c));
+          break;
+        }
+
+      ASSERT (! (c_iscntrl (c) && c_isprint (c)));
 
       switch (c)
         {
@@ -104,17 +136,37 @@ test_all (void)
         case 's': case 't': case 'u': case 'v': case 'w': case 'x':
         case 'y': case 'z':
           ASSERT (c_islower (c) == 1);
+          ASSERT (c_toupper (c) == c - 'a' + 'A');
           break;
         default:
           ASSERT (c_islower (c) == 0);
+          ASSERT (c_toupper (c) == c);
           break;
         }
 
+#ifdef C_CTYPE_ASCII
       ASSERT (c_isgraph (c) == ((c >= 0x20 && c < 0x7f) && c != ' '));
 
       ASSERT (c_isprint (c) == (c >= 0x20 && c < 0x7f));
+#endif
+
+      ASSERT (c_isgraph (c) == (c_isalnum (c) || c_ispunct (c)));
+
+      ASSERT (c_isprint (c) == (c_isgraph (c) || c == ' '));
 
-      ASSERT (c_ispunct (c) == (c_isgraph (c) && !c_isalnum (c)));
+      switch (c)
+        {
+        case '!': case '"': case '#': case '$': case '%': case '&': case '\'':
+        case '(': case ')': case '*': case '+': case ',': case '-': case '.':
+        case '/': case ':': case ';': case '<': case '=': case '>': case '?':
+        case '@': case '[': case'\\': case ']': case '^': case '_': case '`':
+        case '{': case '|': case '}': case '~':
+          ASSERT (c_ispunct (c) == 1);
+          break;
+        default:
+          ASSERT (c_ispunct (c) == 0);
+          break;
+        }
 
       switch (c)
         {
@@ -134,9 +186,11 @@ test_all (void)
         case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
         case 'Y': case 'Z':
           ASSERT (c_isupper (c) == 1);
+          ASSERT (c_tolower (c) == c - 'A' + 'a');
           break;
         default:
           ASSERT (c_isupper (c) == 0);
+          ASSERT (c_tolower (c) == c);
           break;
         }
 
@@ -152,228 +206,16 @@ test_all (void)
           ASSERT (c_isxdigit (c) == 0);
           break;
         }
-
-      switch (c)
-        {
-        case 'A':
-          ASSERT (c_tolower (c) == 'a');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'B':
-          ASSERT (c_tolower (c) == 'b');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'C':
-          ASSERT (c_tolower (c) == 'c');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'D':
-          ASSERT (c_tolower (c) == 'd');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'E':
-          ASSERT (c_tolower (c) == 'e');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'F':
-          ASSERT (c_tolower (c) == 'f');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'G':
-          ASSERT (c_tolower (c) == 'g');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'H':
-          ASSERT (c_tolower (c) == 'h');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'I':
-          ASSERT (c_tolower (c) == 'i');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'J':
-          ASSERT (c_tolower (c) == 'j');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'K':
-          ASSERT (c_tolower (c) == 'k');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'L':
-          ASSERT (c_tolower (c) == 'l');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'M':
-          ASSERT (c_tolower (c) == 'm');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'N':
-          ASSERT (c_tolower (c) == 'n');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'O':
-          ASSERT (c_tolower (c) == 'o');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'P':
-          ASSERT (c_tolower (c) == 'p');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'Q':
-          ASSERT (c_tolower (c) == 'q');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'R':
-          ASSERT (c_tolower (c) == 'r');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'S':
-          ASSERT (c_tolower (c) == 's');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'T':
-          ASSERT (c_tolower (c) == 't');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'U':
-          ASSERT (c_tolower (c) == 'u');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'V':
-          ASSERT (c_tolower (c) == 'v');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'W':
-          ASSERT (c_tolower (c) == 'w');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'X':
-          ASSERT (c_tolower (c) == 'x');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'Y':
-          ASSERT (c_tolower (c) == 'y');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'Z':
-          ASSERT (c_tolower (c) == 'z');
-          ASSERT (c_toupper (c) == c);
-          break;
-        case 'a':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'A');
-          break;
-        case 'b':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'B');
-          break;
-        case 'c':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'C');
-          break;
-        case 'd':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'D');
-          break;
-        case 'e':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'E');
-          break;
-        case 'f':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'F');
-          break;
-        case 'g':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'G');
-          break;
-        case 'h':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'H');
-          break;
-        case 'i':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'I');
-          break;
-        case 'j':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'J');
-          break;
-        case 'k':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'K');
-          break;
-        case 'l':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'L');
-          break;
-        case 'm':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'M');
-          break;
-        case 'n':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'N');
-          break;
-        case 'o':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'O');
-          break;
-        case 'p':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'P');
-          break;
-        case 'q':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'Q');
-          break;
-        case 'r':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'R');
-          break;
-        case 's':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'S');
-          break;
-        case 't':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'T');
-          break;
-        case 'u':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'U');
-          break;
-        case 'v':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'V');
-          break;
-        case 'w':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'W');
-          break;
-        case 'x':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'X');
-          break;
-        case 'y':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'Y');
-          break;
-        case 'z':
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == 'Z');
-          break;
-        default:
-          ASSERT (c_tolower (c) == c);
-          ASSERT (c_toupper (c) == c);
-          break;
-        }
     }
+
+  ASSERT (n_isascii == 128);
 }
 
 int
 main ()
 {
+  test_agree_with_C_locale ();
+
   test_all ();
 
   setlocale (LC_ALL, "de_DE");
diff --git a/gl/tests/test-ctype.c b/gl/tests/test-ctype.c
new file mode 100644 (file)
index 0000000..570fbdb
--- /dev/null
@@ -0,0 +1,27 @@
+/* Test of <ctype.h> substitute.
+   Copyright (C) 2009-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
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009.  */
+
+#include <config.h>
+
+#include <ctype.h>
+
+int
+main (void)
+{
+  return 0;
+}
index fab35d0dc05597ebc3619ade603e5bc55e70a9bf..1e0bb6d4d327f941c5a125eedd7321df9b680b5f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <errno.h> substitute.
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-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
index e177b3e691ab74d231a61df138ce598ca1977620..aef1661a648cfb8c5110fc07de3fb71ed500c868 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <fcntl.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index c4e035521ca8fc98f57e378f1999a010a13f2f6f..55b49a6490812d3cddd41a5bb6d98f1a7258fa01 100644 (file)
@@ -1,5 +1,5 @@
 /* Test opening a stream with a file descriptor.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index 63e1e4a22bb2269d17aeb47b9583cba223c6a270..c62e70c6d9fb3c586d07f1019e3348388ca12fb2 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fgetc() function.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index f8321995b03ee201060b469ebdbcd0aa55b449e8..1c95b12f97f0030f10cd95f17badf2f3c1d5246e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <float.h> substitute.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index 41ae0965b0292d38c165412b877bc80029808d45..95a1cb6014b71bba52d500bf03d57f7a5b0fdbfb 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fputc() function.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index 41cea56c8a351060311c1ceb0c3b104618277b2e..b9fc72afa10fd6e6726b08edafce21730f5e7191 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fread() function.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index 7f393638a8ab674be576222fd23a638414a647d0..c9ac749db86f5c8bc42e03af163bd6a2f635cbb2 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of fstat() function.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index 2853226888353bc4edee544956383814559f283b..9b523444ebec1ac5d7a4cf9ffba9d3287b83edac 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftell() function.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index 8a95e1c337b67888fa09f72ffe94ad87ffb9ee5c..695e5b2dc77c692e237b6d0377403c019421fc92 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftell() function.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index b9b5c969d1cd974b5d05b09c4e0b21d79224e5e6..369d476518daad7ad70bb87c9976234c870cfe10 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftello() function.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index 67b46711359de0f93f2165d465cadb14ff33b468..f75ce034324de8b9475bd49e12fd6320412e2813 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftello() function.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index 68e64593de31294d65fca94d0173ba0f70d47f16..1f94ef67d830d9eb677254c99bed7136c52bdeab 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftello() function.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index 4da2e035ff3441cfb8bf470aced614dd1887eacf..54e3328d35a8dfdf5a46485507a4a31908a5016b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test whether __func__ is available
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-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
index df4114ced6c67f97b10e89d4e11ec050986f9333..bc285f3017ee8f2607dd1cbc07eb754eb9e065ac 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fwrite() function.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index bbcc3cded682b5f301debabe39afc963da5ebf28..0770d5b3aa74b07a9db27cb2f6b792433964b301 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of getdelim() function.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index 238742cf0fe52078c310f3d2948b6c08e1f603a5..13dcb1d7f8708aa58a38fac152dcdf7d2d53e231 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of getline() function.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
@@ -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);
index 3b15f1298e316304beb96d2b64688c707452b6d9..7a44d71fa4d0c3af3bca70b10e7588c8a36f28f5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2007, 2009-2015 Free Software Foundation, Inc.
+ * Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
  * Written by Jim Meyering.
  *
  * This program is free software: you can redistribute it and/or modify
index ed715bda3f042ee48ec4acfea2d04a44ad02c16b..3e4c4ff0a7acd23d74d9359cc72fa59e0077492a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of character set conversion.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index 0875a75b940348b61806bdb83dd9eb005ee7a3fa..1dd05f4504501a08ecc1cd146b9c2a2fc40783fa 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for init.sh
-# Copyright (C) 2011-2015 Free Software Foundation, Inc.
+# Copyright (C) 2011-2016 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
index 06df5a7c1121a31f0481227bc04a28af1ef7fb5b..51fe09638ed3d71a14976c780a3e9996ecc56096 100644 (file)
@@ -1,5 +1,5 @@
 /* Test intprops.h.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
 
 /* Written by Paul Eggert.  */
 
-/* Tell gcc not to warn about the many (X < 0) expressions that
-   the overflow macros expand to.  */
-#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+/* Tell gcc not to warn about the long expressions that the overflow
+   macros expand to, or about the (X < 0) expressions.  */
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+# 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
+
 #endif
 
 #include <config.h>
@@ -29,6 +38,7 @@
 
 #include <stdbool.h>
 #include <inttypes.h>
+#include <limits.h>
 
 #include "macros.h"
 
@@ -43,6 +53,8 @@
 # define VERIFY(x) ASSERT (x)
 #endif
 
+#define DONTCARE __LINE__
+
 int
 main (void)
 {
@@ -82,12 +94,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);
@@ -128,148 +136,238 @@ main (void)
   #endif
 
   /* All the INT_<op>_RANGE_OVERFLOW tests are equally valid as
-     INT_<op>_OVERFLOW tests, so define a single macro to do both.  */
-  #define CHECK_BINOP(op, a, b, min, max, overflow)                      \
-    (INT_##op##_RANGE_OVERFLOW (a, b, min, max) == (overflow)            \
-     && INT_##op##_OVERFLOW (a, b) == (overflow))
-  #define CHECK_UNOP(op, a, min, max, overflow)                          \
-    (INT_##op##_RANGE_OVERFLOW (a, min, max) == (overflow)               \
-     && INT_##op##_OVERFLOW (a) == (overflow))
+     INT_<op>_OVERFLOW tests, so define macros to do both.  OP is the
+     operation, OPNAME its symbolic name, A and B its operands, T the
+     result type, V the overflow flag, and VRES the result if V and if
+     two's complement.  CHECK_BINOP is for most binary operatinos,
+     CHECK_SBINOP for binary +, -, * when the result type is signed,
+     and CHECK_UNOP for unary operations.  */
+  #define CHECK_BINOP(op, opname, a, b, t, v, vres)                       \
+    VERIFY (INT_##opname##_RANGE_OVERFLOW (a, b, TYPE_MINIMUM (t),        \
+                                           TYPE_MAXIMUM (t))              \
+            == (v));                                                      \
+    VERIFY (INT_##opname##_OVERFLOW (a, b) == (v))
+  #define CHECK_SBINOP(op, opname, a, b, t, v, vres)                      \
+    CHECK_BINOP(op, opname, a, b, t, v, vres);                            \
+    {                                                                     \
+      t result;                                                           \
+      ASSERT (INT_##opname##_WRAPV (a, b, &result) == (v));               \
+      ASSERT (result == ((v) ? (vres) : ((a) op (b))));                   \
+    }
+  #define CHECK_UNOP(op, opname, a, t, v)                                 \
+    VERIFY (INT_##opname##_RANGE_OVERFLOW (a, TYPE_MINIMUM (t),           \
+                                           TYPE_MAXIMUM (t))              \
+            == (v));                                                      \
+    VERIFY (INT_##opname##_OVERFLOW (a) == (v))
 
   /* INT_<op>_RANGE_OVERFLOW, INT_<op>_OVERFLOW.  */
   VERIFY (INT_ADD_RANGE_OVERFLOW (INT_MAX, 1, INT_MIN, INT_MAX));
   VERIFY (INT_ADD_OVERFLOW (INT_MAX, 1));
-  VERIFY (CHECK_BINOP (ADD, INT_MAX, 1, INT_MIN, INT_MAX, true));
-  VERIFY (CHECK_BINOP (ADD, INT_MAX, -1, INT_MIN, INT_MAX, false));
-  VERIFY (CHECK_BINOP (ADD, INT_MIN, 1, INT_MIN, INT_MAX, false));
-  VERIFY (CHECK_BINOP (ADD, INT_MIN, -1, INT_MIN, INT_MAX, true));
-  VERIFY (CHECK_BINOP (ADD, UINT_MAX, 1u, 0u, UINT_MAX, true));
-  VERIFY (CHECK_BINOP (ADD, 0u, 1u, 0u, UINT_MAX, false));
-
-  VERIFY (CHECK_BINOP (SUBTRACT, INT_MAX, 1, INT_MIN, INT_MAX, false));
-  VERIFY (CHECK_BINOP (SUBTRACT, INT_MAX, -1, INT_MIN, INT_MAX, true));
-  VERIFY (CHECK_BINOP (SUBTRACT, INT_MIN, 1, INT_MIN, INT_MAX, true));
-  VERIFY (CHECK_BINOP (SUBTRACT, INT_MIN, -1, INT_MIN, INT_MAX, false));
-  VERIFY (CHECK_BINOP (SUBTRACT, UINT_MAX, 1u, 0u, UINT_MAX, false));
-  VERIFY (CHECK_BINOP (SUBTRACT, 0u, 1u, 0u, UINT_MAX, true));
-
-  VERIFY (CHECK_UNOP (NEGATE, INT_MIN, INT_MIN, INT_MAX,
-                      TYPE_TWOS_COMPLEMENT (int)));
-  VERIFY (CHECK_UNOP (NEGATE, 0, INT_MIN, INT_MAX, false));
-  VERIFY (CHECK_UNOP (NEGATE, INT_MAX, INT_MIN, INT_MAX, false));
-  VERIFY (CHECK_UNOP (NEGATE, 0u, 0u, UINT_MAX, false));
-  VERIFY (CHECK_UNOP (NEGATE, 1u, 0u, UINT_MAX, true));
-  VERIFY (CHECK_UNOP (NEGATE, UINT_MAX, 0u, UINT_MAX, true));
-
-  VERIFY (CHECK_BINOP (MULTIPLY, INT_MAX, INT_MAX, INT_MIN, INT_MAX, true));
-  VERIFY (CHECK_BINOP (MULTIPLY, INT_MAX, INT_MIN, INT_MIN, INT_MAX, true));
-  VERIFY (CHECK_BINOP (MULTIPLY, INT_MIN, INT_MAX, INT_MIN, INT_MAX, true));
-  VERIFY (CHECK_BINOP (MULTIPLY, INT_MIN, INT_MIN, INT_MIN, INT_MAX, true));
-  VERIFY (CHECK_BINOP (MULTIPLY, -1, INT_MIN, INT_MIN, INT_MAX,
-                       INT_NEGATE_OVERFLOW (INT_MIN)));
-  VERIFY (CHECK_BINOP (MULTIPLY, LONG_MIN / INT_MAX, (long int) INT_MAX,
-                       LONG_MIN, LONG_MIN, false));
-
-  VERIFY (CHECK_BINOP (DIVIDE, INT_MIN, -1, INT_MIN, INT_MAX,
-                       INT_NEGATE_OVERFLOW (INT_MIN)));
-  VERIFY (CHECK_BINOP (DIVIDE, INT_MAX, 1, INT_MIN, INT_MAX, false));
-  VERIFY (CHECK_BINOP (DIVIDE, (unsigned int) INT_MIN,
-                       -1u, 0u, UINT_MAX, false));
-
-  VERIFY (CHECK_BINOP (REMAINDER, INT_MIN, -1, INT_MIN, INT_MAX,
-                       INT_NEGATE_OVERFLOW (INT_MIN)));
-  VERIFY (CHECK_BINOP (REMAINDER, INT_MAX, 1, INT_MIN, INT_MAX, false));
-  VERIFY (CHECK_BINOP (REMAINDER, (unsigned int) INT_MIN,
-                       -1u, 0u, UINT_MAX, false));
-
-  VERIFY (CHECK_BINOP (LEFT_SHIFT, UINT_MAX, 1, 0u, UINT_MAX, true));
-  VERIFY (CHECK_BINOP (LEFT_SHIFT, UINT_MAX / 2 + 1, 1, 0u, UINT_MAX, true));
-  VERIFY (CHECK_BINOP (LEFT_SHIFT, UINT_MAX / 2, 1, 0u, UINT_MAX, false));
-
-  /* INT_<op>_OVERFLOW with mixed types.  */
-  #define CHECK_SUM(a, b, overflow)                       \
-    VERIFY (INT_ADD_OVERFLOW (a, b) == (overflow));       \
-    VERIFY (INT_ADD_OVERFLOW (b, a) == (overflow))
-  CHECK_SUM (-1, LONG_MIN, true);
-  CHECK_SUM (-1, UINT_MAX, false);
-  CHECK_SUM (-1L, INT_MIN, INT_MIN == LONG_MIN);
-  CHECK_SUM (0u, -1, true);
-  CHECK_SUM (0u, 0, false);
-  CHECK_SUM (0u, 1, false);
-  CHECK_SUM (1, LONG_MAX, true);
-  CHECK_SUM (1, UINT_MAX, true);
-  CHECK_SUM (1L, INT_MAX, INT_MAX == LONG_MAX);
-  CHECK_SUM (1u, INT_MAX, INT_MAX == UINT_MAX);
-  CHECK_SUM (1u, INT_MIN, true);
-
-  VERIFY (! INT_SUBTRACT_OVERFLOW (INT_MAX, 1u));
-  VERIFY (! INT_SUBTRACT_OVERFLOW (UINT_MAX, 1));
-  VERIFY (! INT_SUBTRACT_OVERFLOW (0u, -1));
-  VERIFY (INT_SUBTRACT_OVERFLOW (UINT_MAX, -1));
-  VERIFY (INT_SUBTRACT_OVERFLOW (INT_MIN, 1u));
-  VERIFY (INT_SUBTRACT_OVERFLOW (-1, 0u));
-
-  #define CHECK_PRODUCT(a, b, overflow)                   \
-    VERIFY (INT_MULTIPLY_OVERFLOW (a, b) == (overflow));   \
-    VERIFY (INT_MULTIPLY_OVERFLOW (b, a) == (overflow))
-
-  CHECK_PRODUCT (-1, 1u, true);
-  CHECK_PRODUCT (-1, INT_MIN, INT_NEGATE_OVERFLOW (INT_MIN));
-  CHECK_PRODUCT (-1, UINT_MAX, true);
-  CHECK_PRODUCT (-12345, LONG_MAX / -12345 - 1, true);
-  CHECK_PRODUCT (-12345, LONG_MAX / -12345, false);
-  CHECK_PRODUCT (0, -1, false);
-  CHECK_PRODUCT (0, 0, false);
-  CHECK_PRODUCT (0, 0u, false);
-  CHECK_PRODUCT (0, 1, false);
-  CHECK_PRODUCT (0, INT_MAX, false);
-  CHECK_PRODUCT (0, INT_MIN, false);
-  CHECK_PRODUCT (0, UINT_MAX, false);
-  CHECK_PRODUCT (0u, -1, false);
-  CHECK_PRODUCT (0u, 0, false);
-  CHECK_PRODUCT (0u, 0u, false);
-  CHECK_PRODUCT (0u, 1, false);
-  CHECK_PRODUCT (0u, INT_MAX, false);
-  CHECK_PRODUCT (0u, INT_MIN, false);
-  CHECK_PRODUCT (0u, UINT_MAX, false);
-  CHECK_PRODUCT (1, INT_MAX, false);
-  CHECK_PRODUCT (1, INT_MIN, false);
-  CHECK_PRODUCT (1, UINT_MAX, false);
-  CHECK_PRODUCT (1u, INT_MIN, true);
-  CHECK_PRODUCT (1u, INT_MAX, UINT_MAX < INT_MAX);
-  CHECK_PRODUCT (INT_MAX, UINT_MAX, true);
-  CHECK_PRODUCT (INT_MAX, ULONG_MAX, true);
-  CHECK_PRODUCT (INT_MIN, LONG_MAX / INT_MIN - 1, true);
-  CHECK_PRODUCT (INT_MIN, LONG_MAX / INT_MIN, false);
-  CHECK_PRODUCT (INT_MIN, UINT_MAX, true);
-  CHECK_PRODUCT (INT_MIN, ULONG_MAX, true);
-
-  VERIFY (INT_DIVIDE_OVERFLOW (INT_MIN, -1L)
-          == (TYPE_TWOS_COMPLEMENT (long int) && INT_MIN == LONG_MIN));
-  VERIFY (! INT_DIVIDE_OVERFLOW (INT_MIN, UINT_MAX));
-  VERIFY (! INT_DIVIDE_OVERFLOW (INTMAX_MIN, UINTMAX_MAX));
-  VERIFY (! INT_DIVIDE_OVERFLOW (INTMAX_MIN, UINT_MAX));
-  VERIFY (INT_DIVIDE_OVERFLOW (-11, 10u));
-  VERIFY (INT_DIVIDE_OVERFLOW (-10, 10u));
-  VERIFY (! INT_DIVIDE_OVERFLOW (-9, 10u));
-  VERIFY (INT_DIVIDE_OVERFLOW (11u, -10));
-  VERIFY (INT_DIVIDE_OVERFLOW (10u, -10));
-  VERIFY (! INT_DIVIDE_OVERFLOW (9u, -10));
-
-  VERIFY (INT_REMAINDER_OVERFLOW (INT_MIN, -1L)
-          == (TYPE_TWOS_COMPLEMENT (long int) && INT_MIN == LONG_MIN));
-  VERIFY (INT_REMAINDER_OVERFLOW (-1, UINT_MAX));
-  VERIFY (INT_REMAINDER_OVERFLOW ((intmax_t) -1, UINTMAX_MAX));
-  VERIFY (INT_REMAINDER_OVERFLOW (INTMAX_MIN, UINT_MAX)
-          == (INTMAX_MAX < UINT_MAX
-              && - (unsigned int) INTMAX_MIN % UINT_MAX != 0));
-  VERIFY (INT_REMAINDER_OVERFLOW (INT_MIN, ULONG_MAX)
-          == (INT_MIN % ULONG_MAX != 1));
-  VERIFY (! INT_REMAINDER_OVERFLOW (1u, -1));
-  VERIFY (! INT_REMAINDER_OVERFLOW (37*39u, -39));
-  VERIFY (INT_REMAINDER_OVERFLOW (37*39u + 1, -39));
-  VERIFY (INT_REMAINDER_OVERFLOW (37*39u - 1, -39));
-  VERIFY (! INT_REMAINDER_OVERFLOW (LONG_MAX, -INT_MAX));
+
+  CHECK_SBINOP (+, ADD, INT_MAX, 1, int, true, INT_MIN);
+  CHECK_SBINOP (+, ADD, INT_MAX, -1, int, false, INT_MAX - 1);
+  CHECK_SBINOP (+, ADD, INT_MIN, 1, int, false, INT_MIN + 1);
+  CHECK_SBINOP (+, ADD, INT_MIN, -1, int, true, INT_MAX);
+  CHECK_BINOP (+, ADD, UINT_MAX, 1u, unsigned int, true, 0u);
+  CHECK_BINOP (+, ADD, 0u, 1u, unsigned int, false, 1u);
+
+  CHECK_SBINOP (-, SUBTRACT, INT_MAX, 1, int, false, INT_MAX - 1);
+  CHECK_SBINOP (-, SUBTRACT, INT_MAX, -1, int, true, INT_MIN);
+  CHECK_SBINOP (-, SUBTRACT, INT_MIN, 1, int, true, INT_MAX);
+  CHECK_SBINOP (-, SUBTRACT, INT_MIN, -1, int, false, INT_MIN - -1);
+  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, true);
+  CHECK_UNOP (-, NEGATE, 0, int, false);
+  CHECK_UNOP (-, NEGATE, INT_MAX, int, false);
+  CHECK_UNOP (-, NEGATE, 0u, unsigned int, false);
+  CHECK_UNOP (-, NEGATE, 1u, unsigned int, true);
+  CHECK_UNOP (-, NEGATE, UINT_MAX, unsigned int, true);
+
+  CHECK_SBINOP (*, MULTIPLY, INT_MAX, INT_MAX, int, true, 1);
+  CHECK_SBINOP (*, MULTIPLY, INT_MAX, INT_MIN, int, true, INT_MIN);
+  CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MAX, int, true, INT_MIN);
+  CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MIN, int, true, 0);
+  CHECK_SBINOP (*, MULTIPLY, -1, INT_MIN, int,
+                INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
+  CHECK_SBINOP (*, MULTIPLY, LONG_MIN / INT_MAX, (long int) INT_MAX,
+                long int, false, LONG_MIN - LONG_MIN % INT_MAX);
+
+  CHECK_BINOP (/, DIVIDE, INT_MIN, -1, int,
+               INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
+  CHECK_BINOP (/, DIVIDE, INT_MAX, 1, int, false, INT_MAX);
+  CHECK_BINOP (/, DIVIDE, (unsigned int) INT_MIN, -1u, unsigned int,
+               false, INT_MIN / -1u);
+
+  CHECK_BINOP (%, REMAINDER, INT_MIN, -1, int, INT_NEGATE_OVERFLOW (INT_MIN), 0);
+  CHECK_BINOP (%, REMAINDER, INT_MAX, 1, int, false, 0);
+  CHECK_BINOP (%, REMAINDER, (unsigned int) INT_MIN, -1u, unsigned int,
+               false, INT_MIN % -1u);
+
+  CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX, 1, unsigned int, true, UINT_MAX << 1);
+  CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX / 2 + 1, 1, unsigned int, true,
+               (UINT_MAX / 2 + 1) << 1);
+  CHECK_BINOP (<<, LEFT_SHIFT, UINT_MAX / 2, 1, unsigned int, false,
+               (UINT_MAX / 2) << 1);
+
+  /* INT_<op>_OVERFLOW and INT_<op>_WRAPV with mixed types.  */
+  #define CHECK_SUM(a, b, t, v, vres)                                     \
+    CHECK_SUM1(a, b, t, v, vres);                                         \
+    CHECK_SUM1(b, a, t, v, vres)
+  #define CHECK_SSUM(a, b, t, v, vres)                                    \
+    CHECK_SSUM1(a, b, t, v, vres);                                        \
+    CHECK_SSUM1(b, a, t, v, vres)
+  #define CHECK_SUM1(a, b, t, v, vres)                                    \
+    VERIFY (INT_ADD_OVERFLOW (a, b) == (v))
+  #define CHECK_SSUM1(a, b, t, v, vres)                                   \
+    CHECK_SUM1(a, b, t, v, vres);                                         \
+    {                                                                     \
+      t result;                                                           \
+      ASSERT (INT_ADD_WRAPV (a, b, &result) == (v));                      \
+      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);
+  CHECK_SSUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN,
+              INT_MIN == LONG_MIN ? INT_MAX : DONTCARE);
+  CHECK_SUM (0u, -1, unsigned int, true, 0u + -1);
+  CHECK_SUM (0u, 0, unsigned int, false, DONTCARE);
+  CHECK_SUM (0u, 1, unsigned int, false, DONTCARE);
+  CHECK_SSUM (1, LONG_MAX, long int, true, LONG_MIN);
+  CHECK_SUM (1, UINT_MAX, unsigned int, true, 0u);
+  CHECK_SSUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX,
+              INT_MAX == LONG_MAX ? INT_MIN : DONTCARE);
+  CHECK_SUM (1u, INT_MAX, unsigned int, INT_MAX == UINT_MAX, 1u + INT_MAX);
+  CHECK_SUM (1u, INT_MIN, unsigned int, true, 1u + INT_MIN);
+  {
+    long int result;
+    ASSERT (INT_ADD_WRAPV (1, INT_MAX, &result) == (INT_MAX == LONG_MAX));
+    ASSERT (INT_ADD_WRAPV (-1, INT_MIN, &result) == (INT_MIN == LONG_MIN));
+  }
+
+  #define CHECK_DIFFERENCE(a, b, t, v, vres)                              \
+    VERIFY (INT_SUBTRACT_OVERFLOW (a, b) == (v))
+  #define CHECK_SDIFFERENCE(a, b, t, v, vres)                             \
+    CHECK_DIFFERENCE(a, b, t, v, vres);                                   \
+    {                                                                     \
+      t result;                                                           \
+      ASSERT (INT_SUBTRACT_WRAPV (a, b, &result) == (v));                 \
+      ASSERT (result == ((v) ? (vres) : ((a) - (b))));                    \
+    }
+  CHECK_DIFFERENCE (INT_MAX, 1u, unsigned int, UINT_MAX < INT_MAX - 1,
+                    INT_MAX - 1u);
+  CHECK_DIFFERENCE (UINT_MAX, 1, unsigned int, false, UINT_MAX - 1);
+  CHECK_DIFFERENCE (0u, -1, unsigned int, false, 0u - -1);
+  CHECK_DIFFERENCE (UINT_MAX, -1, unsigned int, true, UINT_MAX - -1);
+  CHECK_DIFFERENCE (INT_MIN, 1u, unsigned int, true, INT_MIN - 1u);
+  CHECK_DIFFERENCE (-1, 0u, unsigned int, true, -1 - 0u);
+  CHECK_SDIFFERENCE (-1, INT_MIN, int, false, -1 - INT_MIN);
+  CHECK_SDIFFERENCE (-1, INT_MAX, int, false, -1 - INT_MAX);
+  CHECK_SDIFFERENCE (0, INT_MIN, int, INT_MIN < -INT_MAX, INT_MIN);
+  CHECK_SDIFFERENCE (0, INT_MAX, int, false, 0 - INT_MAX);
+  {
+    long int result;
+    ASSERT (INT_SUBTRACT_WRAPV (INT_MAX, -1, &result) == (INT_MAX == LONG_MAX));
+    ASSERT (INT_SUBTRACT_WRAPV (INT_MIN, 1, &result) == (INT_MAX == LONG_MAX));
+  }
+
+  #define CHECK_PRODUCT(a, b, t, v, vres)                                 \
+    CHECK_PRODUCT1(a, b, t, v, vres);                                     \
+    CHECK_PRODUCT1(b, a, t, v, vres)
+  #define CHECK_SPRODUCT(a, b, t, v, vres)                                \
+    CHECK_SPRODUCT1(a, b, t, v, vres);                                    \
+    CHECK_SPRODUCT1(b, a, t, v, vres)
+  #define CHECK_PRODUCT1(a, b, t, v, vres)                                \
+    VERIFY (INT_MULTIPLY_OVERFLOW (a, b) == (v))
+  #define CHECK_SPRODUCT1(a, b, t, v, vres)                               \
+    CHECK_PRODUCT1(a, b, t, v, vres);                                     \
+    {                                                                     \
+      t result;                                                           \
+      ASSERT (INT_MULTIPLY_WRAPV (a, b, &result) == (v));                 \
+      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);
+  CHECK_PRODUCT (-1, UINT_MAX, unsigned int, true, -1 * UINT_MAX);
+  CHECK_SPRODUCT (-32768, LONG_MAX / -32768 - 1, long int, true, LONG_MIN);
+  CHECK_SPRODUCT (-12345, LONG_MAX / -12345, long int, false, DONTCARE);
+  CHECK_SPRODUCT (0, -1, int, false, DONTCARE);
+  CHECK_SPRODUCT (0, 0, int, false, DONTCARE);
+  CHECK_PRODUCT (0, 0u, unsigned int, false, DONTCARE);
+  CHECK_SPRODUCT (0, 1, int, false, DONTCARE);
+  CHECK_SPRODUCT (0, INT_MAX, int, false, DONTCARE);
+  CHECK_SPRODUCT (0, INT_MIN, int, false, DONTCARE);
+  CHECK_PRODUCT (0, UINT_MAX, unsigned int, false, DONTCARE);
+  CHECK_PRODUCT (0u, -1, unsigned int, false, DONTCARE);
+  CHECK_PRODUCT (0u, 0, unsigned int, false, DONTCARE);
+  CHECK_PRODUCT (0u, 0u, unsigned int, false, DONTCARE);
+  CHECK_PRODUCT (0u, 1, unsigned int, false, DONTCARE);
+  CHECK_PRODUCT (0u, INT_MAX, unsigned int, false, DONTCARE);
+  CHECK_PRODUCT (0u, INT_MIN, unsigned int, false, DONTCARE);
+  CHECK_PRODUCT (0u, UINT_MAX, unsigned int, false, DONTCARE);
+  CHECK_SPRODUCT (1, INT_MAX, int, false, DONTCARE);
+  CHECK_SPRODUCT (1, INT_MIN, int, false, DONTCARE);
+  CHECK_PRODUCT (1, UINT_MAX, unsigned int, false, DONTCARE);
+  CHECK_PRODUCT (1u, INT_MIN, unsigned int, true, 1u * INT_MIN);
+  CHECK_PRODUCT (1u, INT_MAX, unsigned int, UINT_MAX < INT_MAX, 1u * INT_MAX);
+  CHECK_PRODUCT (INT_MAX, UINT_MAX, unsigned int, true, INT_MAX * UINT_MAX);
+  CHECK_PRODUCT (INT_MAX, ULONG_MAX, unsigned long int, true,
+                 INT_MAX * ULONG_MAX);
+  CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN - 1, long int, true, LONG_MIN);
+  CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN, long int, false, DONTCARE);
+  CHECK_PRODUCT (INT_MIN, UINT_MAX, unsigned int, true, INT_MIN * UINT_MAX);
+  CHECK_PRODUCT (INT_MIN, ULONG_MAX, unsigned long int, true,
+                 INT_MIN * ULONG_MAX);
+  {
+    long int result;
+    ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result)
+            == (LONG_MAX / INT_MAX < INT_MAX));
+    ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result)
+            || result == INT_MAX * (long int) INT_MAX);
+    ASSERT (INT_MULTIPLY_WRAPV (INT_MIN, INT_MIN, &result)
+            || result == INT_MIN * (long int) INT_MIN);
+  }
+
+# ifdef LLONG_MAX
+  {
+    long long int result;
+    ASSERT (INT_MULTIPLY_WRAPV (LONG_MAX, LONG_MAX, &result)
+            == (LLONG_MAX / LONG_MAX < LONG_MAX));
+    ASSERT (INT_MULTIPLY_WRAPV (LONG_MAX, LONG_MAX, &result)
+            || result == LONG_MAX * (long long int) LONG_MAX);
+    ASSERT (INT_MULTIPLY_WRAPV (LONG_MIN, LONG_MIN, &result)
+            || result == LONG_MIN * (long long int) LONG_MIN);
+  }
+# endif
+
+  #define CHECK_QUOTIENT(a, b, v) VERIFY (INT_DIVIDE_OVERFLOW (a, b) == (v))
+
+  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);
+  CHECK_QUOTIENT (-11, 10u, true);
+  CHECK_QUOTIENT (-10, 10u, true);
+  CHECK_QUOTIENT (-9, 10u, false);
+  CHECK_QUOTIENT (11u, -10, true);
+  CHECK_QUOTIENT (10u, -10, true);
+  CHECK_QUOTIENT (9u, -10, false);
+
+  #define CHECK_REMAINDER(a, b, v) VERIFY (INT_REMAINDER_OVERFLOW (a, b) == (v))
+
+  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,
+                   (INTMAX_MAX < UINT_MAX
+                    && - (unsigned int) INTMAX_MIN % UINT_MAX != 0));
+  CHECK_REMAINDER (INT_MIN, ULONG_MAX, INT_MIN % ULONG_MAX != 1);
+  CHECK_REMAINDER (1u, -1, false);
+  CHECK_REMAINDER (37*39u, -39, false);
+  CHECK_REMAINDER (37*39u + 1, -39, true);
+  CHECK_REMAINDER (37*39u - 1, -39, true);
+  CHECK_REMAINDER (LONG_MAX, -INT_MAX, false);
 
   return 0;
 }
index 7fa18b2392b2ef709735849ea7d5b60a13ad9b7d..9a3193c398bc16cb4f75adcd82efd75fe083ac13 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <inttypes.h> substitute.
-   Copyright (C) 2006-2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2009-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
index bc1acf9f0fc80d5cf063ac54bfed0bae7cae6dcc..1526ed2a6915a3219bd8a2aff5befd6be8198236 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2015 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2016 Free Software Foundation, Inc.
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
index 97abfd278367671542e7ce68967441815facbc91..93d9c97a5ce1e62e827df75ef0749462929c58db 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <netdb.h> substitute.
-   Copyright (C) 2007-2008, 2010-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008, 2010-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
index ae1634f686bb8ce8940f181b36d075abdfa5e936..8a603da6eb87b142aab98617e26a211c87efcdde 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <netinet/in.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index f8b160f58c08cd31f3e496fa573d8c8c5f458ec9..ab13f14b32454889e3403149254f6a294900ec34 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2007, 2010-2015 Free Software Foundation, Inc.
+ * Copyright (C) 2006-2007, 2010-2016 Free Software Foundation, Inc.
  * Written by Simon Josefsson
  *
  * This program is free software: you can redistribute it and/or modify
index c14a2c1bf920b8e1488603424f9d2118e97c70a1..9041e4a047a74cccc440ace33b9ef5fbfcf42045 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of snprintf() function.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index 68b9ef15b28824ad076f357ed208486f28fc7524..0f240c5516a346172df62f9228207110dad47157 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdalign.h>.
-   Copyright 2009-2015 Free Software Foundation, Inc.
+   Copyright 2009-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
index 1da25d073380d0f5b0db1109153ed59f416c600c..45dc837675c6ffb15043f242072cffb395877d8e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdbool.h> substitute.
-   Copyright (C) 2002-2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2002-2007, 2009-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
index aa6ae549cc7eca28339134b930db78a96ef4d1ef..bfb72a01dc7d608acd1f5d73a4eb6efea640db44 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stddef.h> substitute.
-   Copyright (C) 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2009-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
index 8d54db2ecfea4f7d71878a2808ae7ee01af40ba6..7705fc706eee548f182c9d4baea8000dbad778cd 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdint.h> substitute.
-   Copyright (C) 2006-2015 Free Software Foundation, Inc.
+   Copyright (C) 2006-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
index cbec2a6ff043d8a31d6f7e3a8b2a610ea8aea2df..6cde888b692100edc3c0b439184429ebb7c64ff6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdio.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index b2da7ecc783aabe8a15e2f0629ae0ca91a8f2e76..a1fc0d814cfcfe3e5d79d4a4e09d967b9648b65a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdlib.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index 647d3b9b772c6d13f36738c52b0c70146c9eaeaa..f4c60f72c9c7f9494a874b57fb9f289322dd98b6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <string.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index 8a59a9f0c8a3fbe341751029e21437e9abf853c1..5eaa61a68e83d61e443a46c7b68d644a982ac841 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <strings.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index 19e41cffdcfd9483c077b8e56d022cdac8494cff..ee5bd78262c54aeed4f63051fb323e61e9a930d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2015 Free Software Foundation, Inc.
+ * Copyright (C) 2010-2016 Free Software Foundation, Inc.
  * Written by Eric Blake
  *
  * This program is free software: you can redistribute it and/or modify
index 771977e588fb5aef4bc87e4a6ad4036ee786b80c..e5a6bb10f8c222cd9b7f2d24aa0ef010e609c862 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of strverscmp() function.
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-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
index 8d8528b12bd5c8e245a664a2793c8c3bc4e148ec..a4f7108735be5416fee07d63a6eb0d4efc5408aa 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/socket.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index e4194a13b5ef10d90349ae4af638382fcd576921..8a3af941be5a4309a2e1e7a38b0359ee078dcc80 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/stat.h> substitute.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index 653ff467a3fd4bcf239fb02b6cb94a84e5965a18..44535b99dd2b02e55a43323afd9b2b5a8fcd176d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/time.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index 1ef3b90363d5c1233f9dabd701a8649f4c01a628..7f8fb6d1211edd3e2ac116d2fab58c6c610b32a3 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/types.h> substitute.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index 3878c96a77d15c9d4415a8fbbce733d53441b0eb..c433847918c969cd2f67f9486aef04444d6415fb 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/uio.h> substitute.
-   Copyright (C) 2011-2015 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
index e4a79b548124245985342ab096689bbfa9987159..7389be42564e097e9c00f3ee88e31bbf8a92d52b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of macros shared between <sys/wait.h> and <stdlib.h>.
-   Copyright (C) 2010-2015 Free Software Foundation, Inc.
+   Copyright (C) 2010-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
index 25bdcf0a0cc6217e23c72a8707749481952c908e..dec2b1338a65a0d7a544d24a2d1d87aec91e8282 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <time.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index 930b5e21b9c0f4a7ff8e87258bea533eed29f8a3..463ef578cc7accb31cff770dccc779a09398b63a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <unistd.h> substitute.
-   Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-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
index 8ff59006e24a49cdacc900d8ba1e79dffb6e0432..a75c004ffc1bcfa0f4e8cfbef144ecce106533de 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vasnprintf() and asnprintf() functions.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index b304275995c2f6a25e6b4395132b3a052a8b7db9..ebcbfc4d15085e1f57dc775d0dd19e6a4a570f18 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vasprintf() and asprintf() functions.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index a2a237f05a8d6a6510913db74939060eb283e917..62629444122023473c3750e3aa045adb0613893d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for vc-list-files
-# Copyright (C) 2008-2015 Free Software Foundation, Inc.
+# Copyright (C) 2008-2016 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
index 2882d32893dc9442fec034639259ba294c13811c..4358115ffed51636da71e2cea22678f96cf3b2f2 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for vc-list-files
-# Copyright (C) 2008-2015 Free Software Foundation, Inc.
+# Copyright (C) 2008-2016 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
index 640dc4265c421e4527fd8ea81c3b61f1259bb362..d7ca0538b01389870873d5a95048b28e096be957 100644 (file)
@@ -1,6 +1,6 @@
 /* Test the "verify" module.
 
-   Copyright (C) 2005, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-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
index a37ace535988c58ddd684b2d4b522ebe42f959e5..0a2ff0299181b49208e52d2f217888357174e4c5 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vsnprintf() function.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index e857ab5dd336b6305aca3cfbc266686fd5fbfc9b..e118048224f361fddfe3fd6cd7a911faae8bcb58 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <wchar.h> substitute.
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-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
index 76418aa5a069660de4eb9bb48177c88a1906361e..e6ff672b64a25f3481e4186ac298263e915d6ea2 100644 (file)
@@ -1,5 +1,5 @@
 /* Return a pointer to a zero-size object in memory.
-   Copyright (C) 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2009-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
index 861a5ff1d2ac4ecd9d5e6ffd4ae98cba00a5136b..a2c321ed0a302e2a53bb19292bf95833824e6c54 100644 (file)
@@ -1,6 +1,6 @@
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index fc53fd9057ba31f18086114b51613d8d78911af3..cd066f0fccbaa943b6707505f05e9849799e1325 100644 (file)
@@ -1,6 +1,6 @@
 /* Reentrant time functions like localtime_r.
 
-   Copyright (C) 2003, 2006-2007, 2010-2015 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2010-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 6c6a8e268c0fc44a6ebba64bdd17fa4d8816bcc9..72bad1c0527a11f30a7437fa3864ce07c9b410d7 100644 (file)
@@ -1,3 +1,4 @@
 #include <config.h>
 #define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
 #include "unistd.h"
+typedef int dummy;
index e32428d9d89524787334ae3092e6e9d411752d5e..fd16379ffbb4f9b96af4abe01bac2d909ab17eb0 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2015 Free Software Foundation, Inc.
+   Copyright (C) 2003-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index c291be1f9a07d6a0b8da8e75bc1bb9853ae755e6..2edb70c41f6092c9130051ec0a01c2c58dd63f02 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2015 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index a2c867104e412f1ab4145490bbbef7c4e873d794..d2bcfb59fa40ad78dba53b2b1ab7500a216d4717 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 8c945fd32cb780479f862ef4af8f3ba013cb79f1..a5e00a108c755f65cfb49ad6c0eac6c22fcec162 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2015 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 4784fb397acc3f0fdfd592be1d4cad29ebe56d7c..267de295917762f435cce05e4762555e4733184c 100644 (file)
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 0afd04dbeb1204840b9781a98b82c5b4c41534ca..63bd79651b8095676298de18f07c9119587b2ec0 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2015 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2016 Free Software Foundation, Inc.
    Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
 
    This program is free software; you can redistribute it and/or modify
index ae31e8d804c60cb9bc3d130bd23c7491886017e3..cf274410655c4c998ad37706286e02000399bf49 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2015 Free Software Foundation, Inc.
+   Copyright (C) 2007-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -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
index de3d92ed14fc1a8de2ac90e6660360f20608072a..c82712d3e28423d38a3565c4665b99a626e0af28 100644 (file)
@@ -1,6 +1,6 @@
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
index 964a8713182adf4945b8d2fcb4782f54ac1e9ec4..6391e1aff6162cbf310e8a4e05ddca646c860228 100644 (file)
--- a/lib/mem.h
+++ b/lib/mem.h
@@ -44,10 +44,6 @@ int safe_memcmp(const void *s1, const void *s2, size_t n)
         return memcmp(s1, s2, n);
 }
 
-#ifndef HAVE_SECURE_GETENV
-# define secure_getenv getenv
-#endif
-
 #define zrelease_mpi_key(mpi) if (*mpi!=NULL) { \
                 _gnutls_mpi_clear(*mpi); \
                 _gnutls_mpi_release(mpi); \