autoconf-patches
[Top][All Lists]
Advanced

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

Re: unoptimized autoconf generated code


From: Eric Blake
Subject: Re: unoptimized autoconf generated code
Date: Wed, 03 Mar 2010 17:05:21 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

According to Ralf Wildenhues on 3/2/2010 10:53 PM:
>> Actually, it's a doc bug.  This is not valid shell variable assignment:
>>
>> `echo $foo`=yes
>>
>> So this patch is going in now, while I spend more time fixing the actual
>> code changes.
> 
> Thanks.  Sticking an eval in front of any AS_TR_SH is going to be pretty
> fragile though, and I'm not really sure whether, at the time this
> example was added, the eval wasn't part of the AS_TR_SH expansion.

AS_TR_SH has never included eval.  It's just that most use cases hide the
need for eval from the user (that is, you are most likely to need AS_TR_SH
in the context of AS_VAR_*, but those API use AS_LITERAL_IF under the hood
to decide when an eval is necessary).  Fortunately, one of the guarantees
of AS_TR_SH is that the output is a valid shell variable (no
metacharacters, no issues from a second level of expansion, ...), so it is
one case where eval gotchas are less likely to happen, provided that the
rest of the line containing the AS_TR_SH is careful (AS_ESCAPE comes in
handy).

At any rate, I finally tracked down why I was getting testsuite failures
with patch 2/3; here's the updated version that passes the testsuite
(again, 1/3 and 3/3 are unchanged).  It also turned out rather large, so
I'm still thinking about splitting it into two parts; first the
introduction of AS_LITERAL_IF_W (or a better name, if anyone has a
suggestion) and cleanups outside of lib/m4sugar, and second touching only
lib/m4sugar to implement the optional argument.

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

Attachment: autoconf.patch263
Description: Text document

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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