Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!hplabs!hpda!hpisoa2!hpitg!brl-sem!ron@brl-sem From: ron@brl-sem Newsgroups: net.lang.c Subject: Re: Infinite Loops Message-ID: <185@brl-sem> Date: Wed, 30-Apr-86 01:10:00 EDT Article-I.D.: brl-sem.185 Posted: Wed Apr 30 01:10:00 1986 Date-Received: Tue, 13-May-86 01:21:02 EDT References: <8200004@ztivax> Lines: 12 > Unless you have a very unique optimizer, it is usually better to use the > for(;;) form rather than the while(1) form. Reason is: while(1) is > ALWAYS evaluated (ie. : is 1 TRUE? if so, continue) before each iteration, > whereas for(;;) compiles as a simple branch or jump instruction with no > test and no conditional branch. > Crapola. All the PCC impementations I've checked don't test the constant even when you don't turn the optimizer on. Our old PDP-11 Ritchie compiler does generate the test, but the standard -O optimizer removes it. Nothing unique here. -Ron