[torquedev] pbm_mom segfault in TMomCheckJobChild

Glen Beane glen.beane at gmail.com
Tue Dec 16 17:17:32 MST 2008


On Tue, Dec 16, 2008 at 3:06 PM, Joshua Bernstein
<jbernstein at penguincomputing.com> wrote:

>
> if (i == -1)
>        if (errno == EINTR)
>           continue;
>
> The ordering is important.  Otherwise the compiler sees if (a && b)
> and is allowed to look at 'b' first to handle short-circuit evaluation.

I would NEVER use such a brain dead compiler.  Compound Boolean
expressions are evaluated left to right.
if (ptr == NULL && ptr->foo == bar) is never going to access a null
pointer because a correct compiler is never going to do the ptr->foo
== bar test first.


More information about the torquedev mailing list