Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!cmcl2!seismo!brl-tgr!tgr!mlaufer@bbncct.ARPA From: mlaufer@bbncct.ARPA (Michael Laufer) Newsgroups: net.lang.c Subject: Re : C Style Message-ID: <2679@brl-tgr.ARPA> Date: Thu, 31-Oct-85 17:47:14 EST Article-I.D.: brl-tgr.2679 Posted: Thu Oct 31 17:47:14 1985 Date-Received: Sat, 2-Nov-85 07:42:33 EST Sender: news@brl-tgr.ARPA Lines: 30 Wait just one minute there. Dan Levy (..!ihnp4!ttrdc!levy) writes : >>Scott's example done the RIGHT (i.e. my :-)) way: >> for(i = 0; i < 100; i++) { >> if(f1(x) == OK && >> f2(x) == OK && >> f3(x) == OK && >> f4(x) == OK && >> f5(x) == OK ) { >> result[i] = 0; >> } >> else { >> result[i] = function6(x); >> } >> } >.......... The && operator >doesn't GUARANTEE the chronological order of evaluation is going to be left >to right, if you have a screwball compiler (though it most probably will be). I hope this is not the case or I know a lot of code that will self destruct. In Harbison & Steele _A_C_Reference_Manual_ on page 181 : ....the logical operator '&&' guarantees left-to-right conditional evaluation. Any compilers that do not work this way cannot really call themselves 'C' compilers. What does the ANSI standard say about this? Michael Laufer mlaufer@bbn-unix.arpa