"for" loops in C ...

Greg Limes limes at ouroborous
Wed Oct 19 02:46:39 AEST 1988


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).

Portability usually includes such wild concepts as readability and
maintainability (at least in my mind), and a properly organized "for" loop
becomes a bit more opaque when reduced to a "while".
-- 



More information about the Comp.lang.c mailing list