This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
gfortran misses uninit vars in contained subroutines
- From: Bill Paxton <paxton at kitp dot ucsb dot edu>
- To: fortran at gcc dot gnu dot org
- Date: Thu, 30 Jun 2011 11:02:43 -0700
- Subject: gfortran misses uninit vars in contained subroutines
Just in case this one isn't already on the TO-DO list.
I'm running this version:
GNU Fortran (GCC) 4.5.1 20100506 (prerelease)
this illustrates the problem -- there is no report of the use of uninitialized variable x in subroutine t inside of subroutine test.
gfortran test_uninit.f -O2 -Wall -o test; ./test
module test_mod
implicit none
contains
subroutine test
integer :: x, y
call t
write(*,*) 'y', y
contains
subroutine t
y = x * 5
end subroutine t
end subroutine test
end module test_mod
program test_uninit
use test_mod
implicit none
call test
end program test_uninit