summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-05-29 19:39:45 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-05-29 19:39:45 +0200
commitcff5deb33cf3726dfaff235ba9536f4de51f0a3f (patch)
tree263afe12521cf3907b76740bbaad10588b18e9d3
parent793fb125b10aa429819a3891d8d7ca2ca967370c (diff)
downloadgnutls-cff5deb33cf3726dfaff235ba9536f4de51f0a3f.tar.gz
updated gnulib
-rw-r--r--gl/Makefile.am19
-rw-r--r--gl/argp-help.c2
-rw-r--r--gl/intprops.h2
-rw-r--r--gl/m4/extensions.m42
-rw-r--r--gl/m4/extern-inline.m414
-rw-r--r--gl/m4/frexp.m410
-rw-r--r--gl/m4/getdtablesize.m417
-rw-r--r--gl/m4/gnulib-comp.m412
-rw-r--r--gl/m4/intl.m48
-rw-r--r--gl/m4/lock.m43
-rw-r--r--gl/m4/manywarnings.m46
-rw-r--r--gl/m4/po.m48
-rw-r--r--gl/m4/putenv.m44
-rw-r--r--gl/m4/stdalign.m45
-rw-r--r--gl/m4/sys_types_h.m44
-rw-r--r--gl/m4/warnings.m415
-rw-r--r--gl/stdio.in.h14
-rw-r--r--gl/sys_select.in.h16
-rw-r--r--gl/sys_time.in.h9
-rw-r--r--gl/tests/Makefile.am19
-rw-r--r--gl/tests/getdtablesize.c86
-rw-r--r--gl/tests/malloca.c29
-rw-r--r--gl/tests/malloca.h2
-rw-r--r--gl/tests/putenv.c82
-rw-r--r--gl/tests/test-dup2.c7
-rw-r--r--gl/tests/test-getaddrinfo.c5
-rw-r--r--gl/tests/test-getdtablesize.c34
-rw-r--r--gl/tests/test-snprintf.c2
-rw-r--r--gl/tests/test-sys_socket.c2
-rw-r--r--gl/tests/test-vasnprintf.c2
-rw-r--r--gl/tests/test-vsnprintf.c2
-rw-r--r--gl/unistd.in.h4
-rw-r--r--maint.mk2
33 files changed, 339 insertions, 109 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 426bcec58d..47c67c8531 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -23,7 +23,7 @@
# 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 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettime hash-pjw-bare havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r timer-time timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings
-AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
+AUTOMAKE_OPTIONS = 1.9.6 gnits subdir-objects
SUBDIRS =
noinst_HEADERS =
@@ -561,15 +561,16 @@ EXTRA_libgnu_la_SOURCES += getsubopt.c
## begin gnulib module gettext
-# This is for those projects which use "gettextize --intl" to put a source-code
-# copy of libintl into their package. In such projects, every Makefile.am needs
+# If your project uses "gettextize --intl" to put a source-code
+# copy of libintl into the package, every Makefile.am needs
# -I$(top_builddir)/intl, so that <libintl.h> can be found in this directory.
-# For the Makefile.ams in other directories it is the maintainer's
-# responsibility; for the one from gnulib we do it here.
-# This option has no effect when the user disables NLS (because then the intl
-# directory contains no libintl.h file) or when the project does not use
-# "gettextize --intl".
-AM_CPPFLAGS += -I$(top_builddir)/intl
+# Here's one way to do this:
+#AM_CPPFLAGS += -I$(top_builddir)/intl
+# This option has no effect when the user disables NLS (because then
+# the intl directory contains no libintl.h file). This option is not
+# enabled by default because the intl directory might not exist if
+# your project does not use "gettext --intl", and some compilers
+# complain about -I options applied to nonexistent directories.
EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
diff --git a/gl/argp-help.c b/gl/argp-help.c
index 354f1e22f5..85def445ed 100644
--- a/gl/argp-help.c
+++ b/gl/argp-help.c
@@ -649,7 +649,7 @@ hol_find_entry (struct hol *hol, const char *name)
return 0;
}
-/* If an entry with the long option NAME occurs in HOL, set it's special
+/* If an entry with the long option NAME occurs in HOL, set its special
sort position to GROUP. */
static void
hol_set_group (struct hol *hol, const char *name, int group)
diff --git a/gl/intprops.h b/gl/intprops.h
index b473052d11..f57f9b4dda 100644
--- a/gl/intprops.h
+++ b/gl/intprops.h
@@ -89,7 +89,7 @@
/* Return 1 if the __typeof__ keyword works. This could be done by
'configure', but for now it's easier to do it by hand. */
-#if 2 <= __GNUC__ || 0x5110 <= __SUNPRO_C
+#if 2 <= __GNUC__ || defined __IBM__TYPEOF__ || 0x5110 <= __SUNPRO_C
# define _GL_HAVE___TYPEOF__ 1
#else
# define _GL_HAVE___TYPEOF__ 0
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index 07ba376c0e..e30f12206c 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -6,7 +6,7 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
# Autoconf. Perhaps we can remove this once we can assume Autoconf
# 2.70 or later everywhere, but since Autoconf mutates rapidly
# enough in this area it's likely we'll need to redefine
diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4
index 0152f29326..94b46dde07 100644
--- a/gl/m4/extern-inline.m4
+++ b/gl/m4/extern-inline.m4
@@ -21,13 +21,21 @@ AC_DEFUN([gl_EXTERN_INLINE],
Suppress extern inline with HP-UX cc, as it appears to be broken; see
<http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
- Suppress the use of extern inline on Apple's platforms,
- as Libc-825.25 (2012-09-19) is incompatible with it; see
+ Suppress extern inline with Sun C in standards-conformance mode, as it
+ mishandles inline functions that call each other. E.g., for 'inline void f
+ (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+ 'reference to static identifier "f" in extern inline function'.
+ This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+
+ Suppress the use of extern inline on Apple's platforms, as Libc at least
+ through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
Perhaps Apple will fix this some day. */
#if ((__GNUC__ \
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
- : 199901L <= __STDC_VERSION__ && !defined __HP_cc) \
+ : (199901L <= __STDC_VERSION__ \
+ && !defined __HP_cc \
+ && !(defined __SUNPRO_C && __STDC__))) \
&& !defined __APPLE__)
# define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline
diff --git a/gl/m4/frexp.m4 b/gl/m4/frexp.m4
index 39097923e4..2eb98a1dcd 100644
--- a/gl/m4/frexp.m4
+++ b/gl/m4/frexp.m4
@@ -1,4 +1,4 @@
-# frexp.m4 serial 14
+# frexp.m4 serial 15
dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -93,7 +93,7 @@ AC_DEFUN([gl_FUNC_FREXP_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CHECK_FUNCS_ONCE([alarm])
+ AC_CHECK_DECLS_ONCE([alarm])
AC_CACHE_CHECK([whether frexp works], [gl_cv_func_frexp_works],
[
AC_RUN_IFELSE(
@@ -101,7 +101,8 @@ AC_DEFUN([gl_FUNC_FREXP_WORKS],
#include <float.h>
#include <math.h>
#include <string.h>
-#if HAVE_ALARM
+#if HAVE_DECL_ALARM
+# include <signal.h>
# include <unistd.h>
#endif
/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
@@ -124,9 +125,10 @@ int main()
int i;
volatile double x;
double zero = 0.0;
-#if HAVE_ALARM
+#if HAVE_DECL_ALARM
/* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
number. Let the test fail in this case. */
+ signal (SIGALRM, SIG_DFL);
alarm (5);
#endif
/* Test on denormalized numbers. */
diff --git a/gl/m4/getdtablesize.m4 b/gl/m4/getdtablesize.m4
new file mode 100644
index 0000000000..8f04b3b8c2
--- /dev/null
+++ b/gl/m4/getdtablesize.m4
@@ -0,0 +1,17 @@
+# getdtablesize.m4 serial 4
+dnl Copyright (C) 2008-2013 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_GETDTABLESIZE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([getdtablesize])
+ if test $ac_cv_func_getdtablesize != yes; then
+ HAVE_GETDTABLESIZE=0
+ fi
+])
+
+# Prerequisites of lib/getdtablesize.c.
+AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:])
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 5d468296c6..f25edc8806 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -124,6 +124,8 @@ AC_DEFUN([gl_EARLY],
# Code from module getcwd-lgpl-tests:
# Code from module getdelim:
# Code from module getdelim-tests:
+ # Code from module getdtablesize:
+ # Code from module getdtablesize-tests:
# Code from module getline:
# Code from module getline-tests:
# Code from module getopt-gnu:
@@ -921,6 +923,12 @@ changequote([, ])dnl
AC_LIBOBJ([getcwd-lgpl])
fi
gl_UNISTD_MODULE_INDICATOR([getcwd])
+ gl_FUNC_GETDTABLESIZE
+ if test $HAVE_GETDTABLESIZE = 0; then
+ AC_LIBOBJ([getdtablesize])
+ gl_PREREQ_GETDTABLESIZE
+ fi
+ gl_UNISTD_MODULE_INDICATOR([getdtablesize])
gl_FUNC_GETPAGESIZE
if test $REPLACE_GETPAGESIZE = 1; then
AC_LIBOBJ([getpagesize])
@@ -940,6 +948,7 @@ changequote([, ])dnl
gl_LONG_DOUBLE_EXPONENT_LOCATION
AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
gl_LOCK
+ gl_MODULE_INDICATOR([lock])
gl_FUNC_LSTAT
if test $REPLACE_LSTAT = 1; then
AC_LIBOBJ([lstat])
@@ -1357,6 +1366,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/getaddrinfo.m4
m4/getcwd.m4
m4/getdelim.m4
+ m4/getdtablesize.m4
m4/getline.m4
m4/getopt.m4
m4/getpagesize.m4
@@ -1561,6 +1571,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-getaddrinfo.c
tests/test-getcwd-lgpl.c
tests/test-getdelim.c
+ tests/test-getdtablesize.c
tests/test-getline.c
tests/test-getopt.c
tests/test-getopt.h
@@ -1671,6 +1682,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests=lib/fdopen.c
tests=lib/ftruncate.c
tests=lib/getcwd-lgpl.c
+ tests=lib/getdtablesize.c
tests=lib/getpagesize.c
tests=lib/glthread/lock.c
tests=lib/glthread/lock.h
diff --git a/gl/m4/intl.m4 b/gl/m4/intl.m4
index b8cc79f8a3..486b5cc64e 100644
--- a/gl/m4/intl.m4
+++ b/gl/m4/intl.m4
@@ -1,4 +1,4 @@
-# intl.m4 serial 17d
+# intl.m4 serial 22 (gettext-0.18.2)
dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
-AC_PREREQ([2.53])
+AC_PREREQ([2.60])
dnl Checks for all prerequisites of the intl subdirectory,
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
@@ -55,7 +55,7 @@ AC_DEFUN([AM_INTL_SUBDIR],
[AC_DEFINE([ptrdiff_t], [long],
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
])
- AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
+ AC_CHECK_HEADERS([features.h stddef.h stdlib.h string.h])
AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
@@ -295,6 +295,6 @@ AC_DEFUN([gt_CHECK_DECL],
else
gt_value=0
fi
- AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
+ AC_DEFINE_UNQUOTED([HAVE_DECL_]m4_translit($1, [a-z], [A-Z]), [$gt_value],
[Define to 1 if you have the declaration of '$1', and to 0 if you don't.])
])
diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4
index d3fc1eff01..aae1701a0a 100644
--- a/gl/m4/lock.m4
+++ b/gl/m4/lock.m4
@@ -24,6 +24,9 @@ AC_DEFUN([gl_LOCK],
[[
#if __FreeBSD__ == 4
error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
+ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
#else
int x = (int)PTHREAD_MUTEX_RECURSIVE;
return !x;
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index 45a30afda7..be6d4c91c5 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -98,6 +98,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-W \
-Wabi \
-Waddress \
+ -Waggressive-loop-optimizations \
-Wall \
-Warray-bounds \
-Wattributes \
@@ -125,7 +126,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wformat-security \
-Wformat-y2k \
-Wformat-zero-length \
- -Wformat=2 \
-Wfree-nonheap-object \
-Wignored-qualifiers \
-Wimplicit \
@@ -143,9 +143,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wmissing-braces \
-Wmissing-declarations \
-Wmissing-field-initializers \
- -Wmissing-format-attribute \
-Wmissing-include-dirs \
- -Wmissing-noreturn \
-Wmissing-parameter-type \
-Wmissing-prototypes \
-Wmudflap \
@@ -166,6 +164,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wpointer-sign \
-Wpointer-to-int-cast \
-Wpragmas \
+ -Wreturn-local-addr \
-Wreturn-type \
-Wsequence-point \
-Wshadow \
@@ -187,7 +186,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
-Wtype-limits \
-Wuninitialized \
-Wunknown-pragmas \
- -Wunreachable-code \
-Wunsafe-loop-optimizations \
-Wunused \
-Wunused-but-set-parameter \
diff --git a/gl/m4/po.m4 b/gl/m4/po.m4
index 5fde6f292e..f395723435 100644
--- a/gl/m4/po.m4
+++ b/gl/m4/po.m4
@@ -1,4 +1,4 @@
-# po.m4 serial 17c
+# po.m4 serial 20 (gettext-0.18.2)
dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
-AC_PREREQ([2.50])
+AC_PREREQ([2.60])
dnl Checks for all prerequisites of the po subdirectory.
AC_DEFUN([AM_PO_SUBDIRS],
@@ -102,7 +102,7 @@ changequote([,])dnl
case "$ac_file" in */Makefile.in)
# Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
- ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
# In autoconf-2.13 it is called $ac_given_srcdir.
# In autoconf-2.50 it is called $srcdir.
@@ -227,7 +227,7 @@ AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
changequote(,)dnl
# Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
- ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
# In autoconf-2.13 it is called $ac_given_srcdir.
# In autoconf-2.50 it is called $srcdir.
diff --git a/gl/m4/putenv.m4 b/gl/m4/putenv.m4
index 03ed4f97db..c33b5b5170 100644
--- a/gl/m4/putenv.m4
+++ b/gl/m4/putenv.m4
@@ -1,4 +1,4 @@
-# putenv.m4 serial 19
+# putenv.m4 serial 20
dnl Copyright (C) 2002-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -52,5 +52,5 @@ AC_DEFUN([gl_FUNC_PUTENV],
# Prerequisites of lib/putenv.c.
AC_DEFUN([gl_PREREQ_PUTENV],
[
- AC_CHECK_FUNCS([_putenv])
+ AC_CHECK_DECLS([_putenv])
])
diff --git a/gl/m4/stdalign.m4 b/gl/m4/stdalign.m4
index 3d7993dbec..a866ff670b 100644
--- a/gl/m4/stdalign.m4
+++ b/gl/m4/stdalign.m4
@@ -33,8 +33,9 @@ AC_DEFUN([gl_STDALIGN_H],
#if \
(__GNUC__ || __IBMC__ || __IBMCPP__ \
|| 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
- int alignas (8) alignas_int = 1;
- char test_alignas[_Alignof (alignas_int) == 8 ? 1 : -1];
+ struct alignas_test { char c; char alignas (8) alignas_8; };
+ char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
+ ? 1 : -1];
#endif
]])],
[gl_cv_header_working_stdalign_h=yes],
diff --git a/gl/m4/sys_types_h.m4 b/gl/m4/sys_types_h.m4
index 6132727f87..d15c1b3709 100644
--- a/gl/m4/sys_types_h.m4
+++ b/gl/m4/sys_types_h.m4
@@ -1,10 +1,10 @@
-# sys_types_h.m4 serial 4
+# sys_types_h.m4 serial 5
dnl Copyright (C) 2011-2013 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_SYS_TYPES_H],
+AC_DEFUN_ONCE([gl_SYS_TYPES_H],
[
AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
gl_NEXT_HEADERS([sys/types.h])
diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4
index 4b2ac38501..184873283b 100644
--- a/gl/m4/warnings.m4
+++ b/gl/m4/warnings.m4
@@ -1,4 +1,4 @@
-# warnings.m4 serial 7
+# warnings.m4 serial 8
dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,7 @@ AC_DEFUN([gl_COMPILER_OPTION_IF],
AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
gl_save_compiler_FLAGS="$gl_Flags"
- gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $1"])
+ gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors $1"])
AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
[AS_VAR_SET(gl_Warn, [yes])],
[AS_VAR_SET(gl_Warn, [no])])
@@ -38,6 +38,14 @@ AS_VAR_POPDEF([gl_Flags])dnl
AS_VAR_POPDEF([gl_Warn])dnl
])
+# gl_UNKNOWN_WARNINGS_ARE_ERRORS
+# ------------------------------
+# Clang doesn't complain about unknown warning options unless one also
+# specifies -Wunknown-warning-option -Werror. Detect this.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
+[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
+ [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
+ [gl_unknown_warnings_are_errors=])])
# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
# [PROGRAM = AC_LANG_PROGRAM()])
@@ -47,7 +55,8 @@ AS_VAR_POPDEF([gl_Warn])dnl
#
# If VARIABLE is a variable name, AC_SUBST it.
AC_DEFUN([gl_WARN_ADD],
-[gl_COMPILER_OPTION_IF([$1],
+[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+gl_COMPILER_OPTION_IF([$1],
[gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
[],
[$3])
diff --git a/gl/stdio.in.h b/gl/stdio.in.h
index d6af99ca77..06cbad00d3 100644
--- a/gl/stdio.in.h
+++ b/gl/stdio.in.h
@@ -579,13 +579,23 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
<http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
which sometimes causes an unwanted diagnostic for fwrite calls.
This affects only function declaration attributes under certain
- versions of gcc, and is not needed for C++. */
+ versions of gcc and clang, and is not needed for C++. */
# if (0 < __USE_FORTIFY_LEVEL \
&& __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
&& 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
&& !defined __cplusplus)
# undef fwrite
-# define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; })
+# undef fwrite_unlocked
+extern size_t __REDIRECT (rpl_fwrite,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite);
+extern size_t __REDIRECT (rpl_fwrite_unlocked,
+ (const void *__restrict, size_t, size_t,
+ FILE *__restrict),
+ fwrite_unlocked);
+# define fwrite rpl_fwrite
+# define fwrite_unlocked rpl_fwrite_unlocked
# endif
# endif
_GL_CXXALIASWARN (fwrite);
diff --git a/gl/sys_select.in.h b/gl/sys_select.in.h
index 521ccef321..2af6bfe6f6 100644
--- a/gl/sys_select.in.h
+++ b/gl/sys_select.in.h
@@ -21,23 +21,27 @@
/* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h>
both include <sys/select.h>.
+ On Cygwin, <sys/time.h> includes <sys/select.h>.
Simply delegate to the system's header in this case. */
#if (@HAVE_SYS_SELECT_H@ \
- && ((defined __osf__ && defined _SYS_TYPES_H_ && defined _OSF_SOURCE) \
+ && ((defined __osf__ && defined _SYS_TYPES_H_ \
+ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \
+ && defined _OSF_SOURCE) \
|| (defined __sun && defined _SYS_TYPES_H \
&& (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \
- || defined __EXTENSIONS__))) \
- && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H)
+ || defined __EXTENSIONS__))))
# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
#elif (@HAVE_SYS_SELECT_H@ \
- && ((defined __osf__ && defined _SYS_TIME_H_ && defined _OSF_SOURCE) \
+ && (defined _CYGWIN_SYS_TIME_H \
+ || (defined __osf__ && defined _SYS_TIME_H_ \
+ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H \
+ && defined _OSF_SOURCE) \
|| (defined __sun && defined _SYS_TIME_H \
&& (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE) \
- || defined __EXTENSIONS__))) \
- && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H)
+ || defined __EXTENSIONS__))))
# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h
index 656c3f13ad..3dbf632066 100644
--- a/gl/sys_time.in.h
+++ b/gl/sys_time.in.h
@@ -24,6 +24,14 @@
#endif
@PRAGMA_COLUMNS@
+/* On Cygwin, <sys/time.h> includes itself recursively via <sys/select.h>.
+ Simply delegate to the system's header in this case; it is a no-op.
+ Without this extra ifdef, the C++ gettimeofday declaration below
+ would be a forward declaration in gnulib's nested <sys/time.h>. */
+#ifdef _CYGWIN_SYS_TIME_H
+# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
+#else
+
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_SYS_TIME_H@
# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
@@ -200,4 +208,5 @@ _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
#endif
#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
+#endif /* _CYGWIN_SYS_TIME_H */
#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am
index 2079cc7b43..ac5f684461 100644
--- a/gl/tests/Makefile.am
+++ b/gl/tests/Makefile.am
@@ -22,7 +22,7 @@
#
# Generated by gnulib-tool.
-AUTOMAKE_OPTIONS = 1.5 foreign subdir-objects
+AUTOMAKE_OPTIONS = 1.9.6 foreign subdir-objects
SUBDIRS = .
TESTS =
@@ -423,6 +423,23 @@ EXTRA_DIST += test-getdelim.c signature.h macros.h
## end gnulib module getdelim-tests
+## begin gnulib module getdtablesize
+
+
+EXTRA_DIST += getdtablesize.c
+
+EXTRA_libtests_a_SOURCES += getdtablesize.c
+
+## end gnulib module getdtablesize
+
+## begin gnulib module getdtablesize-tests
+
+TESTS += test-getdtablesize
+check_PROGRAMS += test-getdtablesize
+EXTRA_DIST += test-getdtablesize.c signature.h macros.h
+
+## end gnulib module getdtablesize-tests
+
## begin gnulib module getline-tests
TESTS += test-getline
diff --git a/gl/tests/getdtablesize.c b/gl/tests/getdtablesize.c
new file mode 100644
index 0000000000..9947405af6
--- /dev/null
+++ b/gl/tests/getdtablesize.c
@@ -0,0 +1,86 @@
+/* getdtablesize() function for platforms that don't have it.
+ Copyright (C) 2008-2013 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+ 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+#include <stdio.h>
+
+#include "msvc-inval.h"
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+_setmaxstdio_nothrow (int newmax)
+{
+ int result;
+
+ TRY_MSVC_INVAL
+ {
+ result = _setmaxstdio (newmax);
+ }
+ CATCH_MSVC_INVAL
+ {
+ result = -1;
+ }
+ DONE_MSVC_INVAL;
+
+ return result;
+}
+# define _setmaxstdio _setmaxstdio_nothrow
+#endif
+
+/* Cache for the previous getdtablesize () result. */
+static int dtablesize;
+
+int
+getdtablesize (void)
+{
+ if (dtablesize == 0)
+ {
+ /* We are looking for the number N such that the valid file descriptors
+ are 0..N-1. It can be obtained through a loop as follows:
+ {
+ int fd;
+ for (fd = 3; fd < 65536; fd++)
+ if (dup2 (0, fd) == -1)
+ break;
+ return fd;
+ }
+ On Windows XP, the result is 2048.
+ The drawback of this loop is that it allocates memory for a libc
+ internal array that is never freed.
+
+ The number N can also be obtained as the upper bound for
+ _getmaxstdio (). _getmaxstdio () returns the maximum number of open
+ FILE objects. The sanity check in _setmaxstdio reveals the maximum
+ number of file descriptors. This too allocates memory, but it is
+ freed when we call _setmaxstdio with the original value. */
+ int orig_max_stdio = _getmaxstdio ();
+ unsigned int bound;
+ for (bound = 0x10000; _setmaxstdio (bound) < 0; bound = bound / 2)
+ ;
+ _setmaxstdio (orig_max_stdio);
+ dtablesize = bound;
+ }
+ return dtablesize;
+}
+
+#endif
diff --git a/gl/tests/malloca.c b/gl/tests/malloca.c
index 3cd2f6d99e..311be569bc 100644
--- a/gl/tests/malloca.c
+++ b/gl/tests/malloca.c
@@ -49,12 +49,18 @@
#define MAGIC_SIZE sizeof (int)
/* This is how the header info would look like without any alignment
considerations. */
-struct preliminary_header { void *next; char room[MAGIC_SIZE]; };
+struct preliminary_header { void *next; int magic; };
/* But the header's size must be a multiple of sa_alignment_max. */
#define HEADER_SIZE \
(((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max)
-struct header { void *next; char room[HEADER_SIZE - sizeof (struct preliminary_header) + MAGIC_SIZE]; };
-verify (HEADER_SIZE == sizeof (struct header));
+union header {
+ void *next;
+ struct {
+ char room[HEADER_SIZE - MAGIC_SIZE];
+ int word;
+ } magic;
+};
+verify (HEADER_SIZE == sizeof (union header));
/* We make the hash table quite big, so that during lookups the probability
of empty hash buckets is quite high. There is no need to make the hash
table resizable, because when the hash table gets filled so much that the
@@ -74,20 +80,21 @@ mmalloca (size_t n)
if (nplus >= n)
{
- char *p = (char *) malloc (nplus);
+ void *p = malloc (nplus);
if (p != NULL)
{
size_t slot;
+ union header *h = p;
- p += HEADER_SIZE;
+ p = h + 1;
/* Put a magic number into the indicator word. */
- ((int *) p)[-1] = MAGIC_NUMBER;
+ h->magic.word = MAGIC_NUMBER;
/* Enter p into the hash table. */
slot = (uintptr_t) p % HASH_TABLE_SIZE;
- ((struct header *) (p - HEADER_SIZE))->next = mmalloca_results[slot];
+ h->next = mmalloca_results[slot];
mmalloca_results[slot] = p;
return p;
@@ -123,15 +130,17 @@ freea (void *p)
void **chain = &mmalloca_results[slot];
for (; *chain != NULL;)
{
+ union header *h = p;
if (*chain == p)
{
/* Found it. Remove it from the hash table and free it. */
- char *p_begin = (char *) p - HEADER_SIZE;
- *chain = ((struct header *) p_begin)->next;
+ union header *p_begin = h - 1;
+ *chain = p_begin->next;
free (p_begin);
return;
}
- chain = &((struct header *) ((char *) *chain - HEADER_SIZE))->next;
+ h = *chain;
+ chain = &h[-1].next;
}
}
/* At this point, we know it was not a mmalloca() result. */
diff --git a/gl/tests/malloca.h b/gl/tests/malloca.h
index 906d47a207..6fbe45eab6 100644
--- a/gl/tests/malloca.h
+++ b/gl/tests/malloca.h
@@ -92,7 +92,7 @@ extern void * nmalloca (size_t n, size_t s);
/* ------------------- Auxiliary, non-public definitions ------------------- */
/* Determine the alignment of a type at compile time. */
-#if defined __GNUC__
+#if defined __GNUC__ || defined __IBM__ALIGNOF__
# define sa_alignof __alignof__
#elif defined __cplusplus
template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };
diff --git a/gl/tests/putenv.c b/gl/tests/putenv.c
index ed666afc3b..5461273084 100644
--- a/gl/tests/putenv.c
+++ b/gl/tests/putenv.c
@@ -62,7 +62,9 @@ static int
_unsetenv (const char *name)
{
size_t len;
+#if !HAVE_DECL__PUTENV
char **ep;
+#endif
if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
{
@@ -72,7 +74,7 @@ _unsetenv (const char *name)
len = strlen (name);
-#if HAVE__PUTENV
+#if HAVE_DECL__PUTENV
{
int putenv_result, putenv_errno;
char *name_ = malloc (len + 2);
@@ -125,46 +127,46 @@ putenv (char *string)
return _unsetenv (string);
}
-#if HAVE__PUTENV
- /* Rely on _putenv to allocate the new environment. If other
- parts of the application use _putenv, the !HAVE__PUTENV code
- would fight over who owns the environ vector, causing a crash. */
- if (name_end[1])
- return _putenv (string);
- else
- {
- /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
- to allocate the environ vector and then replace the new
- entry with "NAME=". */
- int putenv_result, putenv_errno;
- char *name_x = malloc (name_end - string + sizeof "= ");
- if (!name_x)
- return -1;
- memcpy (name_x, string, name_end - string + 1);
- name_x[name_end - string + 1] = ' ';
- name_x[name_end - string + 2] = 0;
- putenv_result = _putenv (name_x);
- putenv_errno = errno;
- for (ep = environ; *ep; ep++)
- if (strcmp (*ep, name_x) == 0)
- {
- *ep = string;
- break;
- }
+#if HAVE_DECL__PUTENV
+ /* Rely on _putenv to allocate the new environment. If other
+ parts of the application use _putenv, the !HAVE_DECL__PUTENV code
+ would fight over who owns the environ vector, causing a crash. */
+ if (name_end[1])
+ return _putenv (string);
+ else
+ {
+ /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
+ to allocate the environ vector and then replace the new
+ entry with "NAME=". */
+ int putenv_result, putenv_errno;
+ char *name_x = malloc (name_end - string + sizeof "= ");
+ if (!name_x)
+ return -1;
+ memcpy (name_x, string, name_end - string + 1);
+ name_x[name_end - string + 1] = ' ';
+ name_x[name_end - string + 2] = 0;
+ putenv_result = _putenv (name_x);
+ putenv_errno = errno;
+ for (ep = environ; *ep; ep++)
+ if (strcmp (*ep, name_x) == 0)
+ {
+ *ep = string;
+ break;
+ }
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- if (putenv_result == 0)
- {
- /* _putenv propagated "NAME= " into the subprocess environment;
- fix that by calling SetEnvironmentVariable directly. */
- name_x[name_end - string] = 0;
- putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
- putenv_errno = ENOMEM; /* ENOMEM is the only way to fail. */
- }
-# endif
- free (name_x);
- __set_errno (putenv_errno);
- return putenv_result;
+ if (putenv_result == 0)
+ {
+ /* _putenv propagated "NAME= " into the subprocess environment;
+ fix that by calling SetEnvironmentVariable directly. */
+ name_x[name_end - string] = 0;
+ putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
+ putenv_errno = ENOMEM; /* ENOMEM is the only way to fail. */
}
+# endif
+ free (name_x);
+ __set_errno (putenv_errno);
+ return putenv_result;
+ }
#else
for (ep = environ; *ep; ep++)
if (strncmp (*ep, string, name_end - string) == 0
@@ -186,7 +188,7 @@ putenv (char *string)
last_environ = new_environ;
environ = new_environ;
}
-#endif
return 0;
+#endif
}
diff --git a/gl/tests/test-dup2.c b/gl/tests/test-dup2.c
index 9600c850b1..ecb2692d2a 100644
--- a/gl/tests/test-dup2.c
+++ b/gl/tests/test-dup2.c
@@ -26,6 +26,10 @@ SIGNATURE_CHECK (dup2, int, (int, int));
#include <errno.h>
#include <fcntl.h>
+#if HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+#endif
+
#include "binary-io.h"
#if GNULIB_TEST_CLOEXEC
@@ -103,6 +107,7 @@ main (void)
{
const char *file = "test-dup2.tmp";
char buffer[1];
+ int bad_fd = getdtablesize ();
int fd = open (file, O_CREAT | O_TRUNC | O_RDWR, 0600);
/* Assume std descriptors were provided by invoker. */
@@ -146,7 +151,7 @@ main (void)
ASSERT (dup2 (fd, -2) == -1);
ASSERT (errno == EBADF);
errno = 0;
- ASSERT (dup2 (fd, 10000000) == -1);
+ ASSERT (dup2 (fd, bad_fd) == -1);
ASSERT (errno == EBADF);
/* Using dup2 can skip fds. */
diff --git a/gl/tests/test-getaddrinfo.c b/gl/tests/test-getaddrinfo.c
index 1b9892f410..5c27d3bef8 100644
--- a/gl/tests/test-getaddrinfo.c
+++ b/gl/tests/test-getaddrinfo.c
@@ -114,6 +114,8 @@ simple (char const *host, char const *service)
for (ai = ai0; ai; ai = ai->ai_next)
{
+ void *ai_addr = ai->ai_addr;
+ struct sockaddr_in *sock_addr = ai_addr;
dbgprintf ("\tflags %x\n", ai->ai_flags);
dbgprintf ("\tfamily %x\n", ai->ai_family);
dbgprintf ("\tsocktype %x\n", ai->ai_socktype);
@@ -121,8 +123,7 @@ simple (char const *host, char const *service)
dbgprintf ("\taddrlen %ld: ", (unsigned long) ai->ai_addrlen);
dbgprintf ("\tFound %s\n",
inet_ntop (ai->ai_family,
- &((struct sockaddr_in *)
- ai->ai_addr)->sin_addr,
+ &sock_addr->sin_addr,
buf, sizeof (buf) - 1));
if (ai->ai_canonname)
dbgprintf ("\tFound %s...\n", ai->ai_canonname);
diff --git a/gl/tests/test-getdtablesize.c b/gl/tests/test-getdtablesize.c
new file mode 100644
index 0000000000..7046481ba3
--- /dev/null
+++ b/gl/tests/test-getdtablesize.c
@@ -0,0 +1,34 @@
+/* Test of getdtablesize() function.
+ Copyright (C) 2008-2013 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 Bruno Haible <bruno@clisp.org>, 2008. */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (getdtablesize, int, (void));
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+ ASSERT (getdtablesize () >= 3);
+
+ return 0;
+}
diff --git a/gl/tests/test-snprintf.c b/gl/tests/test-snprintf.c
index 805735769e..108346e129 100644
--- a/gl/tests/test-snprintf.c
+++ b/gl/tests/test-snprintf.c
@@ -52,7 +52,7 @@ main (int argc, char *argv[])
#if !CHECK_SNPRINTF_POSIX
if (size > 0)
#endif
- ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
+ ASSERT (memcmp (buf + size, &"DEADBEEF"[size], 8 - size) == 0);
}
else
{
diff --git a/gl/tests/test-sys_socket.c b/gl/tests/test-sys_socket.c
index 0ac8a33264..9084b18b6d 100644
--- a/gl/tests/test-sys_socket.c
+++ b/gl/tests/test-sys_socket.c
@@ -47,7 +47,7 @@ main (void)
sa_family_t i;
/* Check some errno values. */
- switch (0)
+ switch (ENOTSOCK)
{
case ENOTSOCK:
case EADDRINUSE:
diff --git a/gl/tests/test-vasnprintf.c b/gl/tests/test-vasnprintf.c
index f29b05aeb5..4cce0a947a 100644
--- a/gl/tests/test-vasnprintf.c
+++ b/gl/tests/test-vasnprintf.c
@@ -55,7 +55,7 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
ASSERT (length == 5);
if (size < 6)
ASSERT (result != buf);
- ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
+ ASSERT (memcmp (buf + size, &"DEADBEEF"[size], 8 - size) == 0);
if (result != buf)
free (result);
}
diff --git a/gl/tests/test-vsnprintf.c b/gl/tests/test-vsnprintf.c
index 3353b2eb47..84b5d89676 100644
--- a/gl/tests/test-vsnprintf.c
+++ b/gl/tests/test-vsnprintf.c
@@ -65,7 +65,7 @@ main (int argc, char *argv[])
#if !CHECK_VSNPRINTF_POSIX
if (size > 0)
#endif
- ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
+ ASSERT (memcmp (buf + size, &"DEADBEEF"[size], 8 - size) == 0);
}
else
{
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 675c7e6a55..2ea9af4365 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -61,8 +61,10 @@
/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
<unistd.h>. */
/* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */
+/* OSF Tru64 Unix cannot see gnulib rpl_strtod when system <stdlib.h> is
+ included here. */
/* But avoid namespace pollution on glibc systems. */
-#ifndef __GLIBC__
+#if !defined __GLIBC__ && !defined __osf__
# define __need_system_stdlib_h
# include <stdlib.h>
# undef __need_system_stdlib_h
diff --git a/maint.mk b/maint.mk
index 2b454a15cc..c1b786f89f 100644
--- a/maint.mk
+++ b/maint.mk
@@ -809,7 +809,7 @@ sc_prohibit_always_true_header_tests:
$(_sc_search_regexp)
sc_prohibit_defined_have_decl_tests:
- @prohibit='#[ ]*if(n?def|.*\<defined)\>[ (]+HAVE_DECL_' \
+ @prohibit='(#[ ]*ifn?def|\<defined)\>[ (]+HAVE_DECL_' \
halt='HAVE_DECL macros are always defined' \
$(_sc_search_regexp)