The following program attempts to use an assumed-size array argument as if it were an assumed-shape array. A compiler should be able to catch the error at compile time and refuse to produce an object file or an EXE. FTN95 happily compiles this code!
program assumed
implicit none
integer, parameter :: N = 100
real :: X(N)
!
call random_number(X)
print *,sadd(X)
contains
real function sadd(X)
implicit none
real X(*) ! note assumed size
sadd = sum(X(:)) ! bug here, X is not assumed shape, size(X) is unknown
return
end function sadd
end program assumed
In a longer program in which this error existed, the program crashed with an access violation. The /check and /checkmate options did not enable the bug to be detected or located.