Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!bellcore!faline!thumper!ulysses!andante!amdcad!crackle!tim From: tim@crackle.amd.com (Tim Olson) Newsgroups: comp.lang.c Subject: Re: "for" loops in C ... Message-ID: <23299@amdcad.AMD.COM> Date: 19 Oct 88 01:32:49 GMT References: <14999@agate.BERKELEY.EDU> <4700019@m.cs.uiuc.edu> <6945@cdis-1.uucp> <73408@sun.uucp> Sender: news@amdcad.AMD.COM Reply-To: tim@crackle.amd.com (Tim Olson) Organization: Advanced Micro Devices, Inc. Sunnyvale CA Lines: 26 Summary: Expires: Sender: Followup-To: In article <73408@sun.uucp> limes@ouroborous (Greg Limes) writes: | 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). Didn't anyone else see what Dr. Andrews was pointing out? Saying that you should avoid the construct 1["string"] is *like* saying you should avoid a for loop, because both are fundamental constructs that a broken C compiler may not implement correctly. Avoiding something fundamental just because some compiler somewhere gets it wrong is no excuse -- FIX THE COMPILER. -- Tim Olson Advanced Micro Devices (tim@crackle.amd.com)