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

Joseph S. D. Yao jsdy at hadron.COM
Wed May 30 00:22:33 AEST 1990


In article <5916 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
>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:
>>> When did I say otherwise?
...
>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(;;)!.

Well, I was going to mention that this newsgroup was supposed to be
talking about the C standard, not on "implementation details."  I was
also tempted to say something biting about people who were compelled to
use profligate and utterly gratuitous profanity to try to make some
kind of point, and then called others babies.  However, we now have The
Man's Own Words, so let's see if I wasted thousands of dollars on a
degree in Logic.

While English is an inherently ambiguous language (as are all natural
languages, this being part of their compelling power), I think most
would agree that "... a compiler that the implementor claimed ...
[above]" Is logically equivalent to "If the implementor claims that a
compiler matches the standard's model of a hypothetical machine, then
that compiler would, in fact [or, necessarily - j] generate identical
code for ...".  Now, our universe of discourse in this newsgroup is
precisely the C standard and matters pertaining to it.  Compilers for
which the "If" clause of the above statement are untrue are, for our
purposes, not within the universe of discourse.  Therefore, let us
assume the "If" clause trivially true.  The statement then boils down
to "That compiler would [necessarily] generate identical code for ...".
Now, The Man has stated that he is not saying "the standard requires a
compiler to generate code in any particular way."  My perception is
that there is a contradiction here.

Now, I admit to being human, and making a lot of errors, even some
obvious ones.  My wife would certainly agree to that (sometimes).  So
perhaps my perception here is flawed.  I'm sure I made a mistake in the
introduction, namely, if I want a certain person to read this object-
ively, I shouldn't have referred slightingly to language habits over
which he perhaps has no control.  However, if I have made any mistakes
in the above analysis, I would appreciate people MAILing them to me,
and I will post any reasonable ones I receive.  Thank you.

	Joe Yao				jsdy at hadron.COM
	( jsdy%hadron.COM@{uunet.UU.NET,decuac.DEC.COM} )
	arc,arinc,att,avatar,blkcat,cos,decuac,\
	dtix,ecogong,grebyn,inco,insight,kcwc,  \
	lepton,lsw,netex,netxcom,phw5,research,  >!hadron!jsdy
	rlgvax,seismo,sms,smsdpg,sundc,telenet, /
	uunet				       /
(Last I counted ...)



More information about the Comp.std.c mailing list