shishi-commit
[Top][All Lists]
Advanced

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

[SCM] GNU shishi branch, master, updated. shishi-0-0-43-19-gad6b46a


From: Simon Josefsson
Subject: [SCM] GNU shishi branch, master, updated. shishi-0-0-43-19-gad6b46a
Date: Thu, 20 May 2010 12:19:59 +0000

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

http://git.savannah.gnu.org/cgit/shishi.git/commit/?id=ad6b46abf3167e781fdba6ff2325cf741909bf1f

The branch, master has been updated
       via  ad6b46abf3167e781fdba6ff2325cf741909bf1f (commit)
       via  a93a8170e2c72349accf792c257a4c896974f2a2 (commit)
      from  00d207f1c328292123064640b74b5c9931b78522 (commit)

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

- Log -----------------------------------------------------------------
commit ad6b46abf3167e781fdba6ff2325cf741909bf1f
Author: Simon Josefsson <address@hidden>
Date:   Thu May 20 08:53:21 2010 +0200

    Update gnulib files, use valgrind-tests module.

commit a93a8170e2c72349accf792c257a4c896974f2a2
Author: Simon Josefsson <address@hidden>
Date:   Thu Apr 29 08:43:27 2010 +0200

    Update gnulib files.

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

Summary of changes:
 build-aux/c++defs.h                       |   36 +++++++--
 build-aux/gendocs.sh                      |   12 +++-
 build-aux/gnupload                        |    8 +-
 configure.ac                              |    1 -
 db/gl/m4/gnulib-common.m4                 |    8 ++-
 db/gl/wchar.in.h                          |    2 +-
 doc/gendocs_template                      |    2 +-
 gl/Makefile.am                            |   22 +++++-
 gl/m4/asm-underscore.m4                   |   48 +++++++++++
 gl/m4/gnulib-cache.m4                     |    3 +-
 gl/m4/gnulib-common.m4                    |    8 ++-
 gl/m4/gnulib-comp.m4                      |    6 ++
 gl/m4/netdb_h.m4                          |    7 ++-
 gl/m4/stdio_h.m4                          |    3 +-
 gl/m4/unistd_h.m4                         |   11 ++-
 m4/valgrind.m4 => gl/m4/valgrind-tests.m4 |    8 +-
 gl/netdb.in.h                             |   30 +++++++-
 gl/stdio-write.c                          |    2 -
 gl/stdio.in.h                             |   22 ++++-
 gl/unistd.in.h                            |   51 +++++++++++-
 gl/vasnprintf.c                           |    4 +-
 gl/verify.h                               |   41 ++++++++--
 gl/wchar.in.h                             |    2 +-
 maint.mk                                  |  121 +++++++++++++++++++++++------
 src/gl/error.c                            |   32 +++++++-
 src/gl/m4/gnulib-common.m4                |    8 ++-
 26 files changed, 420 insertions(+), 78 deletions(-)
 create mode 100644 gl/m4/asm-underscore.m4
 rename m4/valgrind.m4 => gl/m4/valgrind-tests.m4 (90%)

diff --git a/build-aux/c++defs.h b/build-aux/c++defs.h
index 7d71089..0c2fad7 100644
--- a/build-aux/c++defs.h
+++ b/build-aux/c++defs.h
@@ -221,10 +221,20 @@
    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
 # define _GL_CXXALIASWARN_1(func,namespace) \
    _GL_CXXALIASWARN_2 (func, namespace)
-# define _GL_CXXALIASWARN_2(func,namespace) \
-   _GL_WARN_ON_USE (func, \
-                    "The symbol ::" #func " refers to the system function. " \
-                    "Use " #namespace "::" #func " instead.")
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !__OPTIMIZE__
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+    _GL_WARN_ON_USE (func, \
+                     "The symbol ::" #func " refers to the system function. " \
+                     "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     extern __typeof__ (func) func
+# else
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
 #else
 # define _GL_CXXALIASWARN(func) \
     _GL_EXTERN_C int _gl_cxxalias_dummy
@@ -239,10 +249,20 @@
                         GNULIB_NAMESPACE)
 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) 
\
    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
-# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) 
\
-   _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
-                        "The symbol ::" #func " refers to the system function. 
" \
-                        "Use " #namespace "::" #func " instead.")
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !__OPTIMIZE__
+#  define 
_GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+    _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
+                         "The symbol ::" #func " refers to the system 
function. " \
+                         "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+#  define 
_GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+     extern __typeof__ (func) func
+# else
+#  define 
_GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
 #else
 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
     _GL_EXTERN_C int _gl_cxxalias_dummy
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 67d5b52..8cab8f6 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,7 +2,7 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2010-02-13.20
+scriptversion=2010-05-04.09
 
 # Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 # Free Software Foundation, Inc.
@@ -149,8 +149,16 @@ while test $# -gt 0; do
   shift
 done
 
+# For most of the following, the base name is just $PACKAGE
+base=$PACKAGE
+
 if test -n "$srcfile"; then
-  :
+  # but here, we use the basename of $srcfile
+  base=`basename "$srcfile"`
+  case $base in
+    *.txi|*.texi|*.texinfo) base=`echo "$base"|sed 's/\.[texinfo]*$//'`;;
+  esac
+  PACKAGE=$base
 elif test -s "$srcdir/$PACKAGE.texinfo"; then
   srcfile=$srcdir/$PACKAGE.texinfo
 elif test -s "$srcdir/$PACKAGE.texi"; then
