Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!cwi.nl!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.lang.fortran Subject: Re: Is this a "feature"? Message-ID: <3589@charon.cwi.nl> Date: 24 May 91 22:58:06 GMT References: <1991May23.160841.402@ac.dal.ca> <5940@goanna.cs.rmit.oz.au> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 22 In article <5940@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: > In article <1991May23.160841.402@ac.dal.ca>, scrutton@ac.dal.ca writes: > > I'd like to find out if the SAVE statement existed in FORTRAN IV (66). > No. > > > I've come across some old (stylistically) code which doesn't use the > > statement and depends on static allocation. Every compiler I've tried > > will let you get away with referencing local variables assigned in > > previous calls to that routine so it's either a standard `feature' or > > part of the standard. > It was quite common, but it has _never_ been portable. Worse, assuming that common blocks retained their values across calls was not even portable. As soon as the highest (or is it lowest) routine in the call tree was exited the contents of common blocks could get undefined. That gave problems with some packages that had lots of subroutines that retained global data in common blocks. If the main program did not also declare the common block all bets were off. (Some plotting packages come to the mind where the common blocks would contain data such as current pen position.) And, yes, this failed indeed on some compiler/linker combinations. -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl