Static Analysis Problem Type Reference
This is a FORTRAN-only style warning indicating that an optional dummy argument was declared before a non-optional argument.
This usage is discouraged because it forces the caller to explicitly use the argument's name at each call.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Definition |
The definition of the formal parameters |
subroutine mysub(i,j)
! optional argument "i" is before nonoptional argument "j"
integer, optional :: i
integer :: j
if (present(i)) print *,i
print *,j
end
integer :: k
interface
subroutine mysub(i, j)
integer, optional :: i
integer :: j
end subroutine mysub
end interface
read *,k
call mysub(k, k)
call mysub(j=k)
end