Static Analysis Problem Type Reference
A FORTRAN function is called as a subroutine.
This same kind of error can also happen when a FORTRAN dummy argument of type subroutine is invoked. That is, the subroutine that is invoked through a dummy argument might exhibit the same problem as can occur in a direct call. In this case, the problem may or may not happen, depending on what subroutine was passed to the dummy argument of subroutine type. There will be an additional code location in such cases that identifies the call site where the subroutine argument was passed in.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Call site |
The place where the function was called |
subroutine IAmASubroutine(i)
integer :: i
i = 5
end
real function IAmAFunction(i)
integer :: i
read *,i
IAmAFunction = 3.14 + i
end
subroutine ICallMyArg(sub)
external :: sub
call sub(j)
! actual function "IAmAFunction" is called as subroutine
print *,j
end
external :: ICallMyArg,IAmASubroutine,IAmAFunction
integer :: k
call ICallMyArg(IAmAProcedure)
call ICallMyArg(IAmAFunction)
! IAmAFunction is called as a subroutine
call IAmAFunction(k)
end