for(;;) vs. while(1) is a draw

Blair P. Houghton bph at buengc.BU.EDU
Tue May 29 10:29:37 AEST 1990


In article <0:P3-A6 at ggpc2.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:
>In article <5904 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
>> In article <Z4O3P:2 at xds13.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:
>> >I don't believe that is an operative statement. The quote you gave means
>> >the compiler can legally generate any code it likes for anything, so long
>> >as the semantics match the abstract machine.
>
>> When did I say otherwise?
>
>When you said the standard requires the compiler generate identical code
>for !while(1)! and !for(;;)!.

You're lucky I got it all out of my system flaming at Doug 'n' Guy,
the Freak Brothers of comp.std.c.

I did not say the standard requires a compiler to generate
code in any particular way.  I said that a compiler that
the implementor claimed to be matching the standard's model
of a hypothetical machine would, in fact, generate
identical code for !while(1)!  and !for(;;)!.

I think that's about the twelfth time I've said it.  From now
on, anyone who thinks otherwise goes on the clock and gets
a bill from me for my services.  I don't have time to play
games with little babies who whine "why?" every time I say
something, UNLESS they're paying me by the hour.  Then I have
all damn day.

				--Blair
				  "Either get an education or
				   utilize the one you told your
				   employer you'd earned."



More information about the Comp.std.c mailing list