Is this (another) bug?

Salvatore Filippone sfilippone@uniroma2.it
Wed Feb 2 12:59:00 GMT 2005


While does the runtime give me an error on the attached code? What am I
missing? 
While we're at it, it would be nice if it gave a backtrace; in another
application I am getting a DEALLOCATE failure with no hint as to where
it happened (and I can't use STAT because PR 17792 is still open..


----------i686-linux-gnu-------- 
[sfilippo@localhost TEMP]$ gfortran -fbounds-check -o tmp2 tmp2.f90 
[sfilippo@localhost TEMP]$ ./tmp2
Fortran runtime error: Array reference out of bounds
[sfilippo@localhost TEMP]$ gfortran -v
Using built-in specs.
Configured with: ../gcc-4.0-20050130/configure
--prefix=/usr/local/gfortran
Thread model: posix
gcc version 4.0.0 20050130 (experimental)

----------------------------- tmp2.f90 ---------------------------
program tmp2
  integer, parameter  :: n=10
  real    :: v(n)
  
  call mysub(n,v)

  print *,v(1:2)

  stop
end program tmp2

subroutine mysub(n,v)
  integer :: n
  real    :: v(*)

  if (n<=0) return
  do i=1, n 
    v(i) = i*i
  end do
  return
end subroutine mysub




-- 
Salvatore Filippone <sfilippone@uniroma2.it>



More information about the Fortran mailing list