[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_TRY_COMPILE() annoyances with 2.63b
From: |
Mike Frysinger |
Subject: |
Re: AC_TRY_COMPILE() annoyances with 2.63b |
Date: |
Tue, 14 Apr 2009 22:11:01 -0400 |
User-agent: |
KMail/1.11.1 (Linux/2.6.28; KDE/4.2.1; x86_64; ; ) |
On Tuesday 14 April 2009 21:09:47 Eric Blake wrote:
> According to Mike Frysinger on 4/14/2009 4:27 PM:
> >> $ if false; then :; else echo $?; fi
> >> 1
> >>
> >> But adding the : after the else, we have effectively made it impossible
> >> for the user to grab $? after the if condition, so I'll have to rethink
> >> this patch.
> >
> > use "(exit $?);" instead ?
>
> Absolutely not - that would be a performance killer (bash is among the
> shells that don't optimize away the subshell fork).
>
> To put it in perspective, before this week, all four of these would cause
> a syntax error:
>
> AS_IF([:], [AC_REQUIRE(...)])
> AS_IF([false], [], [AC_REQUIRE(...)])
> AS_IF([:], [ ])
> AS_IF([:], [], [ ])
>
> whereas even with today's regression fix, three of the four now pass
> (we're more lenient than we used to be, and we aren't breaking any
> existing scripts that used proper quoting).
well, is there any real need to preserve the exit value of the if statement ?
in other words, past implementations of autoconf didnt preserve it and it isnt
like anyone complained. the old generated code:
.......
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
<stuff from user 4th arg -- $? is now set to exit value of `sed`, not
the if>
fi
.......
-mike