When do you use "if ( a = b )"? (was Re: Funny mistake)

Christopher R Volpe volpe at camelback.crd.ge.com
Mon Apr 1 23:23:54 AEST 1991


In article <20137 at alice.att.com>, ark at alice.att.com (Andrew Koenig) writes:
|>A while ago I remember a big argument about the difference between
|>code generated by a particular compiler for this:
|>
|>	a=b-c;
|>	if(a)
|>
|>and for this
|>
|>	if(a=b-c)

Are a,b,and c all of type "int"?

[Deleted description of implementation that gave different results.]

|>I believe that this behavior on the part of the compiler
|>is entirely reasonable.

Even if it's completely non-conforming?

|>-- 
|>				--Andrew Koenig
|>				  ark at europa.att.com
                                       
==================
Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com



More information about the Comp.lang.c mailing list