I found an inconsistency with /CHECKMATE and expressions as actual arguments. 😃
In the following two codes the argument (i) is an expression since i is in brackets.
In the first code (where i is undefined before the call to zzz), FTN95 correctly deduces that (i) cannot be evaluated since i is undefined and gives a run-time error with /CHECKMATE turned on.
module foo
contains
subroutine zzz(j)
integer :: j
j = 5
end subroutine
end module foo
program main
use foo
integer i ! Declare i but leave it undefined
call zzz((i)) ! Run time error generated here, since (i) is expression
print *, i
end program main
In the second code (where i is defined before the call to zzz) the assignment to j should generate a run time error with /CHECKMATE but doesn't. However, if I replace (i) with a different expression, e.g. i+0 an error is generated.
module foo
contains
subroutine zzz(j)
integer :: j
j = 5 ! Should generate a run time error here, but doesn't
end subroutine
end module foo
program main
use foo
integer i ! Declare i
i = 0 ! Define i before call to zzz
call zzz((i))
print *, i
end program main
Is it possible for a dummy argument that is associated with a bracketed actual argument be treated as a variable which cannot be changed please.