Path: utzoo!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!cs.umn.edu!cybrspc!roy From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail) Newsgroups: comp.lang.c Subject: Re: Funny mistake Message-ID: <4wFZy1w163w@cybrspc> Date: 18 Mar 91 02:11:02 GMT Article-I.D.: cybrspc.4wFZy1w163w References: <1991Mar17.184930.15049@colorado.edu> Organization: Villa CyberSpace, Minneapolis, MN Lines: 14 rainer@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@cs.umn.edu - OR- cybrspc!roy@cs.umn.edu perl -e '$x = 1/20; print "Just my \$$x! (adjusted for inflation)\n"' [space reserved for clever quote]{mail your submissions}