Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!hc!lanl!cmcl2!rutgers!att!ihlpl!knudsen From: knudsen@ihlpl.ATT.COM (Knudsen) Newsgroups: comp.lang.c Subject: For loop bugs? Was Re: What does Z["ack"] = 5 mean? Summary: Tell me more! Message-ID: <7224@ihlpl.ATT.COM> Date: 14 Oct 88 20:17:48 GMT References: <14999@agate.BERKELEY.EDU> <4700019@m.cs.uiuc.edu> <6945@cdis-1.uucp> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 16 In article <6945@cdis-1.uucp>, tanner@cdis-1.uucp (Dr. T. Andrews) writes: > It is also possible that compiler writers will get the "for" loop > handling wrong. It is unwise to depend on "for" loops in portable > code. Use a "while" loop instead. Could you elaborate more on what kind of errors are most likely in compiling for loops? In testing? Incrementing? I for one can't see converting all for's to while's in a piece of code. Believe me, I've worked for years with a buggy compiler and I haven't seen it hose up a for loop yet, other than its usual problems with testing expr != 0. -- Mike Knudsen Bell Labs(AT&T) att!ihlpl!knudsen "Lawyers are like handguns and nuclear bombs. Nobody likes them, but the other guy's got one, so I better get one too."