Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!uunet!mcsun!ukc!dcl-cs!gdt!gdr!exspes From: exspes@gdr.bath.ac.uk (P E Smee) Newsgroups: comp.std.c Subject: Re: observability Message-ID: <1989Sep11.092435.21016@gdt.bath.ac.uk> Date: 11 Sep 89 09:24:35 GMT References: <1237@gmdzi.UUCP> <10885@smoke.BRL.MIL> <242@ssp1.idca.tds.philips.nl> <10937@smoke.BRL.MIL> <1989Sep6.160709.4890@light.uucp> <1989Sep6.183349.2866@jarvis.csri.toronto.edu> <28946@news.Think.COM> <1989Sep8.091010.12450@gdt.bath.ac.uk> <10321@csli.Stanfor Reply-To: exspes@gdr.bath.ac.uk (P E Smee) Organization: University of Bristol c/o University of Bath Lines: 26 In article <10321@csli.Stanford.EDU> poser@csli.stanford.edu (Bill Poser) writes: >In article <1989Sep8.091010.12450@gdt.bath.ac.uk> exspes@gdr.bath.ac.uk (P E Smee) writes: >>one might ask why you would want to write a chunk >>of code that has ZERO effect. > >I sometimes do this during program development. I declare the data >structures and write the code that operates on them, leaving the i/o >to worry about later. I may want to compile at this point to check >for errors in the code. Well, maybe. Still, in that case you shouldn't be using an optimizing pass of the compiler yet, and I at least would claim that a non-optimizing compiler *shouldn't* go rearranging the code in any significant manner. (And, I would also assert that a compiler *shouldn't* go throwing away blocks of code simply because they don't do anything, without warning you it's doing so -- again on grounds that people don't usually intend their code to do nothing.) Alternatively, take that as (yet another) reason for using C rather than FORTRAN. -- Paul Smee | JANET: Smee@uk.ac.bristol Computer Centre | BITNET: Smee%uk.ac.bristol@ukacrl.bitnet University of Bristol | Internet: Smee%uk.ac.bristol@nsfnet-relay.ac.uk (Phone: +44 272 303132) | UUCP: ...!mcvax!ukc!gdr.bath.ac.uk!exspes