Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!ames!ucbcad!ucbvax!cbatt!danews!lvc From: lvc@danews.ATT.COM (Larry Cipriani) Newsgroups: comp.lang.c Subject: Re: conditional expression evaluation question Message-ID: <372@danews.ATT.COM> Date: Thu, 15-Jan-87 12:43:10 EST Article-I.D.: danews.372 Posted: Thu Jan 15 12:43:10 1987 Date-Received: Sat, 17-Jan-87 01:00:18 EST References: <207@rebel.UUCP> <14306@amdcad.UUCP> Organization: AT&T Medical Information Systems, Columbus, Oh Lines: 20 Summary: bitwise operator semantics 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