This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Internal procedure not allowed as actual argument


Hi all,
I have a question: why doesn't gfortran allow passing an internal
procedure as an argument to another procedure, as in this example:


subroutine sub


 call proc(f1)
 call proc(f2)

contains

 real function f1(x)
 ...
 end function f1

end subroutine sub


real function f2(x) ... end function f2


If we have a subroutine "proc" that expects an external function as its argument, "call proc(f2)" is allowed by gfortran, while "call proc(f1)" triggers an error like this:

Error: Internal procedure 'f1' is not allowed as an actual argument at (1)

g95 shows the same behaviour, but ifort doesn't complain about this at all.
Can anyone tell me what the reason for this restriction is?
Thanks,
Janus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]