This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: host association question
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: dominiq at lps dot ens dot fr, sgk at troutmask dot apl dot washington dot edu
- Cc: fortran at gcc dot gnu dot org
- Date: Sun, 19 Nov 2006 22:50:11 +0100 (CET)
- Subject: Re: host association question
> If you add () to the above, then gfortran gives
>
> laptop:kargl[208] gfc -o z m.f90
> In file m.f90:9
>
> real :: internal_f(n)
> 1
> Error: Variable 'n' cannot appear in the expression at (1)
Since I am not sure that the code is valid if n is not defined,
I tried
program test_internal
implicit none
integer :: n
n=5
print *, size(internal_f())
contains
function internal_f()
real :: internal_f(n)
internal_f = 2
end function internal_f
end program test_internal
which prints 5 with xlf and g95 but gives the same error
with gfortran. So it looks like a bug in gfortran, though
I let more competent people decide about it!-)
Dominique