[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: link-warning usage improvements
From: |
Eric Blake |
Subject: |
Re: link-warning usage improvements |
Date: |
Thu, 31 Dec 2009 22:14:40 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Eric Blake <ebb9 <at> byu.net> writes:
> Huh. gl_CHECK_NEXT_HEADERS invokes AC_CHECK_HEADERS under the hood. That
> means several other .m4 file can probably be simplified:
>
Here's what I came up with:
From: Eric Blake <address@hidden>
Date: Thu, 31 Dec 2009 14:35:32 -0700
Subject: [PATCH 1/2] spawn: yet more fixes
The curse of a misapplied patch continues.
* lib/spawn.in.h (posix_spawnattr_getflags)
(posix_spawnattr_setflags, posix_spawnattr_getpgroup)
(posix_spawnattr_setpgroup): More corrections.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 7 +++++++
lib/spawn.in.h | 8 ++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b43a6e6..80e0445 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-31 Eric Blake <address@hidden>
+
+ spawn: yet more fixes
+ * lib/spawn.in.h (posix_spawnattr_getflags)
+ (posix_spawnattr_setflags, posix_spawnattr_getpgroup)
+ (posix_spawnattr_setpgroup): More corrections.
+
2009-12-31 Bruno Haible <address@hidden>
Avoid namespace pollution on glibc systems.
diff --git a/lib/spawn.in.h b/lib/spawn.in.h
index 5a7633c..8125c02 100644
--- a/lib/spawn.in.h
+++ b/lib/spawn.in.h
@@ -315,7 +315,7 @@ extern int posix_spawnattr_getflags (const
posix_spawnattr_t *_Restrict_ __attr,
# define posix_spawnattr_getflags(a, b) \
(GL_LINK_WARNING ("posix_spawnattr_getflags is unportable - " \
"use gnulib module posix_spawnattr_getflags for
portability"), \
- posix_spawnattr_getsigdefault (a, b))
+ posix_spawnattr_getflags (a, b))
#endif
#if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
@@ -333,7 +333,7 @@ extern int posix_spawnattr_setflags (posix_spawnattr_t
*__attr,
# define posix_spawnattr_setflags(a, b) \
(GL_LINK_WARNING ("posix_spawnattr_setflags is unportable - " \
"use gnulib module posix_spawnattr_setflags for
portability"), \
- posix_spawnattr_getflags (a, b))
+ posix_spawnattr_setflags (a, b))
#endif
#if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
@@ -351,7 +351,7 @@ extern int posix_spawnattr_getpgroup (const
posix_spawnattr_t *_Restrict_ __attr
# define posix_spawnattr_getpgroup(a, b) \
(GL_LINK_WARNING ("posix_spawnattr_getpgroup is unportable - " \
"use gnulib module posix_spawnattr_getpgroup for
portability"), \
- posix_spawnattr_setflags (a, b))
+ posix_spawnattr_getpgroup (a, b))
#endif
#if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
@@ -369,7 +369,7 @@ extern int posix_spawnattr_setpgroup (posix_spawnattr_t
*__attr,
# define posix_spawnattr_setpgroup(a, b) \
(GL_LINK_WARNING ("posix_spawnattr_setpgroup is unportable - " \
"use gnulib module posix_spawnattr_setpgroup for
portability"), \
- posix_spawnattr_setflags (a, b))
+ posix_spawnattr_setpgroup (a, b))
#endif
#if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
--
1.6.4.2
>From 07ef1c842b716b1adced8c271ae733b928c15287 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 31 Dec 2009 15:10:04 -0700
Subject: [PATCH 2/2] headers: remove redundant header check
Optimization spotted based on recent sys_select.m4 patch.
* m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): gl_CHECK_NEXT_HEADERS
already calls AC_CHECK_HEADERS_ONCE.
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Likewise.
* m4/langinfo_h.m4 (gl_LANGINFO_H): Likewise.
* m4/sched_h.m4 (gl_SCHED_H): Likewise.
* m4/spawn_h.m4 (gl_SPAWN_H): Likewise.
* m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H): Likewise.
* m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H): Likewise.
* m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise.
* m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise.
* m4/sysexits.m4 (gl_SYSEXITS): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
* m4/wchar.m4 (gl_WCHAR_H): Likewise. Also, reduce testing if
header is not present.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 16 ++++++++++++++++
m4/arpa_inet_h.m4 | 7 +++----
m4/getopt.m4 | 3 +--
m4/langinfo_h.m4 | 5 ++---
m4/sched_h.m4 | 3 +--
m4/spawn_h.m4 | 3 +--
m4/sys_file_h.m4 | 3 +--
m4/sys_ioctl_h.m4 | 7 +++----
m4/sys_socket_h.m4 | 2 +-
m4/sys_times_h.m4 | 3 +--
m4/sys_utsname_h.m4 | 3 +--
m4/sysexits.m4 | 5 ++---
m4/unistd_h.m4 | 3 +--
m4/wchar.m4 | 37 +++++++++++++++++--------------------
14 files changed, 51 insertions(+), 49 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 80e0445..b0f7593 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
2009-12-31 Eric Blake <address@hidden>
+ headers: remove redundant header check
+ * m4/arpa_inet_h.m4 (gl_HEADER_ARPA_INET): gl_CHECK_NEXT_HEADERS
+ already calls AC_CHECK_HEADERS_ONCE.
+ * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Likewise.
+ * m4/langinfo_h.m4 (gl_LANGINFO_H): Likewise.
+ * m4/sched_h.m4 (gl_SCHED_H): Likewise.
+ * m4/spawn_h.m4 (gl_SPAWN_H): Likewise.
+ * m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H): Likewise.
+ * m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H): Likewise.
+ * m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise.
+ * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise.
+ * m4/sysexits.m4 (gl_SYSEXITS): Likewise.
+ * m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
+ * m4/wchar.m4 (gl_WCHAR_H): Likewise. Also, reduce testing if
+ header is not present.
+
spawn: yet more fixes
* lib/spawn.in.h (posix_spawnattr_getflags)
(posix_spawnattr_setflags, posix_spawnattr_getpgroup)
diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4
index cf63b30..498d716 100644
--- a/m4/arpa_inet_h.m4
+++ b/m4/arpa_inet_h.m4
@@ -1,4 +1,4 @@
-# arpa_inet_h.m4 serial 6
+# arpa_inet_h.m4 serial 7
dnl Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,15 +12,14 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
dnl once only, before all statements that occur in other macros.
AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
- AC_CHECK_HEADERS_ONCE([arpa/inet.h])
+ dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([arpa/inet.h])
if test $ac_cv_header_arpa_inet_h = yes; then
HAVE_ARPA_INET_H=1
else
HAVE_ARPA_INET_H=0
fi
AC_SUBST([HAVE_ARPA_INET_H])
- dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
- gl_CHECK_NEXT_HEADERS([arpa/inet.h])
])
dnl Unconditionally enables the replacement of <arpa/inet.h>.
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index 8b1bb8f..14047a7 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 24
+# getopt.m4 serial 25
dnl Copyright (C) 2002-2006, 2008-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -55,7 +55,6 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
gl_CHECK_NEXT_HEADERS([getopt.h])
- AC_CHECK_HEADERS_ONCE([getopt.h])
if test $ac_cv_header_getopt_h = yes; then
HAVE_GETOPT_H=1
else
diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4
index 4ea23a4..ee67e55 100644
--- a/m4/langinfo_h.m4
+++ b/m4/langinfo_h.m4
@@ -1,4 +1,4 @@
-# langinfo_h.m4 serial 2
+# langinfo_h.m4 serial 3
dnl Copyright (C) 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,12 +11,11 @@ AC_DEFUN([gl_LANGINFO_H],
dnl Persuade glibc-2.0.6 <langinfo.h> to define CODESET.
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
gl_CHECK_NEXT_HEADERS([langinfo.h])
- dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
HAVE_LANGINFO_CODESET=0
HAVE_LANGINFO_ERA=0
- AC_CHECK_HEADERS_ONCE([langinfo.h])
if test $ac_cv_header_langinfo_h = yes; then
HAVE_LANGINFO_H=1
dnl Determine what <langinfo.h> defines. CODESET and ERA etc. are missing
diff --git a/m4/sched_h.m4 b/m4/sched_h.m4
index e52f712..7509daf 100644
--- a/m4/sched_h.m4
+++ b/m4/sched_h.m4
@@ -1,4 +1,4 @@
-# sched_h.m4 serial 2
+# sched_h.m4 serial 3
dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -19,7 +19,6 @@ AC_DEFUN([gl_SCHED_H],
gl_CHECK_NEXT_HEADERS([sched.h])
- AC_CHECK_HEADERS_ONCE([sched.h])
if test $ac_cv_header_sched_h = yes; then
HAVE_SCHED_H=1
else
diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4
index 91ae99d..ac7e23f 100644
--- a/m4/spawn_h.m4
+++ b/m4/spawn_h.m4
@@ -1,4 +1,4 @@
-# spawn_h.m4 serial 5
+# spawn_h.m4 serial 6
dnl Copyright (C) 2008-2009 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,7 +15,6 @@ AC_DEFUN([gl_SPAWN_H],
dnl <spawn.h> is always overridden, because of GNULIB_POSIXCHECK.
gl_CHECK_NEXT_HEADERS([spawn.h])
- AC_CHECK_HEADERS_ONCE([spawn.h])
if test $ac_cv_header_spawn_h = yes; then
HAVE_SPAWN_H=1
AC_CHECK_TYPES([posix_spawnattr_t], [], [HAVE_POSIX_SPAWNATTR_T=0], [[
diff --git a/m4/sys_file_h.m4 b/m4/sys_file_h.m4
index 419dda8..ce22238 100644
--- a/m4/sys_file_h.m4
+++ b/m4/sys_file_h.m4
@@ -7,7 +7,7 @@
# Written by Richard W.M. Jones.
-# serial 2
+# serial 3
AC_DEFUN([gl_HEADER_SYS_FILE_H],
[
@@ -19,7 +19,6 @@ AC_DEFUN([gl_HEADER_SYS_FILE_H],
gl_CHECK_NEXT_HEADERS([sys/file.h])
- AC_CHECK_HEADERS_ONCE([sys/file.h])
if test $ac_cv_header_sys_file_h = yes; then
HAVE_SYS_FILE_H=1
else
diff --git a/m4/sys_ioctl_h.m4 b/m4/sys_ioctl_h.m4
index abb984f..8219619 100644
--- a/m4/sys_ioctl_h.m4
+++ b/m4/sys_ioctl_h.m4
@@ -1,4 +1,4 @@
-# sys_ioctl_h.m4 serial 4
+# sys_ioctl_h.m4 serial 5
dnl Copyright (C) 2008-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,8 @@ AC_DEFUN([gl_SYS_IOCTL_H],
dnl once only, before all statements that occur in other macros.
AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
- AC_CHECK_HEADERS_ONCE([sys/ioctl.h])
+ dnl <sys/ioctl.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/ioctl.h])
if test $ac_cv_header_sys_ioctl_h = yes; then
HAVE_SYS_IOCTL_H=1
dnl Test whether <sys/ioctl.h> declares ioctl(), or whether some other
@@ -31,8 +32,6 @@ AC_DEFUN([gl_SYS_IOCTL_H],
HAVE_SYS_IOCTL_H=0
fi
AC_SUBST([HAVE_SYS_IOCTL_H])
- dnl <sys/ioctl.h> is always overridden, because of GNULIB_POSIXCHECK.
- gl_CHECK_NEXT_HEADERS([sys/ioctl.h])
])
dnl Unconditionally enables the replacement of <sys/ioctl.h>.
diff --git a/m4/sys_times_h.m4 b/m4/sys_times_h.m4
index 1389d2b..807914b 100644
--- a/m4/sys_times_h.m4
+++ b/m4/sys_times_h.m4
@@ -1,5 +1,5 @@
# Configure a replacement for <sys/times.h>.
-# serial 3
+# serial 4
# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -13,7 +13,6 @@ AC_DEFUN([gl_SYS_TIMES_H],
AC_REQUIRE([gl_SYS_TIMES_H_DEFAULTS])
gl_CHECK_NEXT_HEADERS([sys/times.h])
- AC_CHECK_HEADERS_ONCE([sys/times.h])
if test $ac_cv_header_sys_times_h = yes; then
HAVE_SYS_TIMES_H=1
AC_CHECK_TYPES([struct tms], [], [HAVE_STRUCT_TMS=0], [[
diff --git a/m4/sys_utsname_h.m4 b/m4/sys_utsname_h.m4
index 1c528eb..477b261 100644
--- a/m4/sys_utsname_h.m4
+++ b/m4/sys_utsname_h.m4
@@ -1,4 +1,4 @@
-# sys_utsname_h.m4 serial 3
+# sys_utsname_h.m4 serial 4
dnl Copyright (C) 2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,6 @@ AC_DEFUN([gl_SYS_UTSNAME_H],
AC_REQUIRE([gl_SYS_UTSNAME_H_DEFAULTS])
gl_CHECK_NEXT_HEADERS([sys/utsname.h])
- AC_CHECK_HEADERS_ONCE([sys/utsname.h])
if test $ac_cv_header_sys_utsname_h != yes; then
HAVE_SYS_UTSNAME_H=0
HAVE_STRUCT_UTSNAME=0
diff --git a/m4/sysexits.m4 b/m4/sysexits.m4
index b6d2e08..edd2aa0 100644
--- a/m4/sysexits.m4
+++ b/m4/sysexits.m4
@@ -1,4 +1,4 @@
-# sysexits.m4 serial 5
+# sysexits.m4 serial 6
dnl Copyright (C) 2003, 2005, 2007, 2009 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,9 @@ dnl with or without modifications, as long as this notice is
preserved.
AC_DEFUN([gl_SYSEXITS],
[
- AC_CHECK_HEADERS_ONCE([sysexits.h])
+ gl_CHECK_NEXT_HEADERS([sysexits.h])
if test $ac_cv_header_sysexits_h = yes; then
HAVE_SYSEXITS_H=1
- gl_CHECK_NEXT_HEADERS([sysexits.h])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sysexits.h>]],
[[switch (0)
{
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index cb50d50..fdf6455 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 36
+# unistd_h.m4 serial 37
dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,6 @@ AC_DEFUN([gl_UNISTD_H],
gl_CHECK_NEXT_HEADERS([unistd.h])
- AC_CHECK_HEADERS_ONCE([unistd.h])
if test $ac_cv_header_unistd_h = yes; then
HAVE_UNISTD_H=1
else
diff --git a/m4/wchar.m4 b/m4/wchar.m4
index ad3bebd..7aa7881 100644
--- a/m4/wchar.m4
+++ b/m4/wchar.m4
@@ -7,40 +7,37 @@ dnl with or without modifications, as long as this notice is
preserved.
dnl Written by Eric Blake.
-# wchar.m4 serial 28
+# wchar.m4 serial 29
AC_DEFUN([gl_WCHAR_H],
[
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
- AC_CACHE_CHECK([whether <wchar.h> is standalone],
- [gl_cv_header_wchar_h_standalone],
- [AC_COMPILE_IFELSE([[#include <wchar.h>
-wchar_t w;]],
- [gl_cv_header_wchar_h_standalone=yes],
- [gl_cv_header_wchar_h_standalone=no])])
-
- AC_REQUIRE([gt_TYPE_WINT_T])
- if test $gt_cv_c_wint_t = yes; then
- HAVE_WINT_T=1
- else
- HAVE_WINT_T=0
- fi
- AC_SUBST([HAVE_WINT_T])
-
dnl Prepare for creating substitute <wchar.h>.
- dnl Do it always: WCHAR_H may be empty here but can be set later.
dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
dnl character support).
- AC_CHECK_HEADERS_ONCE([wchar.h])
+ dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([wchar.h])
if test $ac_cv_header_wchar_h = yes; then
HAVE_WCHAR_H=1
+ AC_CACHE_CHECK([whether <wchar.h> is standalone],
+ [gl_cv_header_wchar_h_standalone],
+ [AC_COMPILE_IFELSE([[#include <wchar.h>
+wchar_t w;]],
+ [gl_cv_header_wchar_h_standalone=yes],
+ [gl_cv_header_wchar_h_standalone=no])])
else
HAVE_WCHAR_H=0
fi
AC_SUBST([HAVE_WCHAR_H])
- dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
- gl_CHECK_NEXT_HEADERS([wchar.h])
+
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ if test $gt_cv_c_wint_t = yes; then
+ HAVE_WINT_T=1
+ else
+ HAVE_WINT_T=0
+ fi
+ AC_SUBST([HAVE_WINT_T])
])
dnl Check whether <wchar.h> is usable at all.
--
1.6.4.2
- Re: link-warning usage improvements, (continued)
- Re: link-warning usage improvements, Eric Blake, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Eric Blake, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Eric Blake, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Eric Blake, 2009/12/31
- Re: link-warning usage improvements,
Eric Blake <=
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Eric Blake, 2009/12/31
- Re: link-warning usage improvements, Eric Blake, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31
- Re: link-warning usage improvements, Eric Blake, 2009/12/31
- Re: link-warning usage improvements, Bruno Haible, 2009/12/31