bug-gnulib
[Top][All Lists]
Advanced

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

m4_quote(m4_defn()) (was: lib/dirent.in.h fails on AIX)


From: Eric Blake
Subject: m4_quote(m4_defn()) (was: lib/dirent.in.h fails on AIX)
Date: Thu, 21 May 2009 15:46:19 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Bruno Haible <bruno <at> clisp.org> writes:

> > By the way, m4_quote(m4_defn([foo])) is overkill - m4_defn already properly 
> > quotes its output as a single m4 argument, so the m4_quote is a no-op 
(m4_quote 
> > is only useful when collecting multiple unquoted m4 arguments into a single 
> > string).
> 
> m4_quote(m4_defn([foo])) comes from Paul Eggert. I'm a bit leery of removing
> a level of m4 quoting, because
>   - The generated statements in configure are right.
>   - Removing a level of m4 quoting generally means to allow interpretation of
>     some tokens as m4 macros. Which is not desirable here.

But only if those tokens are unquoted.  m4_defn is GUARANTEED to be quoted, to 
begin with.  All m4_quote does is add quoting to unquoted arguments, but since 
m4_defn is a quoted argument, m4_quote(m4_defn) is a no-op.  Trust me.  Or 
don't trust me, and instead run this test:

$ cd autoconf
$ echo 'm4_divert[]m4_define([a],[A])m4_define([foo], [a[a[a]]])dnl         
> foo
> m4_defn([foo])
> m4_quote(m4_defn([foo]))' | m4 -Ilib m4sugar/m4sugar.m4 -
Aa[a]
a[a[a]]
a[a[a]]

Notice - even with the active macro a, the quoting is identical whether you use 
the redundant m4_quote or not.  In other words, we aren't removing a level of 
m4 quoting.

-- 
Eric Blake






reply via email to

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