Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!dali.cs.montana.edu!milton!sumax!polari!thebes!camco!bill From: bill@camco.Celestial.COM (Bill Campbell) Newsgroups: comp.lang.c Subject: Re: Funny mistake Message-ID: <775@camco.Celestial.COM> Date: 16 Mar 91 21:54:32 GMT References: <1991Mar13.125034.2825@st-andy.uucp> <13337@helios.TAMU.EDU> <8148@rsiatl.Dixie.Com> <15481@smoke.brl.mil> Organization: Celestial Software, Mercer Island, WA Lines: 24 In <15481@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes: >In article <8148@rsiatl.Dixie.Com> stan@Dixie.Com (Stan Brown) writes: >>>"if (a = b)" instead of "if (a == b)". >>... I have yet to see a UNIX compiler complain about it >That's good, because it is valid C and the compiler cannot know whether >or not it reflects the programmer's intentions. My personal preferance would be a WARNING message. Certainly it is a legal construction, but 90% of the time when I do this it was my mistake! I'm not perfect and I would like the compiler to point out places where it is likely that I didn't do something right. I usually avoid this particular construction simply because every time I look at it at some later date I will have to figure out whether I did it right in the first place :-) Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software UUCP: ...!thebes!camco!bill 6641 East Mercer Way uunet!camco!bill Mercer Island, WA 98040; (206) 947-5591