automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] {maint} Document in detail some limitations of aclocal.


From: Eric Blake
Subject: Re: [PATCH] {maint} Document in detail some limitations of aclocal.
Date: Thu, 04 Nov 2010 15:51:59 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc14 Mnenhy/0.8.3 Thunderbird/3.1.6

On 11/04/2010 03:28 PM, Stefano Lattarini wrote:
>>> +# Indirection used here, to avoid triggering the bug described
>>> +# above.
>>> +AC_DEFUN([MY_DEFUN], [m4_apply([AC_DEFUN], [$1], [$2])])
>>
>> This is insufficiently quoted, it should be:
>>                         [m4_apply([AC_DEFUN], [[$1], [$2]])]
> I'm not an m4 quoting guru, but I think that one single level of quotes
> is sufficient to avoid *spurious* expansions.  Do you have any reason or
> example showing that two levels of quotes are indeed needed?

Yes - the documentation of m4_apply includes this example:

m4_apply([m4_count], [])
0
m4_apply([m4_count], [[]])
1
m4_apply([m4_count], [[1], [2]])
2
m4_apply([m4_join], [[|], [1], [2]])
1|2

That is, m4_apply is implemented as $1($2).  Notice that the entire
second argument to m4_apply is passed as a series of arguments to $1, so
each argument to $1 must be quoted, AND that series of arguments to
m4_apply must be quoted into a single unit.

The way you wrote it, you would have called AC_DEFUN($1), and $2 would
be a spurious argument (not sure if it would be silently ignored or
trigger a warning), when you really wanted to call AC_DEFUN([$1], [$2]).

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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