Path: utzoo!attcan!uunet!vsi!friedl From: friedl@vsi.COM (Stephen J. Friedl) Newsgroups: comp.lang.c Subject: Re: For statement not portable? (was: What does Z["ack"] = 5 mean?) Summary: Can't you take a joke? Message-ID: <888@vsi.COM> Date: 19 Oct 88 03:19:03 GMT References: <14999@agate.BERKELEY.EDU> <4700019@m.cs.uiuc.edu> <6945@cdis-1.uucp> <837@philmds.UUCP> Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 24 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. -- Steve Friedl V-Systems, Inc. +1 714 545 6442 3B2-kind-of-guy friedl@vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl ---------Nancy Reagan on the Three Stooges: "Just say Moe"---------