Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: bitwise short-circuiting Message-ID: <1988Feb25.192208.7664@utzoo.uucp> Keywords: bitwise optimize open-eyes Organization: U of Toronto Zoology References: <4224@june.cs.washington.edu> <2303@umd5.umd.edu>, <9130@ism780c.UUCP> Date: Thu, 25 Feb 88 19:22:08 GMT > 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