Infinite loops

Morris M. Keesan keesan at bbncc5.UUCP
Wed May 21 00:36:03 AEST 1986


In article <6091 at elsie.UUCP> ado at elsie.UUCP (Arthur David Olson) writes:
>If I recall my ancient history aright, the Version 6 C compiler generated the
>constant test, and the Version 6 optimizer failed to remove it.

The C compiler I was using on a PDP 11-70 V6 system not only generated a test
for "while(1)", it issued a warning!  ("Warning -- test for constant", or
some such).  I don't know if this was a standard feature of the V6 compiler or 
merely a local aberration.  I remember complaining to someone that if the
compiler was clever enough to notice the constant it should be clever enough
to avoid generating the test, and he defended the compiler's action by claiming
that the proper idiomatic expression was "for(;;)".  It's because of that
compiler that I still tend to write "for(;;)", even though "while(1)" seems
more intuitive to me.
-- 
Morris M. Keesan
keesan at bbn-unix.ARPA
{decvax,ihnp4,etc.}!bbncca!keesan



More information about the Comp.lang.c mailing list