In the following code, the two subroutines aaa1 and aaa2 have the same signature and the compiler should detect this and generate an error message but it doesn't.
module xxx
interface aaa
module procedure aaa1
module procedure aaa2
end interface
contains
subroutine aaa1(a, b, c)
real :: a, b(2), c
c = a + b(1)
end subroutine aaa1
subroutine aaa2(b, a, c)
real :: b(2), a, c
c = a + b(1)
end subroutine aaa2
end module xxx
Both NAG and gfortran compilers correctly report the error in the above.
FTN95 should generate this error:
error 435 - Specific procedure AAA2 of type SUBROUTINE is too similar to AAA1 of type SUBROUTINE for overload AAA in module XXX. The arguments are too similar.
I know they [u:702f5f2791]look[/u:702f5f2791] like they have different signatures, but they don't. I can demonstrate the signatures are the same, since the following code works:
program main
use xxx
real :: s, w(4)
w = 0.0
call aaa1(w(1), w(3), s)
call aaa2(w(1), w(3), s)
end program main
The compiler seems to know something is wrong though, because the following doesn't compile, but the error message is misleading.
error 418 - No matching specific procedure for generic overloaded name AAA
program main2
use xxx
real :: s, w(4)
w = 0.0
call aaa(w(1), w(3), s)
end program main2