Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rochester!pt.cs.cmu.edu!k.cs.cmu.edu!gjs From: gjs@k.cs.cmu.edu (Gregory Stein) Newsgroups: net.micro.mac Subject: Megamax bug? Message-ID: <1023@k.cs.cmu.edu> Date: Mon, 9-Jun-86 16:04:55 EDT Article-I.D.: k.1023 Posted: Mon Jun 9 16:04:55 1986 Date-Received: Wed, 11-Jun-86 00:54:53 EDT Reply-To: gjs@k.cs.cmu.edu (Gregory Stein) Distribution: net Organization: Carnegie-Mellon University, CS/RI Lines: 15 Keywords: I'm working in Megamax C, and I noticed a problem while I was in the debugger. It comes from these statements: for (i = ntables; i--; ) if (i == -1) I would expect this to get the value of i, decrement the stored value, and then exit or execute the statement. Rather, it tests the value before it decrements, and the loop exits with i = 0. Is this a bug in the code generation, or is C supposed to do this? Greg