autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] modernize AS_UNSET a bit (take 2)


From: Paolo Bonzini
Subject: Re: [PATCH] modernize AS_UNSET a bit (take 2)
Date: Tue, 14 Oct 2008 20:22:00 +0200
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Eric Blake wrote:
> Eric Blake <ebb9 <at> byu.net> writes:
> 
>>>  m4_defun([AS_UNSET],
>>> -[AS_REQUIRE([_AS_UNSET_PREPARE])dnl
>>> -$as_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
>>> +[{ unset $1 >/dev/null 2>&1 || :;}])
> 
> The bash 2.05a bug was that unset gave exit status 1 when it had no work to 
> do.  Wouldn't it just be easier to write:
> 
> m4_defun([AS_UNSET], [{ $1=; unset $1;}])
> 
> thus guaranteeing that unset has work to do, while letting unset properly 
> fail 
> (and stderr explain why) on attempts to unset a readonly variable?

Of course.  Good idea.  I'll then remove the other place where I used x=
before AS_UNSET([x]) just in case we screwed up something and we left a
few kilobytes worth of variable.

I'll also leave _AS_UNSET_PREPARE in AS_SHELL_SANITIZE.  $as_unset was
undocumented, but I'd rather not drop support right away for something
that Libtool uses.

Paolo




reply via email to

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