Re: spurious out-of-bounds warning message

2023-07-13 Thread Arjen Markus via Fortran
I would say it is indeed very hard to capture all false positves. Regards, Arjen Op wo 12 jul 2023 om 17:05 schreef Vivek Rao via Fortran < fortran@gcc.gnu.org>: > For the code > > program main > implicit none > integer, parameter :: n = 10 > real :: x(n), dx(n) > integer :: i > call random_num

spurious out-of-bounds warning message

2023-07-12 Thread Vivek Rao via Fortran
For the code program main implicit none integer, parameter :: n = 10 real :: x(n), dx(n) integer :: i call random_number(x) do i=1,n    if (i > 1) then       dx(i) = x(i) - x(i-1)    else       dx(i) = 0.0    end if end do print*,dx end program main gfortran -Wextra says for GNU Fortran (GCC) 13.