Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!bbnccv!bbncc5!keesan From: keesan@bbncc5.UUCP (Morris M. Keesan) Newsgroups: net.lang.c Subject: Re: Infinite loops Message-ID: <3587@bbncc5.UUCP> Date: Tue, 20-May-86 10:36:03 EDT Article-I.D.: bbncc5.3587 Posted: Tue May 20 10:36:03 1986 Date-Received: Fri, 23-May-86 23:16:08 EDT References: <577@ur-helheim.UUCP> <140@toram.UUCP> <185@brl-sem.ARPA> <6091@elsie.UUCP> Reply-To: keesan@bbncc5.UUCP (Morris M. Keesan) Organization: Bolt Beranek and Newman, Cambridge, MA Lines: 17 Keywords: while(1) Summary: V6 issued warning for while(1) In article <6091@elsie.UUCP> ado@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@bbn-unix.ARPA {decvax,ihnp4,etc.}!bbncca!keesan