conditional expression evaluation question

Larry Cipriani lvc at danews.ATT.COM
Fri Jan 16 03:43:10 AEST 1987


Tim Olson write:

> Well... C only guarantees short-circuit evaluation for the operators
> '&&' and '||', not every conditional expression.  Note that the code that
> Mr. Sipe includes uses only the bit-wise or '|' operator, so short
> circuit evaluation is *not* guaranteed...

A lot of C programmers don't know that both operands of & | and ^
*are guaranteed* to be evaulated.  Historically && and || are
more recent than & | and ^.  A lot of old code is laying around (at
least here) that should be changed to use the newer operators.

> 	Tim Olson
> 	Advanced Micro Devices
> 	ihnp4!amdcad!tim

-- 

Larry Cipriani   Cornet 353-4999 AT&T (614) 860-4999
{ihnp4|cbosgd}!cbsck!lvc   AT&T Network Systems rm 2B-220



More information about the Comp.lang.c mailing list