Pádraig Brady <p...@draigbrady.com> writes: > I did also check the speed with a test program > (attached) which showed the logical test was a bit faster on my pentium-m. > Note I compiled without optimization
I would expect optimization would be crucial: I got the 60% increase in number of instructions for && when compiling with optimization, and without optimization there was almost no difference between && and &. Although I admit that it bugs me that the change makes the code slower and fatter, my primary objection is that short-circuit AND has more complicated semantics than Boolean AND, and we shouldn't necessarily favor the former over the latter. I agree that the bitwise part of the logical AND in traditional C 'int' semantics is a problem, but to my mind it's not a problem that necessarily overwhelms the short-circuit disadvantage. If it's safe to assume proper 'bool' support now, that would address the problem as well. Perhaps it's better to make that assumption now anyway, for reasons other than the one prompting this thread. After all, the subtle differences between C99 bool and C89 approximately-bool go beyond the && and || problem.