Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!agate!labrea!decwrl!sun!limes@ouroborous From: limes@ouroborous (Greg Limes) Newsgroups: comp.lang.c Subject: Re: "for" loops in C ... Message-ID: <73691@sun.uucp> Date: 19 Oct 88 22:16:40 GMT References: <14999@agate.BERKELEY.EDU> <4700019@m.cs.uiuc.edu> <6945@cdis-1.uucp> <73408@sun.uucp> <23299@amdcad.AMD.COM> Sender: news@sun.uucp Reply-To: limes@ouroborous (Greg Limes) Organization: Sun Microsystems, Inc. Lines: 23 In-reply-to: tim@crackle.amd.com (Tim Olson) In article <6945@cdis-1.uucp>, tanner@cdis-1 (Dr. T. Andrews) writes: >It is unwise to depend on "for" loops in portable >code. Use a "while" loop instead. In article <73408@sun.uucp> limes@ouroborous (Greg Limes) writes: >Dr. Andrews, can you provide an example of a compiler in common use that >manages to get the for loop wrong? In article <23299@amdcad.AMD.COM>, tim@crackle (Tim Olson) writes: >Didn't anyone else see what Dr. Andrews was pointing out? Saying that >you should avoid the construct 1["string"] is *like* ... I may have put my foot in the middle of that one, but maybe not. On the other hand, it is easier to simply say that I was asleep at the keyboard, then to point out the basic difference between getting a "for" construct wrong (something basic to the language and hard to get wrong) in a compiler, and failing to support subscripting an integer by a pointer (something a bit less basic, and in fact rather arcane, that may fall by the wayside if there are a lot of complex issues about pointers). So, sorry for being asleep at the keyboard. -- Greg Limes [limes@sun.com] semper ubi, sub ubi