home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / fortran / 3059 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  1.1 KB

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