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

Karl Heuer karl at haddock.ima.isc.com
Fri May 25 13:16:12 AEST 1990


In article <5897 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
>If I were to write a compiler under K&R1 and provide a no-optimization mode,
>`for(;;)' would be an unconditional branch and `while(1)' would compare 1 to
>0 and then branch-if-unequal, because that's what the syntax implies.

I suppose you would also compile `if (x==y)' into code that compares x against
y, sets a temporary to either 0 or 1, and then compares that value against
zero, right?

Your statements are vacuously true, because according to your definitions,
nobody has ever written a "non-optimizing" compiler.

Karl W. Z. Heuer (karl at ima.ima.isc.com or harvard!ima!karl), The Walking Lint



More information about the Comp.std.c mailing list