Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bad optimisations: (Was: Test version zsh-3.1.6-test-1)
- X-seq: zsh-workers 7171
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Bad optimisations: (Was: Test version zsh-3.1.6-test-1)
- Date: Fri, 16 Jul 1999 11:20:41 +0200 (MET DST)
- In-reply-to: Peter Stephenson's message of Fri, 16 Jul 1999 10:45:19 +0200
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Peter Stephenson wrote:
> Sven Wischnowsky wrote:
> > Playing some more: both
> >
> > firstarg = (*args && **args == '?' ? *args++ : *args);
> >
> > and
> >
> > if (*args && **args == '?')
> > firstarg = *args++;
> > else
> > firstarg = *args;
> >
> > work around the bug, too. Should I send a patch for one of these? They
> > probably keep the code better readable (although they don't look much
> > less silly).
>
> That might look a bit neater. You'd better send it relative to the altered
> code, so I don't have to spend all of 30 seconds backing that off.
Yup.
Bye
Sven
--- os/builtin.c Fri Jul 16 08:35:14 1999
+++ Src/builtin.c Fri Jul 16 11:19:35 1999
@@ -3261,16 +3261,10 @@
nchars = 1;
args++;
}
-
- firstarg = *args;
- if (*args && **args == '?') {
- args++;
- /* default result parameter */
- reply = *args ? *args++ : ops['A'] ? "reply" : "REPLY";
- /* (If we put this reply=... after the `if' gcc-2.8.1 under
- Digital Unix 4.0 generates incorrect code.) */
- } else
- reply = *args ? *args++ : ops['A'] ? "reply" : "REPLY";
+ /* This `*args++ : *args' looks a bit weird, but it works around a bug
+ * in gcc-2.8.1 under DU 4.0. */
+ firstarg = (*args && **args == '?' ? *args++ : *args);
+ reply = *args ? *args++ : ops['A'] ? "reply" : "REPLY";
if (ops['A'] && *args) {
zwarnnam(name, "only one array argument allowed", NULL, 0);
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author