[Top][All Lists]

[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: Fri, 23 Jan 2009 17:06:38 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20081209 Thunderbird/ Mnenhy/

Hash: SHA1

According to Bruno Haible on 1/23/2009 4:26 PM:
> I find this m4_defun_once interesting too: it incorporates the workaround
> that we previously used in gnulib.
> But before you jump to the conclusion that AC_DEFUN_IDEMPOTENT is not
> needed any more, can you please tell:
>   - Can a macro defined with AC_DEFUN_ONCE be both required and invoked?

In autoconf 2.63, it can be invoked first and then required; this is okay
unless the require was indirect within the body of a single defun (in
which case, you had an out-of-order expansion).  It warns if you require
first and then invoke it.  With the proposal for autoconf 2.64, it can be
either invoked or required, in any order, without warning; it guarantees
that the expansion only occurs once; and it will never suffer from
out-of-order expansion (thanks to the embedded require under the hood).
Plus, it should be easy to backport this behavior into gnulib.

>   - Is a warning issued when an AC_DEFUN_ONCEd macro is expanded twice?

In autoconf 2.63, yes.  But for autoconf 2.64, the second expansion is a
silent no-op.  In other words, we are making the macro more permissive
than it used to be, while reducing the chance for out-of-order expansion.
 Compatibility-wise, accepting a condition that used to warn is never a

>   - Is a warning issued when an AC_DEFUN_ONCEd macro is being required
>     after having already been expanded?

In autoconf 2.63, no.  This will not change for 2.64.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

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