Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.7.0.10 $; site ccvaxa Path: utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!ccvaxa!aglew From: aglew@ccvaxa.UUCP Newsgroups: net.lang.c Subject: Re: Infinite loops Message-ID: <2600047@ccvaxa> Date: Fri, 18-Apr-86 19:46:00 EST Article-I.D.: ccvaxa.2600047 Posted: Fri Apr 18 19:46:00 1986 Date-Received: Mon, 21-Apr-86 03:24:05 EST References: <577@ur-helheim.UUCP> Lines: 39 Nf-ID: #R:ur-helheim.UUCP:577:ccvaxa:2600047:000:1019 Nf-From: ccvaxa.UUCP!aglew Apr 18 18:46:00 1986 while(1){} vs. for(;;) you forgot to mention do{}while(1); take a look at the code your compiler produces for each one. a good optimizing compiler should make them all the same, but not all compilers are good optimizing compilers. i fell into the habit of using while(1) on 68000s; when i started working on 80x86s i found that for(;;) was faster. i have therefore put #if defined(MPU68000) # define loop while(1) #elif defined(MPU8086) || defined(MPU80286) # define loop for(;;) #endif into my personal header. if do{}while(1) proved faster then I suppose I would have to put an endloop in. My favorites are #define the_sky_is_blue 1 while(the_sky_is_blue){} and #define ever_and_a_day ;; for(ever_and_a_day){} or, in Pascal CONST Hell_freezes_over = TRUE; REPEAT ... UNTIL Hell_freezes_over; But my boss gets angry enough at me as it is! (are you there, Gary?) Andy "Krazy" Glew. Gould CSD-Urbana. USEnet: ihnp4!uiucdcs!ccvaxa!aglew 1101 E. University, Urbana, IL 61801 ARPAnet: aglew@gswd-vms