The nonexistent operator (along = v. == lines)

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Sun Apr 7 07:53:31 AEST 1991


In article <372 at smds.UUCP> rh at smds.UUCP (Richard Harter) writes:
> #define AND(a,b)  ( !(a) ? ((b) && 0) : !!(b)  )
> appears to do the trick, modulo typoes.  However it occurs to me that a
> "clever" optimizing compiler would recognize that ((b) && 0 ) is always
> false and bypass the evaluation of b.  Perhaps the language lawyers can
> tell us if the language specifications *require* that b be evaluated.

I'm not much of a language lawyer, but yes, b is evaluated once.

---Dan



More information about the Comp.lang.c mailing list