home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!waikato.ac.nz!aukuni.ac.nz!ecmtwhk
- Newsgroups: comp.lang.fortran
- Subject: Re: programming style question
- Message-ID: <1992Aug17.013521.12017@ccu1.aukuni.ac.nz>
- From: ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig)
- Date: Mon, 17 Aug 1992 01:35:21 GMT
- References: <1992Aug16.195651.25319@news.Hawaii.Edu> <1992Aug16.221725.6760@ee.ubc.ca>
- Organization: University of Auckland, New Zealand.
- Lines: 17
-
- davem@ee.ubc.ca (david michelson) writes:
-
- > Is it dangerous or poor practice to assume that the variables
- > in a subroutine will retain the values assigned in the immediately
- > previous execution the next time it is called?
-
- Yes. This will fail on stack - oriented implementations, like most
- modern RISC architectures. Although most of the compilers on these
- machines have an option which saves variables across calls, because too
- much old code simply depends on it, there is a performance penalty for
- this.
-
- Put those variables into SAVE statements instead.
- --
- Thomas Koenig, ecmtwhk@ccu1.aukuni.ac.nz, ib09@rz.uni-karlsruhe.de
- The joy of engineering is to find a straight line on a double logarithmic
- diagram.
-