Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!know!pluto.hemel.bull.co.uk!pmoore From: pmoore@hemel.bull.co.uk (Paul Moore) Newsgroups: comp.lang.c Subject: Re: Funny mistake Message-ID: <1991Mar22.095735.837@hemel.bull.co.uk> Date: 22 Mar 91 09:57:35 GMT References: <8148@rsiatl.Dixie.Com> <15481@smoke.brl.mil> <1991Mar16.195153.15509@murdoch.acc.Virginia.EDU> <15490@smoke.brl.mil> <1891@array.UUCP> Organization: Bull HN UK Lines: 20 what seems to be needed is a compiler that will generater a warning about if(a=b) (lets own up here, we have all made this mistake at one time or another , I got so paranoid about this recently that I ended up writing while((a==getchar())!=EOF) Try fixing that one - and no compiler ever complains about "possible unintended non assignment") To stop the compiler moaning about perfectly good code how about a "yes I know there's an = instead of ==" pragama. Ie #pragma nowarn if(a=b) The pragma just applies to the next statement -- !---------------------------------------------------------------! ! Paul Moore, Bull HN UK, Maxted Rd,Hemel Hempstead, HP2 7DZ. ! ! Phone:(44) 442 232222 Fax:(44) 442 234084 ! ! pmoore@hemel.bull.co.uk "a smile, a song and a core dump" ! !---------------------------------------------------------------!