diff --git a/build-aux/gnupload b/build-aux/gnupload
index c28a5cc..a7ce5e6 100755
--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2010-02-08.07; # UTC
+scriptversion=2010-04-25.17; # UTC
 
 # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
 # Foundation, Inc.
@@ -185,7 +185,7 @@ done
 
 dprint()
 {
-  echo "Running $*..."
+  echo "Running $* ..."
 }
 
 if $dry_run; then
@@ -249,7 +249,7 @@ echo
 if test $# -ne 0; then
   for file
   do
-    echo "Signing $file..."
+    echo "Signing $file ..."
     rm -f $file.sig
     echo "$passphrase" | $dbg $GPG --passphrase-fd 0 -ba -o $file.sig $file
   done
@@ -388,7 +388,7 @@ for dest in $to
 do
   for file
   do
-    echo "Uploading $file to $dest..."
+    echo "Uploading $file to $dest ..."
     stmt=
     files="$file $file.sig"
     destdir=`echo $dest | sed 's/[^:]*://'`
diff --git a/configure.ac b/configure.ac
index 52e0c08..a1e79b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -310,7 +310,6 @@ AC_MSG_NOTICE([user database root path $DBDIR])
 
 AC_DEFINE([xalloc_die], [shishi_xalloc_die], [Fix namespace of xalloc_die.])
 
-sj_VALGRIND
 sj_UPDATE_HEADER_VERSION([$srcdir/lib/shishi.h])
 
 AC_ARG_ENABLE([gcc-warnings],
diff --git a/db/gl/m4/gnulib-common.m4 b/db/gl/m4/gnulib-common.m4
index 54b2517..4c7ac30 100644
--- a/db/gl/m4/gnulib-common.m4
+++ b/db/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 19
+# gnulib-common.m4 serial 20
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,12 @@ AC_DEFUN([gl_COMMON_BODY], [
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
 ])
+  dnl Preparation for running test programs:
+  dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+  dnl to /dev/tty, so they can be redirected to log files.  Such diagnostics
+  dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+  LIBC_FATAL_STDERR_=1
+  export LIBC_FATAL_STDERR_
 ])
 
 # gl_MODULE_INDICATOR_CONDITION
diff --git a/db/gl/wchar.in.h b/db/gl/wchar.in.h
index dd41d35..88d47db 100644
--- a/db/gl/wchar.in.h
+++ b/db/gl/wchar.in.h
@@ -407,7 +407,7 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 # else
-#  if !defined wcwidth && address@hidden@
+#  if address@hidden@
 /* wcwidth exists but is not declared.  */
 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
 #  endif
diff --git a/doc/gendocs_template b/doc/gendocs_template
index 11b1af2..1e7ae84 100644
--- a/doc/gendocs_template
+++ b/doc/gendocs_template
@@ -93,7 +93,7 @@ Please send broken links and other corrections or suggestions 
to
 <a href="mailto:%%EMAIL%%";>&lt;%%EMAIL%%&gt;</a>.
 </p>
 
-<p>Copyright &copy; 2009 Free Software Foundation, Inc.</p>
+<p>Copyright &copy; 2010 Free Software Foundation, Inc.</p>
 
 <p>Verbatim copying and distribution of this entire article is
 permitted in any medium, provided this notice is preserved.</p>
diff --git a/gl/Makefile.am b/gl/Makefile.am
index f6d2f52..fa56f81 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -9,7 +9,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 --avoid=xalloc-die --libtool 
--macro-prefix=gl --no-vc-files arpa_inet autobuild base64 bind close connect 
crc crypto/arcfour crypto/gc-des crypto/gc-hmac-md5 crypto/gc-hmac-sha1 
crypto/gc-md4 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random fcntl 
fdl-1.3 gendocs getaddrinfo getdate getline getpass getsubopt gnupload gpl-3.0 
lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings minmax 
netinet_in read-file recvfrom select sendto shutdown signal socket sockets 
socklen stat stdint strcase strerror strndup strtok_r strverscmp sys_select 
sys_socket sys_stat sys_time time timegm unistd vasnprintf vasprintf warnings 
xalloc xgetdomainname xgethostname xstrndup xvasprintf
+# 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 --avoid=xalloc-die --libtool 
--macro-prefix=gl --no-vc-files arpa_inet autobuild base64 bind close connect 
crc crypto/arcfour crypto/gc-des crypto/gc-hmac-md5 crypto/gc-hmac-sha1 
crypto/gc-md4 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random fcntl 
fdl-1.3 gendocs getaddrinfo getdate getline getpass getsubopt gnupload gpl-3.0 
lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings minmax 
netinet_in read-file recvfrom select sendto shutdown signal socket sockets 
socklen stat stdint strcase strerror strndup strtok_r strverscmp sys_select 
sys_socket sys_stat sys_time time timegm unistd valgrind-tests vasnprintf 
vasprintf warnings xalloc xgetdomainname xgethostname xstrndup xvasprintf
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -418,8 +418,20 @@ EXTRA_libgnu_la_SOURCES += gai_strerror.c getaddrinfo.c
 
 ## begin gnulib module getdate
 
