Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!wasatch!utah-gr!uplherc!sp7040!sbc From: sbc@sp7040.UUCP (Stephen Carroll) Newsgroups: comp.lang.c Subject: Re: For statement not portable? (was: What does Z["ack"] = 5 mean?) Summary: hey, he's right! Message-ID: <545@sp7040.UUCP> Date: 21 Oct 88 15:31:07 GMT References: <14999@agate.BERKELEY.EDU> <4700019@m.cs.uiuc.edu> <6945@cdis-1.uucp> <888@vsi.COM> Organization: Unisys, Salt Lake City, UT Lines: 27 In article <888@vsi.COM>, friedl@vsi.COM (Stephen J. Friedl) writes: ] 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. ] ] In article <837@philmds.UUCP>, leo@philmds.UUCP (Leo de Wit) writes: ] > The semantics of the "for" statement seem pretty clear, though (see ] > K&R Appendix A, 9.6 & 9.8, 9.9). Could you be a bit more specific about ] > how they get it wrong? I didn't see any compilers broken in this respect ] > yet. If there are any, they would break a lot of existing code. ] ] Hold it hold it everybody. The only thing wrong with Dr. ] Andrews' note is the lack of the :-). ] ] The posting to which he was responding claimed that since some ] compilers can't hack "int[ptr]" array indexing that it should be ] considered nonportable. Well, int[ptr] is well-defined in the C ] language, and if a compiler doesn't support it then the compiler ] is broken. Dr. Andrews is making this point with sarcasm. ] you know, i just went back a re-read Dr. Andrews posting and he was being sarcastic. the first time through, i thought, as most everyone else did, that he was serious. i personally feel that he should be beat about the head and shoulders with a wet fish for not including a ":-)" in his posting though. ;-]