For statement not portable? (was: What does Z["ack"] = 5 mean?)

Stephen Carroll sbc at sp7040.UUCP
Sat Oct 22 01:31:07 AEST 1988


In article <888 at vsi.COM>, friedl at vsi.COM (Stephen J. Friedl) writes:
] In article <6945 at cdis-1.uucp> tanner at 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 at philmds.UUCP>, leo at 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.  ;-]



More information about the Comp.lang.c mailing list