+# This rule overrides the Automake generated .y.c rule, to ensure that the
+# getdate.c file gets generated in the source directory, not in the build
+# directory.
+getdate.c: getdate.y
+       $(AM_V_GEN)$(SHELL) $(YLWRAP) $(srcdir)/getdate.y \
+                                     y.tab.c getdate.c \
+                                     y.tab.h getdate.h \
+                                     y.output getdate.output \
+                                     -- $(YACC) $(YFLAGS) $(AM_YFLAGS) && \
+       mv getdate.c getdate.c-t && \
+       mv getdate.c-t $(srcdir)/getdate.c
 libgnu_la_SOURCES += getdate.y
 BUILT_SOURCES += getdate.c
+MOSTLYCLEANFILES += getdate.c-t
 MAINTAINERCLEANFILES += getdate.c
 EXTRA_DIST += getdate.c
 
@@ -625,7 +637,7 @@ BUILT_SOURCES += netdb.h
 
 # We need the following in order to create <netdb.h> when the system
 # doesn't have one that works with the given compiler.
-netdb.h: netdb.in.h $(ARG_NONNULL_H)
+netdb.h: netdb.in.h $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -639,6 +651,7 @@ netdb.h: netdb.in.h $(ARG_NONNULL_H)
              -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
              -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/netdb.in.h; \
        } > address@hidden && \
        mv address@hidden $@
@@ -1018,6 +1031,7 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
              -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
              -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+             -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
@@ -1567,6 +1581,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
              -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
              -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
+             -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
              -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
              -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
              -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
@@ -1601,6 +1616,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
              -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
              -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+             -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
              -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
@@ -1628,10 +1644,12 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) 
$(WARN_ON_USE_H)
              -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
              -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+             -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
              -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
              -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+             -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
              -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
              -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
              -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
diff --git a/gl/m4/asm-underscore.m4 b/gl/m4/asm-underscore.m4
new file mode 100644
index 0000000..1736cc4
--- /dev/null
+++ b/gl/m4/asm-underscore.m4
@@ -0,0 +1,48 @@
+# asm-underscore.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
+
+# gl_ASM_SYMBOL_PREFIX
+# Tests for the prefix of C symbols at the assembly language level and the
+# linker level. This prefix is either an underscore or empty. Defines the
+# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
+# a stringified variant of this prefix.
+
+AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
+[
+  dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
+  dnl 1. It works only for GCC.
+  dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
+  AC_CACHE_CHECK(
+    [whether C symbols are prefixed with underscore at the linker level],
+    [gl_cv_prog_as_underscore],
+    [cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+     # Look for the assembly language name in the .s file.
+     AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c) >/dev/null 2>&1
+     if grep _foo conftest.s >/dev/null ; then
+       gl_cv_prog_as_underscore=yes
+     else
+       gl_cv_prog_as_underscore=no
+     fi
+     rm -f conftest*
+    ])
+  if test $gl_cv_prog_as_underscore = yes; then
+    USER_LABEL_PREFIX=_
+  else
+    USER_LABEL_PREFIX=
+  fi
+  AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
+    [Define to the prefix of C symbols at the assembler and linker level,
+     either an underscore or empty.])
+  ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+  AC_SUBST([ASM_SYMBOL_PREFIX])
+])
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 62b4928..6973a8c 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -15,7 +15,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 --avoid=xalloc-die --libtool --macro-prefix=gl 
--no-vc-files arpa_inet autobuild base64 bind close connect crc crypto/arcfour 
crypto/gc-des crypto/gc-hmac-md5 crypto/gc-hmac-sha1 crypto/gc-md4 
crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random fcntl fdl-1.3 gendocs 
getaddrinfo getdate getline getpass getsubopt gnupload gpl-3.0 lib-msvc-compat 
lib-symbol-versions maintainer-makefile manywarnings minmax netinet_in 
read-file recvfrom select sendto shutdown signal socket sockets socklen stat 
stdint strcase strerror strndup strtok_r strverscmp sys_select sys_socket 
sys_stat sys_time time timegm unistd vasnprintf vasprintf warnings xalloc 
xgetdomainname xgethostname xstrndup xvasprintf
+#   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 --avoid=xalloc-die --libtool --macro-prefix=gl 
--no-vc-files arpa_inet autobuild base64 bind close connect crc crypto/arcfour 
crypto/gc-des crypto/gc-hmac-md5 crypto/gc-hmac-sha1 crypto/gc-md4 
crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random fcntl fdl-1.3 gendocs 
getaddrinfo getdate getline getpass getsubopt gnupload gpl-3.0 lib-msvc-compat 
lib-symbol-versions maintainer-makefile manywarnings minmax netinet_in 
read-file recvfrom select sendto shutdown signal socket sockets socklen stat 
stdint strcase strerror strndup strtok_r strverscmp sys_select sys_socket 
sys_stat sys_time time timegm unistd valgrind-tests vasnprintf vasprintf 
warnings xalloc xgetdomainname xgethostname xstrndup xvasprintf
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gl/override])
@@ -74,6 +74,7 @@ gl_MODULES([
   time
   timegm
   unistd
+  valgrind-tests
   vasnprintf
   vasprintf
   warnings
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 54b2517..4c7ac30 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 19
+# gnulib-common.m4 serial 20
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,12 @@ AC_DEFUN([gl_COMMON_BODY], [
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
 ])
+  dnl Preparation for running test programs:
+  dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+  dnl to /dev/tty, so they can be redirected to log files.  Such diagnostics
+  dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+  LIBC_FATAL_STDERR_=1
+  export LIBC_FATAL_STDERR_
 ])
 
 # gl_MODULE_INDICATOR_CONDITION
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 40d67a0..9f734ac 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -146,6 +146,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module unistd:
   # Code from module unsetenv:
   # Code from module useless-if-before-free:
