Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Funny mistake Message-ID: <15490@smoke.brl.mil> Date: 16 Mar 91 22:30:05 GMT References: <8148@rsiatl.Dixie.Com> <15481@smoke.brl.mil> <1991Mar16.195153.15509@murdoch.acc.Virginia.EDU> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 12 In article <1991Mar16.195153.15509@murdoch.acc.Virginia.EDU> gsh7w@astsun.astro.Virginia.EDU (Greg Hennessy) writes: -#>>"if (a = b)" instead of "if (a == b)". -#>... I have yet to see a UNIX compiler complain about it -Doug Gwyn: -#That's good, because it is valid C and the compiler cannot know whether -#or not it reflects the programmer's intentions. -Then perhaps that is why having an optional flag to inform the user of -this sometimes suspicious code fragment may be a good idea. 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.