Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!boingo.med.jhu.edu!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: One more point regarding = and == (more flamage) Message-ID: <15550@smoke.brl.mil> Date: 22 Mar 91 21:30:09 GMT References: <13603@helios.TAMU.EDU> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 20 In article <13603@helios.TAMU.EDU> byron@archone.tamu.edu (Byron Rakitzis) writes: >I have one more thing to say to the self-styled C gods who approve of >simple assignments as an implicit test against zero inside an if-statment. If that was intended as criticism of me in particular, all I can say about it is that one should understand the gods before criticizing them. >b) while ((*foo++ = *bar++) != 0) That's in fact the way I would code this particular case, which I consider a "straw man". On the other hand, I frequently write code such as: bool status; ... if ( status = WriteHeader() ) ... else ... return status; for which I would be extremely annoyed to receive gratuitous warnings from the compiler!