+  # Code from module valgrind-tests:
   # Code from module vasnprintf:
   # Code from module vasprintf:
   # Code from module vc-list-files:
@@ -487,6 +488,8 @@ AC_SUBST([LTALLOCA])
   gl_FUNC_UNSETENV
   gl_STDLIB_MODULE_INDICATOR([unsetenv])
   # Code from module useless-if-before-free:
+  # Code from module valgrind-tests:
+  gl_VALGRIND_TESTS
   # Code from module vasnprintf:
   gl_FUNC_VASNPRINTF
   # Code from module vasprintf:
@@ -560,6 +563,7 @@ changequote([, ])dnl
   AC_SUBST([gltests_WITNESS])
   gl_module_indicator_condition=$gltests_WITNESS
   m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+  gl_VALGRIND_TESTS
   m4_popdef([gl_MODULE_INDICATOR_CONDITION])
   m4_ifval(gltests_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
@@ -809,6 +813,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/alloca.m4
   m4/arcfour.m4
   m4/arpa_inet_h.m4
+  m4/asm-underscore.m4
   m4/autobuild.m4
   m4/base64.m4
   m4/bison.m4
@@ -918,6 +923,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/timespec.m4
   m4/tm_gmtoff.m4
   m4/unistd_h.m4
+  m4/valgrind-tests.m4
   m4/vasnprintf.m4
   m4/vasprintf.m4
   m4/warn-on-use.m4
diff --git a/gl/m4/netdb_h.m4 b/gl/m4/netdb_h.m4
index e04a2d1..c870fb6 100644
--- a/gl/m4/netdb_h.m4
+++ b/gl/m4/netdb_h.m4
@@ -1,4 +1,4 @@
-# netdb_h.m4 serial 8
+# netdb_h.m4 serial 9
 dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,11 @@ AC_DEFUN([gl_HEADER_NETDB],
     HAVE_NETDB_H=0
   fi
   AC_SUBST([HAVE_NETDB_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 <netdb.h>]],
+    [getaddrinfo freeaddrinfo gai_strerror getnameinfo])
 ])
 
 AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index 1d1d95e..f5650cd 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 30
+# stdio_h.m4 serial 31
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,7 @@ AC_DEFUN([gl_STDIO_H],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_C_INLINE])
+  AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
   gl_CHECK_NEXT_HEADERS([stdio.h])
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 8c2eec6..48d06c7 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 45
+# unistd_h.m4 serial 46
 dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -38,8 +38,9 @@ AC_DEFUN([gl_UNISTD_H],
     ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
     fsync ftruncate getcwd getdomainname getdtablesize getgroups
     gethostname getlogin getlogin_r getpagesize getusershell setusershell
-    endusershell lchown link linkat lseek pipe2 pread readlink readlinkat
-    rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep])
+    endusershell lchown link linkat lseek pipe2 pread pwrite readlink
+    readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
+    usleep])
 ])
 
 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -79,6 +80,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_LSEEK=0;            AC_SUBST([GNULIB_LSEEK])
   GNULIB_PIPE2=0;            AC_SUBST([GNULIB_PIPE2])
   GNULIB_PREAD=0;            AC_SUBST([GNULIB_PREAD])
+  GNULIB_PWRITE=0;           AC_SUBST([GNULIB_PWRITE])
   GNULIB_READLINK=0;         AC_SUBST([GNULIB_READLINK])
   GNULIB_READLINKAT=0;       AC_SUBST([GNULIB_READLINKAT])
   GNULIB_RMDIR=0;            AC_SUBST([GNULIB_RMDIR])
@@ -113,6 +115,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_LINKAT=1;          AC_SUBST([HAVE_LINKAT])
   HAVE_PIPE2=1;           AC_SUBST([HAVE_PIPE2])
   HAVE_PREAD=1;           AC_SUBST([HAVE_PREAD])
+  HAVE_PWRITE=1;          AC_SUBST([HAVE_PWRITE])
   HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
   HAVE_READLINKAT=1;      AC_SUBST([HAVE_READLINKAT])
   HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
@@ -140,10 +143,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_LINKAT=0;       AC_SUBST([REPLACE_LINKAT])
   REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
   REPLACE_PREAD=0;        AC_SUBST([REPLACE_PREAD])
+  REPLACE_PWRITE=0;       AC_SUBST([REPLACE_PWRITE])
   REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
   REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
   REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
   REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
+  REPLACE_TTYNAME_R=0;    AC_SUBST([REPLACE_TTYNAME_R])
   REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
   REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])
   REPLACE_USLEEP=0;       AC_SUBST([REPLACE_USLEEP])
