Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!teknowledge-vaxc!sri-unix!quintus!sun!limes@ouroborous From: limes@ouroborous (Greg Limes) Newsgroups: comp.lang.c Subject: "for" loops in C ... Message-ID: <73408@sun.uucp> Date: 18 Oct 88 16:46:39 GMT References: <14999@agate.BERKELEY.EDU> <4700019@m.cs.uiuc.edu> <6945@cdis-1.uucp> Sender: news@sun.uucp Reply-To: limes@ouroborous (Greg Limes) Organization: Sun Microsystems, Inc. Lines: 17 In-reply-to: tanner@cdis-1.uucp (Dr. T. Andrews) In article <6945@cdis-1.uucp>, tanner@cdis-1 (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. It is possible for compiler writers to get lots of things wrong; breaking something as fundamental as a "for" statment results in an unusable compiler. It is, well, kind of basic to the language. Dr. Andrews, can you provide an example of a compiler in common use that manages to get the for loop wrong? I will gladly make a note of such and stay away from them (and any other software produced by their writers). Portability usually includes such wild concepts as readability and maintainability (at least in my mind), and a properly organized "for" loop becomes a bit more opaque when reduced to a "while". --