[gfortran] Fix NULL reference types.
Dale Johannesen
dalej@apple.com
Fri Aug 20 22:59:00 GMT 2004
> ie. is the following program legal?
>
> subroutine sub1(a, b)
> if (a > 0) b = log(a)
> end
>
> program prog
> integer i, j
> call sub1(0, 0)
> i = 1
> call sub1(i, j)
> end program
>
> Does the fact that b is redefined on some invocations of sub1 imply
> that every
> actual argument associated with b must be definable?
The language in F77 (15.9.3.2) is:
"If the actual argument is a constant ... the associated dummy
argument must not be redefined within the subprogram."
By itself, that is not totally clear; does that mean redefined
anywhere in the subprogram, or is redefinition a runtime property?
From 15.8.4 it appears that "defined" and "redefined" are indeed
runtime properties, so this seems to be valid.
I do not have F90, but what I do have (Metcalf/Reid book) does not
indicate any intent to deviate from F77 in this area.
More information about the Gcc-patches
mailing list