Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!mips!zaphod.mps.ohio-state.edu!uwm.edu!bionet!ames!skipper!elxsi!maine From: maine@elxsi.dfrf.nasa.gov (Richard Maine) Newsgroups: comp.lang.fortran Subject: Re: Microsoft Fortran Message-ID: Date: 8 Apr 90 21:49:44 GMT References: <1990Apr6.230725.17580@cs.dal.ca> <261E3495.2E05@deimos.cis.ksu.edu> <78998@tut.cis.ohio-state.edu> Sender: news@skipper.dfrf.nasa.gov Distribution: usa Organization: NASA Dryden, Edwards, Cal. Lines: 49 In-reply-to: rajiv_agrawal@brachiosaur.cis.ohio-state.edu's message of 8 Apr 90 08:08:35 GMT On 8 Apr 90 08:08:35 GMT, rajiv_agrawal@brachiosaur.cis.ohio-state.edu said: rajiv> Recently we upgraded to MS Fortran 5.0 and I have been quite happy with rajiv> the compiler. Much better than the previous versions except some new rajiv> errors have crept up ... SAVE statement for COMMON blocks. Last time rajiv> I compiled my code under MS FORTRAN 4.1, I never got any errors. Here is rajiv> what happens: rajiv> subroutine sub1 rajiv> common /abc/ x,y,x rajiv> save /abc/ rajiv> .... rajiv> end rajiv> subroutine sub2 rajiv> common /abc/ x,y,z rajiv> save /abc/ rajiv> ... rajiv> end rajiv> The compiler produces an error saying that ABC has already been rajiv> declared SAVE. Other compilers, RM/Fortran , VAX Fortran do rajiv> not give the above error. Maybe, its time I fished out an old rajiv> dusty copy of the Fortran 77 standard and verified what is rajiv> going on. You needn't bother dragging out the standard. My copy is more worn than dusty. What is going on is just another in the continuing saga of MS Fortran bugs. Not only does the standard allow the second declaration of /abc/ as save, the standard requires that you have both declarations. If a common block is declared saved in one subroutine, it must be declared saved in all subroutines in which it appears. I think I can detect some influence of c in MS Fortran's treatment of the save declaration as applying to all occurances in the file. For a similar problem with standard declarations, try subroutine sub1 intrinsic min integer min ... MS fortran barfs on that also. Admitedly, version 5.x seems to have fewer bugs than the prior versions, but it still has too many for me. I've been much happier with the Lahey compiler, which I've not yet seen a single bug in. (Oh, I'm sure it has some, in fact I've seen some bug lists on it, but I've never been bitten by one). -- Richard Maine maine@elxsi.dfrf.nasa.gov [130.134.64.6]