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: Stefano Lattarini
Subject: Re: [PATCH] {maint} Document in detail some limitations of aclocal.
Date: Thu, 4 Nov 2010 23:04:03 +0100
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Hi Eric.

On Thursday 04 November 2010, Eric Blake wrote:
> 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]).
> 
Thanks for the detailed explanation.  I've addressed your and Nick's
observations in an amended patch (attached to my reply to Nick's mail).

Thanks,
  Stefano



reply via email to

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