Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!ucdavis!deneb!cccmark From: cccmark@ucdavis.UUCP (Mark Nagel) Newsgroups: comp.lang.c Subject: Re: conditional expression evaluation question Message-ID: <78@ucdavis.UUCP> Date: Tue, 13-Jan-87 12:34:23 EST Article-I.D.: ucdavis.78 Posted: Tue Jan 13 12:34:23 1987 Date-Received: Wed, 14-Jan-87 01:03:11 EST References: <2298@brl-adm.ARPA> Reply-To: cccmark@deneb.UUCP (Mark Nagel) Organization: University of California, Davis Lines: 21 The original question regarded the evaluation of a bitwise or expression which would *always* be fully evaluated. C only guarantees that logical expressions will be short circuited. There may be a problem with your expression though in other ways. C does not guarantee that an expression with side effects will be executed in any special order. Therefore, the original expression: if (*cp++ | *cp++ | *cp++ == 0) { ... } will evaluate each *cp++ eventually, but I do not believe you can assume the result will be the same as (*cp | *(cp+1) | *(cp+2)) followed by cp += 3 on all machines. - Mark Nagel ucdavis!deneb!cccmark@ucbvax.berkeley.edu (ARPA) mdnagel@ucdavis (BITNET) ...!{sdcsvax|lll-crg|ucbvax}!ucdavis!deneb!cccmark (UUCP)