Re: iterating over arguments

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

 



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




_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux