Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!paperboy!hsdndev!husc6!redsox!campbell From: campbell@redsox.bsw.com (Larry Campbell) Newsgroups: comp.lang.c Subject: Re: Funny mistake Message-ID: <1991Mar20.024902.621@redsox.bsw.com> Date: 20 Mar 91 02:49:02 GMT References: <1991Mar13.125034.2825@st-andy.uucp> <13337@helios.TAMU.EDU> <8148@rsiatl.Dixie.Com> Reply-To: campbell@redsox.bsw.com (Larry Campbell) Distribution: comp Organization: The Boston Software Works, Inc. Lines: 32 In article <8148@rsiatl.Dixie.Com> stan@Dixie.Com (Stan Brown) writes: ->Hell, I have no idea what "fct" is for; but that remains me my mistakes, ->a VERY hard to catch one, because the string (see below) is still perfect ->C code (like that above - no SYNTAX error there!) : - ->"if (a = b)" instead of "if (a == b)". - - Some compilers will report this as a suspicous occurence. The - one I think I remember this on is Zortech, but I have yet to - see a UNIX compiler complain about it, The lint on my mchine - doesn't complain eithe. I wonder if anybody's does ? Under SVR4: /home/campbell> cat test.c #include void foo(int a, int b) { if (a = b) (void) printf("yow!\n"); } /home/campbell> lint -u test.c (5) warning: assignment operator "=" found where "==" was expected set but not used in function (3) a in foo I think the lint that comes with it is itself reason enough to run SVR4. -- Larry Campbell The Boston Software Works, Inc., 120 Fulton Street campbell@redsox.bsw.com Boston, Massachusetts 02109 (USA)