Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!mouse From: mouse@thunder.mcrcim.mcgill.edu (der Mouse) Newsgroups: comp.lang.c Subject: Re: if this legal code? Message-ID: <1991Jun28.161740.5243@thunder.mcrcim.mcgill.edu> Date: 28 Jun 91 16:17:40 GMT References: <1991Jun25.235904.23103@netcom.COM> Organization: McGill Research Centre for Intelligent Machines Lines: 32 In article <1991Jun25.235904.23103@netcom.COM>, aed@netcom.COM (Andrew Davidson) writes: > here is a piece of code I am responceible for maintaining. > if (! ((tt = testEntry.code - testCode) || (tt = testEntry.leg - testLeg))) > does the language guarentee that if testEntry.code -testCode is not > equal to 0, that the second assignment (tt = testEntry.leg - testLeg) > will not be executed? Yes. > will the -O compiler option flag effect this?? No, the code generator should effect it. The -O flag will not *affect* it (this aspect of it, at least) unless the compiler is badly broken. > personaly I would rewite this, but the orginal author will not allow > my. If you're maintaining it, it's your business, nay, your *duty* to make changes like that that you feel will improve the code. (If you make such judgements incorrectly, you're a bad choice as maintainer. In this case I don't think you'd be wrong.) I assume this conflict between supposed responsibility and actual privilege is imposed; you'll have to decide whether it's worth making a fuss over.... der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu