bitwise short-circuiting

Henry Spencer henry at utzoo.uucp
Fri Feb 26 05:22:08 AEST 1988


> I could not find any thing in the standard that requires evaluation of
> side effects of the operands if the result can be determined without
> evaluating the operands.

However, what you also didn't find was anything permitting incomplete
evaluation of operands.  If you read the material on expressions carefully,
you will find it says that the operands get evaluated.  Not that they get
evaluated only if necessary.  (Except in some special cases like &&.)  That
means their side effects must happen, at some point.  Optimizers are not
free to change that.
-- 
Those who do not understand Unix are |  Henry Spencer @ U of Toronto Zoology
condemned to reinvent it, poorly.    | {allegra,ihnp4,decvax,utai}!utzoo!henry



More information about the Comp.lang.c mailing list