"for" loops in C ...
Tim Olson
tim at crackle.amd.com
Wed Oct 19 11:32:49 AEST 1988
In article <73408 at sun.uucp> limes at ouroborous (Greg Limes) writes:
| In article <6945 at cdis-1.uucp>, tanner at 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 at crackle.amd.com)
More information about the Comp.lang.c
mailing list