I have found a bug in a large program where a subroutine was written as:
program main implicit none real, dimension(6) :: x call f(x, 7) write (*,*) x contains subroutine f(x, n) integer :: n real, dimension(n) :: x integer :: i do i = 1, n x(i) = 0.0 end do end subroutine f end program main
This program runs fine with ifort and bounds checking even though the code is obviously buggy. Is there an option to catch those kind of bugs? Obviously, I need an option that checks this kind of bugs at run-time where the dimension of the arrays is not statically known as here.