Funny mistake

Roy M. Silvernail roy%cybrspc at cs.umn.edu
Mon Mar 18 12:11:02 AEST 1991


rainer at boulder.Colorado.EDU (Rainer Malzbender) writes:

> I believe my Datalight (Zortech) compiler actually issues a warning if you
> say "if(a=b)", something like "possible unintended assignment". This actually
> helped me out a few times, but I've since switched to MSC6.0.

Turbo also issues "Possibly incorrect assignment" for constructs like
'if(x=get_key())...'. I don't think I've ever used 'if(a=b)', but I often
code assignments like the first example above. Makes more sense to me
than 'x=get_key();if(x)...'.
--
Roy M. Silvernail --  roy%cybrspc at cs.umn.edu - OR-  cybrspc!roy at cs.umn.edu
  perl -e '$x = 1/20; print "Just my \$$x! (adjusted for inflation)\n"'
        [space reserved for clever quote]{mail your submissions}



More information about the Comp.lang.c mailing list