bug-gnulib
[Top][All Lists]
Advanced

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

Re: expand-before-require bug


From: Eric Blake
Subject: Re: expand-before-require bug
Date: Wed, 21 Jan 2009 17:57:47 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

> As of this morning, autoconf.git now warns you on instances of expand-before-
> require (aka ordering bugs in older autoconf, and redundant output when using 
> bleeding edge autoconf).  I'm working on a series of patches to reduce the 
> number of warnings we trigger, starting with this one:

Next:

configure.ac:50: warning: AC_REQUIRE: `gl_MULTIARCH' was expanded before it was 
required
m4/printf.m4:811: gl_PRINTF_ENOMEM is expanded from...
m4/vasprintf-posix.m4:7: gl_FUNC_VASPRINTF_POSIX is expanded from...
m4/gnulib-comp.m4:45: gl_INIT is expanded from...
configure.ac:50: the top level

Hmm, that looks familiar.  My fix in commit 3d13a23 managed to avoid out-of-
order expansion, but triggers another one of those autoconf false positives by 
expanding a macro whose body consists of a single AC_REQUIRE redirect.  The 
cleaner fix, which silences the warning, is to always use AC_REQUIRE in the 
first place.  I'm pushing this.


From: Eric Blake <address@hidden>
Date: Wed, 21 Jan 2009 10:55:43 -0700
Subject: [PATCH] multiarch: avoid expand-before-require warning

* modules/multiarch (configure.ac): Require, rather than expand,
gl_MULTIARCH.
* m4/multiarch.m4 (gl_MULTIARCH_BODY): Merge...
(gl_MULTIARCH): ...into this macro, and use AC_DEFUN_ONCE to
enforce that all clients require it.  Partial reversion of
2008-12-29 patch.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog         |    8 ++++++++
 m4/multiarch.m4   |   16 ++++------------
 modules/multiarch |    2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bc8fc9f..168fbc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-01-21  Eric Blake  <address@hidden>
 
+       multiarch: avoid expand-before-require warning
+       * modules/multiarch (configure.ac): Require, rather than expand,
+       gl_MULTIARCH.
+       * m4/multiarch.m4 (gl_MULTIARCH_BODY): Merge...
+       (gl_MULTIARCH): ...into this macro, and use AC_DEFUN_ONCE to
+       enforce that all clients require it.  Partial reversion of
+       2008-12-29 patch.
+
        error: avoid expand-before-require warning
        * modules/errno (configure.ac): Require, rather than expand,
        gl_HEADER_ERRNO_H.
diff --git a/m4/multiarch.m4 b/m4/multiarch.m4
index 7b73e15..3948e6e 100644
--- a/m4/multiarch.m4
+++ b/m4/multiarch.m4
@@ -1,5 +1,5 @@
-# multiarch.m4 serial 3
-dnl Copyright (C) 2008 Free Software Foundation, Inc.
+# multiarch.m4 serial 4
+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,
 dnl with or without modifications, as long as this notice is preserved.
@@ -19,16 +19,8 @@ dnl with or without modifications, as long as this notice is 
preserved.
 # Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
 # beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
 
-AC_DEFUN([gl_MULTIARCH],
-[
-  dnl This AC_REQUIRE is not necessary in theory. It works around a bug in
-  dnl autoconf <= 2.63: AC_REQUIRE invocations inside AC_REQUIREd macros are
-  dnl being handled better than AC_REQUIRE invocations inside normally invoked
-  dnl macros.
-  AC_REQUIRE([gl_MULTIARCH_BODY])
-])
-
-AC_DEFUN([gl_MULTIARCH_BODY],
+dnl This macro must pass through AC_REQUIRE (never directly invoke it).
+AC_DEFUN_ONCE([gl_MULTIARCH],
 [
   dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
   gl_cv_c_multiarch=no
diff --git a/modules/multiarch b/modules/multiarch
index 24b14d5..82d67a4 100644
--- a/modules/multiarch
+++ b/modules/multiarch
@@ -7,7 +7,7 @@ m4/multiarch.m4
 Depends-on:
 
 configure.ac:
-gl_MULTIARCH
+AC_REQUIRE([gl_MULTIARCH])
 
 Makefile.am:
 
-- 
1.6.0.4







reply via email to

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