🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1277

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

#1277
From: Karl Heuer
Date: Fri, 25 May 1990 03:16
13 lines
1281 bytes
In article <5897@buengc.BU.EDU> bph@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@ima.ima.isc.com or harvard!ima!karl), The Walking Lint
Technical Details
Message-ID: <16725@haddock.ima.isc.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!ima!haddock!karl
References: <5876@buengc.BU.EDU> <12955@smoke.BRL.MIL> <5879@buengc.BU.EDU> <12971@smoke.BRL.MIL> <5897@buengc.BU.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!snorkelwacker!spdcc!ima!haddock!karl
From: karl@haddock.ima.isc.com (Karl Heuer)
Newsgroups: comp.std.c
Subject: Re: for(;;) vs. while(1) is a draw
Message-ID: <16725@haddock.ima.isc.com>
Date: 25 May 90 03:16:12 GMT
References: <5876@buengc.BU.EDU> <12955@smoke.BRL.MIL> <5879@buengc.BU.EDU> <12971@smoke.BRL.MIL> <5897@buengc.BU.EDU>
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Cambridge, MA 02138-5302
Lines: 13