Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!noose.ecn.purdue.edu!mentor.cc.purdue.edu!purdue!haven!uvaarpa!murdoch!astsun8.astro.Virginia.EDU!gsh7w From: gsh7w@astsun8.astro.Virginia.EDU (Greg Hennessy) Newsgroups: comp.lang.c Subject: Re: Funny mistake Message-ID: <1991Mar21.021504.25553@murdoch.acc.Virginia.EDU> Date: 21 Mar 91 02:15:04 GMT References: <1991Mar16.195153.15509@murdoch.acc.Virginia.EDU> <15490@smoke.brl.mil> <1891@array.UUCP> Sender: usenet@murdoch.acc.Virginia.EDU Organization: University of Virginia Lines: 31 >>"if (a = b)" instead of "if (a == b)". >>... I have yet to see a UNIX compiler complain about it Me: #>-Then perhaps that is why having an optional flag to inform the user of #>-this sometimes suspicious code fragment may be a good idea. Doug Gwyn: #>In the world of UNIX, we normally rely on "lint" to generate warnings #>about *possible* problems like this. The compilers are expected to #>accept conforming translation units and silently translate them. Well, 1) I said optional flag, so the person who wants silent complations of their strictly conforming programs get it, and the person who wants warning can have that also. 2) Experiance has shown that having lint seperate from the compiler means that many people would not use it. I would sugguest that compilers should do lint (after setting a flag) as part of their function. I know for a fact that many would disagree. -- -Greg Hennessy, University of Virginia USPS Mail: Astronomy Department, Charlottesville, VA 22903-2475 USA Internet: gsh7w@virginia.edu UUCP: ...!uunet!virginia!gsh7w