 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Sat Mar 10, 2018 2:56 pm Post subject: |
|
|
If the feature (ASSIGNed GOTO) was actually deleted in Fortran 95 et seq., then it is retained in a Fortran 95 compiler only as a favour to users, and isn't strictly legal, code-compliant, Fortran 95. (I say 'if' because that's what I read in various websites, but it may not be correct).
I think my position on retaining old features is clear, but then an ASSIGNed GOTO was always a rather crass thing in the first place, and surely has never been a commonplace feature of most people's source code.
Now there's something about the name FTN95 that may be of relevance here, but I can't put my finger on it just now. I wonder what it is?
Eddie |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Sat Mar 10, 2018 5:06 pm Post subject: |
|
|
Eddie, I don't think that I can do better than to repost an exchange on this very question between two rather prominent people recently. One (A) is the author of a text book on Fortran published by Springer. The other (B) is a member of the Fortran Standards committee.
A wrote: | In the 25+ years since F90, it has been replaced by several newer standards, and therefore implementing something in an F90 compiler seems to be a waste of effort, especially since (a) the code is useless, and (b) the code is now illegal. |
B wrote: | (a) doesn't matter to customers (b) is incorrect. It may not be valid F2003 or later, but in the real world, compilers that don't properly handle F77 and later are market failures. I'd go so far as to add F66 to that. As I wrote, a compiler that claims to support F90 needs to be able to correctly process any valid F90 source. |
Some current Fortran compilers let you specify -std=f77, -std=f90, -std=f95, etc., thereby controlling which standard is used in deciding the warnings and error messages to issue.
Even if one wishes to redeem oneself by removing ASSIGN from a legacy code, exorcising the ASSIGNed GOTOs requires a compiler that can compile the old code correctly, if one wishes to have some assurance that the modified code gives the same results as the old code.
We have, in fact, two failed compilers that prove the point made by "B". Both were subsets of Fortran 90/95: Lahey's ELF90, and Imagine1's F. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Sat Mar 10, 2018 9:54 pm Post subject: |
|
|
Springer seem to have published quite a few books on Fortran ... |
|
Back to top |
|
 |
mecej4
Joined: 31 Oct 2006 Posts: 1899
|
Posted: Mon Mar 12, 2018 1:53 pm Post subject: Re: |
|
|
John-Silver wrote: | ... to be strictly true shouldn't that message have ... "in ftn95" at the end ? ... as I thought it runs ok in other compilers. |
It is not easy for a compiler to emit a meaningful and pertinent error message. For the test program that I posted, the NAG compiler says:
Code: | Obsolescent: salasg.f, line 1: Fixed source form
Deleted feature used: salasg.f, line 14: ASSIGN statement
Error: salasg.f, line 14: ASSIGN to function name KA is not supported |
which is very well said. On the other hand, the venerable F2C from AT&T Bell Labs says:
Code: | salasg.f:
MAIN tasg:
ka:
Error on line 12 of salasg.f: out_asgoto: bad expr |
This tells me where the problem is, but the rest of it may be understandable only to the compiler writers. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|