diff --git a/m4/valgrind.m4 b/gl/m4/valgrind-tests.m4
similarity index 90%
rename from m4/valgrind.m4
rename to gl/m4/valgrind-tests.m4
index c460c34..e2434c6 100644
--- a/m4/valgrind.m4
+++ b/gl/m4/valgrind-tests.m4
@@ -1,4 +1,4 @@
-# valgrind.m4 serial 3
+# valgrind-tests.m4 serial 1
 dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,10 +6,10 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 dnl From Simon Josefsson
 
-# sj_VALGRIND()
-# -------------
+# gl_VALGRIND_TESTS()
+# -------------------
 # Check if valgrind is available, and set VALGRIND to it if available.
-AC_DEFUN([sj_VALGRIND],
+AC_DEFUN([gl_VALGRIND_TESTS],
 [
   AC_ARG_ENABLE(valgrind-tests,
     AS_HELP_STRING([--enable-valgrind-tests],
diff --git a/gl/netdb.in.h b/gl/netdb.in.h
index 73db46a..f800cac 100644
--- a/gl/netdb.in.h
+++ b/gl/netdb.in.h
@@ -41,6 +41,8 @@
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 /* Declarations for a platform that lacks <netdb.h>, or where it is
    incomplete.  */
 
@@ -186,7 +188,33 @@ extern int getnameinfo (const struct sockaddr *restrict 
sa, socklen_t salen,
 #  define NI_NUMERICSERV 2
 # endif
 
-#endif /* @GNULIB_GETADDRINFO@ */
+#elif defined GNULIB_POSIXCHECK
+
+# undef getaddrinfo
+# if HAVE_RAW_DECL_GETADDRINFO
+_GL_WARN_ON_USE (getaddrinfo, "getaddrinfo is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef freeaddrinfo
+# if HAVE_RAW_DECL_FREEADDRINFO
+_GL_WARN_ON_USE (freeaddrinfo, "freeaddrinfo is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef gai_strerror
+# if HAVE_RAW_DECL_GAI_STRERROR
+_GL_WARN_ON_USE (gai_strerror, "gai_strerror is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+# undef getnameinfo
+# if HAVE_RAW_DECL_GETNAMEINFO
+_GL_WARN_ON_USE (getnameinfo, "getnameinfo is unportable - "
+                 "use gnulib module getaddrinfo for portability");
+# endif
+
+#endif
 
 #endif /* _GL_NETDB_H */
 #endif /* _GL_NETDB_H */
diff --git a/gl/stdio-write.c b/gl/stdio-write.c
index f7da9e4..a6a0eb1 100644
--- a/gl/stdio-write.c
+++ b/gl/stdio-write.c
@@ -63,7 +63,6 @@
     }
 
 #  if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
-#   if !DEPENDS_ON_LIBINTL /* avoid collision with intl/printf.c */
 int
 printf (const char *format, ...)
 {
@@ -76,7 +75,6 @@ printf (const char *format, ...)
 
   return retval;
 }
-#   endif
 #  endif
 
 #  if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
diff --git a/gl/stdio.in.h b/gl/stdio.in.h
index dcb8ee5..c43848e 100644
--- a/gl/stdio.in.h
+++ b/gl/stdio.in.h
@@ -63,6 +63,10 @@
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
+/* Macros for stringification.  */
+#define _GL_STDIO_STRINGIZE(token) #token
+#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
+
 
 #if @GNULIB_DPRINTF@
 # if @REPLACE_DPRINTF@
@@ -640,16 +644,26 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms 
- "
 #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
 # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
      || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && 
@GNULIB_STDIO_H_SIGPIPE@)
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  if defined __GNUC__
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 /* Don't break __attribute__((format(printf,M,N))).  */
-#   define printf __printf__
-#  endif
-#  define GNULIB_overrides_printf 1
+#    define printf __printf__
+#   endif
 _GL_FUNCDECL_RPL_1 (__printf__, int,
                     (const char *format, ...)
+                    __asm__ (@ASM_SYMBOL_PREFIX@
+                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
                     __attribute__ ((__format__ (__printf__, 1, 2)))
                     _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
+#  else
+_GL_FUNCDECL_RPL (printf, int,
+                  (const char *format, ...)
+                  __attribute__ ((__format__ (__printf__, 1, 2)))
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, printf, int, (const char *format, ...));
+#  endif
+#  define GNULIB_overrides_printf 1
 # else
 _GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
 # endif
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 04d3a68..7914f22 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -86,7 +86,7 @@
 #endif
 
 #if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
-     || @GNULIB_PREAD@ || defined GNULIB_POSIXCHECK)
+     || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
 /* Get ssize_t.  */
 # include <sys/types.h>
 #endif
@@ -1016,6 +1016,40 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
 #endif
 
 
+#if @GNULIB_PWRITE@
+/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
+   Return the number of bytes written if successful, otherwise
+   set errno and return -1.  0 indicates nothing written.  See the
+   POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/pwrite.html>.  */
+# if @REPLACE_PWRITE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define pwrite rpl_pwrite
+#  endif
+_GL_FUNCDECL_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# else
+#  if address@hidden@
+_GL_FUNCDECL_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pwrite);
+#elif defined GNULIB_POSIXCHECK
+# undef pwrite
+# if HAVE_RAW_DECL_PWRITE
+_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
+                 "use gnulib module pwrite for portability");
+# endif
+#endif
+
+
 #if @GNULIB_READLINK@
 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
    bytes of it into BUF.  Return the number of bytes placed into BUF if
@@ -1164,12 +1198,23 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable 
- "
 #if @GNULIB_TTYNAME_R@
 /* Store at most BUFLEN characters of the pathname of the terminal FD is
    open on in BUF.  Return 0 on success, otherwise an error number.  */
-# if address@hidden@
+# if @REPLACE_TTYNAME_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ttyname_r
+#   define ttyname_r rpl_ttyname_r
+#  endif
+_GL_FUNCDECL_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen));
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (ttyname_r, int,
                   (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (ttyname_r, int,
                   (int fd, char *buf, size_t buflen));
+# endif
 _GL_CXXALIASWARN (ttyname_r);
 #elif defined GNULIB_POSIXCHECK
 # undef ttyname_r
diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
index 723e05d..e618901 100644
--- a/gl/vasnprintf.c
+++ b/gl/vasnprintf.c
@@ -2889,8 +2889,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       length += n;
                     }
                 }
-              }
 # endif
+              }
 #endif
 #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) 
&& !defined IN_LIBINTL
             else if ((dp->conversion == 'a' || dp->conversion == 'A')
@@ -5498,6 +5498,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     length += count;
                     break;
                   }
+#undef pad_ourselves
+#undef prec_ourselves
               }
           }
       }
