[gfortran] Fix NULL reference types.

Paul Brook paul@codesourcery.com
Fri Aug 20 21:25:00 GMT 2004


[rearranging the CC list a bit]

> Now, given that this is illegal, an adventurous Fortran compiler 
> engineer (e.g., X maintaining gfortran fifteen years after you have 
> abandoned it), might turn:
>
> subroutine sub1(a, b)
> intent(in) :: a
> intent(out) :: b
> if (a > 0) b = log(a)
> end
>
> into:
>
> subroutine sub1(a, b)
> intent(in) :: a
> intent(out) :: b
> real c
> if (a > 0) c = log(a)
> b = c
> end

Yes, I agree that this is the case for intent(out) variables.
Does the same apply if the intent is _not_ specified. 

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?

Paul



More information about the Fortran mailing list