This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]