diff --git a/gl/verify.h b/gl/verify.h
index bcd3f5a..4ad780c 100644
--- a/gl/verify.h
+++ b/gl/verify.h
@@ -69,13 +69,14 @@
      if the entity names are not disambiguated.  A workaround is to
      attach the current line number to the entity name:
 
-       #define GL_CONCAT0(x, y) x##y
-       #define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
-       extern struct {...} * GL_CONCAT(dummy,__LINE__);
+       #define _GL_CONCAT0(x, y) x##y
+       #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+       extern struct {...} * _GL_CONCAT (dummy, __LINE__);
 
      But this has the problem that two invocations of verify from
      within the same macro would collide, since the __LINE__ value
-     would be the same for both invocations.
+     would be the same for both invocations.  (The GCC __COUNTER__
+     macro solves this problem, but is not portable.)
 
      A solution is to use the sizeof operator.  It yields a number,
      getting rid of the identity of the type.  Declarations like
@@ -103,20 +104,41 @@
 
        extern int (*dummy (void)) [sizeof (struct {...})];
 
+   * GCC warns about duplicate declarations of the dummy function if
+     -Wredundant_decls is used.  GCC 4.3 and later have a builtin
+     __COUNTER__ macro that can let us generate unique identifiers for
+     each dummy function, to suppress this warning.
+
    * This implementation exploits the fact that GCC does not warn about
      the last declaration mentioned above.  If a future version of GCC
      introduces a warning for this, the problem could be worked around
-     by using code specialized to GCC, e.g.,:
+     by using code specialized to GCC, just as __COUNTER__ is already
+     being used if available.
 
        #if 4 <= __GNUC__
-       # define verify(R) \
-           extern int (* verify_function__ (void)) \
-                      [__builtin_constant_p (R) && (R) ? 1 : -1]
+       # define verify(R) [another version to keep GCC happy]
        #endif
 
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
 
+/* Concatenate two preprocessor tokens.  */
+# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+# define _GL_CONCAT0(x, y) x##y
+
+/* _GL_COUNTER is an integer, preferably one that changes each time we
+   use it.  Use __COUNTER__ if it works, falling back on __LINE__
+   otherwise.  __LINE__ isn't perfect, but it's better than a
+   constant.  */
+# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+#  define _GL_COUNTER __COUNTER__
+# else
+#  define _GL_COUNTER __LINE__
+# endif
+
+/* Generate a symbol with the given prefix, making it unique if
+   possible.  */
+# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
 
 /* Verify requirement R at compile-time, as an integer constant expression.
    Return 1.  */
@@ -135,6 +157,7 @@ template <int w>
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
+# define verify(R) \
+    extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)]
 
 #endif
diff --git a/gl/wchar.in.h b/gl/wchar.in.h
index dd41d35..88d47db 100644
--- a/gl/wchar.in.h
+++ b/gl/wchar.in.h
@@ -407,7 +407,7 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 # else
-#  if !defined wcwidth && address@hidden@
+#  if address@hidden@
 /* wcwidth exists but is not declared.  */
 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
 #  endif
diff --git a/maint.mk b/maint.mk
index 33803f3..3bcab0c 100644
--- a/maint.mk
+++ b/maint.mk
@@ -148,16 +148,6 @@ local-check :=                                             
                \
     $(filter-out $(local-checks-to-skip), $(local-checks-available)))
 
 syntax-check: $(local-check)
-#      @grep -nE '#  *include <(limits|std(def|arg|bool))\.h>'         \
-#          $$(find -type f -name '*.[chly]') &&                        \
-#        { echo '$(ME): found conditional include' 1>&2;               \
-#          exit 1; } || :
-
-#      grep -nE '^#  *include <(string|stdlib)\.h>'                    \
-#          $(srcdir)/{lib,src}/*.[chy] &&                              \
-#        { echo '$(ME): FIXME' 1>&2;                                   \
-#          exit 1; } || :
-# FIXME: don't allow `#include .strings\.h' anywhere
 
 # _sc_search_regexp
 #
