Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.lang.c Subject: Re: for <==> while (an exception) Message-ID: <2429@sun.uucp> Date: Wed, 17-Jul-85 03:40:20 EDT Article-I.D.: sun.2429 Posted: Wed Jul 17 03:40:20 1985 Date-Received: Thu, 18-Jul-85 07:48:05 EDT References: <200@ur-cvsvax.UUCP> <314@dcl-cs.UUCP> Distribution: net Organization: Sun Microsystems, Inc. Lines: 10 > "while (1) statement"; which is less efficient in most cases as code is > generated to test if "1" equals "0". If your compiler generates code to test if "1" equals "0", you don't have a very good compiler. The Portable C Compiler generates the same code for "for(;;)" and "while(1)", and doesn't generate a test for things like "if(1 == 0)". I suspect most compilers do the same. Guy Harris