Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!brl-adm!adm!black@ee.UCLA.EDU From: black@ee.UCLA.EDU Newsgroups: comp.unix.questions Subject: Re: Evaluating autoincrements in function calls Message-ID: <4715@brl-adm.ARPA> Date: Thu, 26-Feb-87 19:47:33 EST Article-I.D.: brl-adm.4715 Posted: Thu Feb 26 19:47:33 1987 Date-Received: Sat, 28-Feb-87 06:56:19 EST Sender: news@brl-adm.ARPA Lines: 20 > numbers in set indexed by incr integer = 3,2,1 > numbers in set indexed by constants = 1,2,3 I recall having this happen once. Actually, it never 'happened'; I caught it before it was a bug (in the larval stage, one could say :=)). A pass from lint caught it and said, "Order of evaluation unspecified." If you look at "The Bible" (K&R C), page 192, you will see that the comma operator does not really apply to this case. Furthermore, K&R, page 50, states a case almost exactly like yours and concludes: "...writing code which depends on order of evaluation is bad..." Caveat hacker! Rex Black black@ee.ucla.edu ARPA ...!{ihnp4,ucbvax,sdcrdcf,trwspp}!ucla-cs!uclaee!black UUCP Disclaimer: No offense intended.