@@ -554,6 +544,13 @@ sc_prohibit_signal_without_use:
        re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>'          \
          $(_sc_header_without_use)
 
+# Prohibit the inclusion of strings.h without a sensible use.
+# Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible.
+sc_prohibit_strings_without_use:
+       @h='<strings.h>'                                                \
+       re='\<(strn?casecmp|ffs(ll)?)\>'                                \
+         $(_sc_header_without_use)
+
 # Get the list of symbol names with this:
 # perl -lne '/^# *define (\w+)\(/ and print $1' lib/intprops.h|grep -v '^s'|fmt
 _intprops_names =                                                      \
@@ -645,6 +642,67 @@ sc_useless_cpp_parens:
        halt='found useless parentheses in cpp directive'               \
          $(_sc_search_regexp)
 
+# List headers for which HAVE_HEADER_H is always true, assuming you are
+# using the appropriate gnulib module.  CAUTION: for each "unnecessary"
+# #if HAVE_HEADER_H that you remove, be sure that your project explicitly
+# requires the gnulib module that guarantees the usability of that header.
+gl_assured_headers_ = \
+  cd $(gnulib_dir)/lib && echo *.in.h|sed 's/\.in\.h//g'
+
+# Convert the list of names to upper case, and replace each space with "|".
+az_ = abcdefghijklmnopqrstuvwxyz
+AZ_ = ABCDEFGHIJKLMNOPQRSTUVWXYZ
+gl_header_upper_case_or_ =                                             \
+  $$($(gl_assured_headers_)                                            \
+    | tr $(az_)/.- $(AZ_)___                                           \
+    | tr -s ' ' '|'                                                    \
+    )
+sc_prohibit_always_true_header_tests:
+       @or=$(gl_header_upper_case_or_);                                \
+       re="HAVE_($$or)_H";                                             \
+       prohibit='\<'"$$re"'\>'                                         \
+       halt='do not test the above HAVE_<header>_H symbol(s);\n'\
+'  with the corresponding gnulib module, they are always true'         \
+         $(_sc_search_regexp)
+
+# ==================================================================
+gl_other_headers_ ?= \
+  intprops.h   \
+  openat.h     \
+  stat-macros.h
+
+# Perl -lne code to extract "significant" cpp-defined symbols from a
+# gnulib header file, eliminating a few common false-positives.
+gl_extract_significant_defines_ = \
+  /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/\
+    && $$2 !~ /(?:rpl_|_used_without_)/\
+    && $$1 !~ /^(?:NSIG|ATTRIBUTE_NORETURN)$$/\
+    and print $$1
+
+# Create a list of regular expressions matching the names
+# of macros that are guaranteed to be defined by parts of gnulib.
+define def_sym_regex
+       gen_h=$(gl_generated_headers_);                                 \
+       (cd $(gnulib_dir)/lib;                                          \
+         for f in *.in.h $(gl_other_headers_); do                      \
+           perl -lne '$(gl_extract_significant_defines_)' $$f;         \
+         done;                                                         \
+       ) | sort -u                                                     \
+         | sed 's/^/^ *# *define /;s/$$/\\>/'
+endef
+
+# Don't define macros that we already get from gnulib header files.
+sc_prohibit_always-defined_macros:
+       @if test -d $(gnulib_dir); then                                 \
+         case $$(echo all: | grep -l -f - Makefile) in Makefile);; *)  \
+           echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
+         esac;                                                         \
+         $(def_sym_regex) | grep -f - $$($(VC_LIST_EXCEPT))            \
+           && { echo '$(ME): define the above via some gnulib .h file' \
+                 1>&2;  exit 1; } || :;                                \
+       fi
+# ==================================================================
+
 # Prohibit checked in backup files.
 sc_prohibit_backup_files:
        @$(VC_LIST) | grep '~$$' &&                             \
@@ -915,20 +973,22 @@ sc_copyright_check:
 # sets PATH correctly.  This is an inexpensive way to ensure that
 # the other init.sh-using tests also get it right.
 _hv_file ?= $(srcdir)/tests/help-version
-_hv_regex ?= ^ *\. [^ ]*/init\.sh
+_hv_regex_weak ?= ^ *\. .*/init\.sh"
+_hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh"
 sc_cross_check_PATH_usage_in_tests:
        @if test -f $(_hv_file); then                                   \
-         if grep -l 'VERSION mismatch' $(_hv_file) >/dev/null          \
-             && grep -lE '$(_hv_regex)' $(_hv_file) >/dev/null; then   \
-           good=$$(grep -E '$(_hv_regex)' < $(_hv_file));              \
-           grep -LFx "$$good"                                          \
-                 $$(grep -lE '$(_hv_regex)' $$($(VC_LIST_EXCEPT)))     \
-               | grep . &&                                             \
-             { echo "$(ME): the above files use path_prepend_ inconsistently" \
-                 1>&2; exit 1; } || :;                                 \
-         fi;                                                           \
-       else                                                            \
-         echo "$@: skipped: no such file: $(_hv_file)";                \
+         grep -l 'VERSION mismatch' $(_hv_file) >/dev/null             \
+           || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2;    \
+                exit 0; };                                             \
+         grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null         \
+           || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \
+                exit 1; };                                             \
+         good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file));           \
+         grep -LFx "$$good"                                            \
+               $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT)))  \
+             | grep . &&                                               \
+           { echo "$(ME): the above files use path_prepend_ inconsistently" \
+               1>&2; exit 1; } || :;                                   \
        fi
 
 # #if HAVE_... will evaluate to false for any non numeric string.
