Re: Kernel bugs found using inspect tool

From: Peter T. Breuer (ptb@it.uc3m.es)
Date: Wed Feb 23 2000 - 11:35:06 EST


> [ptb]
> > But there are plenty of places in the kernel code where people write
> > if ((a == b) || (c == d) || (e < f)) ... It drives me batty, but Linus
> > does not seem to mind.
> >
>
> With out-of-order execution, note that if((a == b) | (c == d) | (e < f))
> runs faster if c, d, e, and f have no side effects--and the parens ARE
> required.

Eh? But you are using bitwise or. I had logical or, whose order is
defined, being that of lazy left-right evaluation, and whose precedence
is looser than that of the relational operators precisely so that you
can write boolean propositional compounds without those annoying parens.

Or am I wrong? It's been at least 15 years since I read K&R ...
Nah. No chance.

Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:33 EST