New answers tagged

10

If the compilers you have were based on the P-series, then I believe that there was indeed a bug. In the P-series compilers after P2, the destination of an assignment is determined by a routine named selector, which branches on the klass field of fcp, a variable that holds information about a relevant identifier. When the klass is func, i.e., when the ...


-4

Here is an explicit example of the behavior mentioned by texdr.aft in their posted question... Program testzog !DEC$ DEFINE flag=3 c ...... executable statements and some overly technical mumbo-jumbo call zog end subroutine zog !DEC$ IF (flag .eq. 3) WRITE (*,*) "This is compiled if flag equals 3.&...


4

Using an emulated IBM 1130 running DM2, I can confirm Leo B.'s example. It took a little modification to run on the 1130: // JOB // FOR *LIST SOURCE PROGRAM *ONE WORD INTEGERS SUBROUTINE ZERO(K) K = 0 RETURN END // DUP *DELETE ZERO *STORE WS UA ZERO // FOR *LIST ALL *IOCS(1132 PRINTER) *ONE WORD INTEGERS J = 1 ...


7

That fact is explicitly mentioned in the (Russian) book Ошибки-ловушки при программировании на фортране, 1987 (Errors and pitfalls in FORTRAN programming), page 88. One of the puzzles was to make the sequence of operators J=1 PRINT 1,J 1 FORMAT(' J = ',I1) print 0. The provided solution was PROGRAM TASK CALL ZERO(1) J=1 ...


0

This discussion is in support of the previous answers. Hopefully, this is not the answer to some other question that was not asked. The question was in reference to passing values without restriction in old compilers, but no reference was given to how old. So lets start at the time of really old. This appears to be a non-standard feature used in Univac ...


5

I'm too young to remember really old Fortran compilers, but the behaviour that you described occurs in all current Fortran compilers. It's a core part of the language standard, so we can safely assume that any standard-conforming compilers in the past used to work this way as well. Check out this example at https://godbolt.org/z/GKadP9rov (feel free to ...


5

In the 1990s, the company I worked for sold a suite of code analysis and refactoring tools for Fortran, marketed as PlusFort. The GXCHK module performed static analysis of Fortran code to look for common errors, including: Subprogram argument mismatch or misuse (e.g. constant actual argument is illegally modified by subprogram). Though I am no longer in ...


Top 50 recent answers are included