@@ -972,8 +1032,16 @@ gpg_key_ID ?= \
      && gpgv .ann-sig - < /dev/null 2>&1 \
          | sed -n '/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig)
 
+translation_project_ ?= address@hidden
+announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT)
+announcement_mail_headers_ ?=                                          \
+To: address@hidden                                                     \
+Cc: $(announcement_Cc_)                                                        
\
+Mail-Followup-To: $(PACKAGE_BUGREPORT)
+
 announcement: NEWS ChangeLog $(rel-files)
        @$(build_aux)/announce-gen                                      \
+           --mail-headers='$(announcement_mail_headers_)'              \
            --release-type=$(RELEASE_TYPE)                              \
            --package=$(PACKAGE)                                        \
            --prev=$(PREV_VERSION)                                      \
@@ -1057,12 +1125,17 @@ release-prep:
        $(VC) commit -F .ci-msg -a
        rm .ci-msg
 
+# Override this with e.g., -s $(srcdir)/some_other_name.texi
+# if the default $(PACKAGE)-derived name doesn't apply.
+gendocs_options_ ?=
+
 .PHONY: web-manual
 web-manual:
        @test -z "$(manual_title)" \
          && { echo define manual_title in cfg.mk 1>&2; exit 1; } || :
        @cd '$(srcdir)/doc'; \
-         $(SHELL) ../build-aux/gendocs.sh -o '$(abs_builddir)/doc/manual' \
+         $(SHELL) ../build-aux/gendocs.sh $(gendocs_options_) \
+            -o '$(abs_builddir)/doc/manual' \
             --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
            "$(PACKAGE_NAME) - $(manual_title)"
        @echo " *** Upload the doc/manual directory to web-cvs."
@@ -1104,10 +1177,12 @@ refresh-po:
        echo 'address@hidden' >> $(PODIR)/LINGUAS && \
        ls $(PODIR)/*.po | sed 's/\.po//' | sed 's,$(PODIR)/,,' | sort >> 
$(PODIR)/LINGUAS
 
+ # Running indent once is not idempotent, but running it twice is.
 INDENT_SOURCES ?= $(C_SOURCES)
 .PHONY: indent
 indent:
        indent $(INDENT_SOURCES)
+       indent $(INDENT_SOURCES)
 
 # If you want to set UPDATE_COPYRIGHT_* environment variables,
 # put the assignments in this variable.
diff --git a/src/gl/error.c b/src/gl/error.c
index c79e8d4..ed9dba0 100644
--- a/src/gl/error.c
+++ b/src/gl/error.c
@@ -88,6 +88,15 @@ extern void __error_at_line (int status, int errnum, const 
char *file_name,
 # include <fcntl.h>
 # include <unistd.h>
 
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the Win32 API functions.  */
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+# endif
+
+/* The gnulib override of fcntl is not needed in this file.  */
+# undef fcntl
+
 # if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
 #  ifndef HAVE_DECL_STRERROR_R
 "this configure-time declaration test was not run"
@@ -104,10 +113,29 @@ extern char *program_name;
 # endif /* HAVE_STRERROR_R || defined strerror_r */
 #endif  /* not _LIBC */
 
+#if !_LIBC
+/* Return non-zero if FD is open.  */
+static inline int
+is_open (int fd)
+{
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  /* On Win32: The initial state of unassigned standard file descriptors is
+     that they are open but point to an INVALID_HANDLE_VALUE.  There is no
+     fcntl, and the gnulib replacement fcntl does not support F_GETFL.  */
+  return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+# else
+#  ifndef F_GETFL
+#   error Please port fcntl to your platform
+#  endif
+  return 0 <= fcntl (fd, F_GETFL);
+# endif
+}
+#endif
+
 static inline void
 flush_stdout (void)
 {
-#if !_LIBC && defined F_GETFL
+#if !_LIBC
   int stdout_fd;
 
 # if GNULIB_FREOPEN_SAFER
@@ -124,7 +152,7 @@ flush_stdout (void)
   /* POSIX states that fflush (stdout) after fclose is unspecified; it
      is safe in glibc, but not on all other platforms.  fflush (NULL)
      is always defined, but too draconian.  */
-  if (0 <= stdout_fd && 0 <= fcntl (stdout_fd, F_GETFL))
+  if (0 <= stdout_fd && is_open (stdout_fd))
 #endif
     fflush (stdout);
 }
diff --git a/src/gl/m4/gnulib-common.m4 b/src/gl/m4/gnulib-common.m4
index 54b2517..4c7ac30 100644
--- a/src/gl/m4/gnulib-common.m4
+++ b/src/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 19
+# gnulib-common.m4 serial 20
 dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,12 @@ AC_DEFUN([gl_COMMON_BODY], [
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
 ])
+  dnl Preparation for running test programs:
+  dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+  dnl to /dev/tty, so they can be redirected to log files.  Such diagnostics
+  dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+  LIBC_FATAL_STDERR_=1
+  export LIBC_FATAL_STDERR_
 ])
 
 # gl_MODULE_INDICATOR_CONDITION


hooks/post-receive
-- 
GNU shishi



reply via email to

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