This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Toplevel Makefile.tpl cleanup 2/n part two
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Nathanael Nerode <neroden at twcny dot rr dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 04 Mar 2003 23:41:28 -0300
- Subject: Re: Toplevel Makefile.tpl cleanup 2/n part two
- Organization: GCC Team, Red Hat
- References: <20030305013905.GA759@doctormoo>
On Mar 4, 2003, Nathanael Nerode <neroden at twcny dot rr dot com> wrote:
>>> All the invocations of 'true' are, in fact, useless.
>>
>> Nope. Some make&shell combinations will fail if an `if' test fails
>> and there's no `else true' clause.
> You're saying that
> blah:
> if false ; then : fi ; true ;
> will actually *fail* in certain make/shell combinations?
That's my understanding, yes. The `false' exit status will be
regarded as the exit status of the if, and `true' may never get a
chance to run.
> Sure, the exit value of the if statement can be 1 or whatever, but in
> a ;-separated list, doesn't the exit value of the later statement
> override it?
Nope. set -e stops at the first error. Some makes run shell commands
with set -e enabled.
> Is there really a shell *that* broken?
IMO, the only brokenness is to propagate the exit status of the if
test to the if command in case an else clause is missing.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist Professional serial bug killer