autoconf
[Top][All Lists]
Advanced

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

Re: iterating over arguments


From: Eric Blake
Subject: Re: iterating over arguments
Date: Mon, 14 Sep 2009 15:46:13 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Sam Steingold <sds <at> gnu.org> writes:

> Eric Blake wrote:
> > any rate, using 'autoconf --trace=_CL_CLISP_REQUIRE_FEATURE_2' would show
> > what the result of m4_toupper turns out to be in this case.
> 
> running this:
> autoconf --trace=CL_CLISP
> hangs forever without any output.

I'm _still_ interested in the alternative m4_map_args_w and
--trace=_CL_CLISP_REQUIRE_FEATURE_2 behavior.  So far, you have _only_ provided 
results for m4_foreach_w, using m4_pushdef, whereas my alternative suggestion 
of m4_map_args_w does not require the use of m4_pushdef, so I still wonder 
whether my alternative suggestion would better cope with m4_toupper's lack of 
quoting.

> -[AC_CACHE_CHECK([for cl_feat in CLISP], [cl_cv_clisp_]cl_feat,
> +[m4_pushdef([CL_FEAT], [m4_toupper([cl_feat])])dnl

It's obvious why this particular patch attempt infloops - because you over-
quoted m4_toupper, you are defining CL_FEAT to contain the contents:

m4_toupper([cl_feat])

Thus, when you call a raw:

CL_FEAT

you end up invoking:

m4_toupper([cl_feat])

which in turn expands to this (in autoconf 2.64, but not after I apply my patch 
for 2.65 to properly quote m4_toupper's result):

CL_FEAT

hence an infinite loop.  And if you had tried:

> +[m4_pushdef([CL_FEAT], m4_toupper([cl_feat]))dnl

(note that the m4_toupper is intentionally NOT quoted), then you would be 
defining CL_FEAT as:

CL_FEAT

and still have an infinite loop.  But if you went with what I suggested:

> +[m4_pushdef([CL_FEAT], m4_toupper(cl_feat))dnl

(now note that both m4_toupper and cl_feat are unquoted), you get CL_FEAT 
defined as the uppercase version of the contents of cl_feat; or, when cl_feat 
is ffi, then CL_FEAT would be

FFI

In other words, this is a case where you really DO want the macro cl_feat and 
m4_toupper expanded prior to calling m4_pushdef with the results.

-- 
Eric Blake






reply via email to

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