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 ...
Here is an explicit example of the behavior mentioned by texdr.aft in their posted question...
!DEC$ DEFINE flag=3
c ...... executable statements and some overly technical mumbo-jumbo
!DEC$ IF (flag .eq. 3)
WRITE (*,*) "This is compiled if flag equals 3.&...
Using an emulated IBM 1130 running DM2, I can confirm Leo B.'s example. It took a little modification to run on the 1130:
*LIST SOURCE PROGRAM
*ONE WORD INTEGERS
K = 0
*STORE WS UA ZERO
*ONE WORD INTEGERS
J = 1
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
1 FORMAT(' J = ',I1)
The provided solution was
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 ...
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 ...
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 ...