http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47386
Summary: Wrong warning: ‘w.dim[2].stride’ may be used uninitialized in this function [-Wuninitialized] Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: anl...@gmx.de Hi. the following testcase demonstrates warnings that can be irritating: % cat gfcbug112.f90 module gfcbug112 implicit none logical :: ll = .false. contains subroutine calc_W (N, M) integer, intent(in) :: N, M real :: T(N,M,M) ! Temporary array 1 real, allocatable :: W(:,:,:) ! Temporary array 2 if(ll) then allocate (W(N,M,M)) end if T=0 if(ll) then W = 0 deallocate (W) end if end subroutine calc_W end module gfcbug112 % gfc-trunk -c -Wall -O gfcbug112.f90 gfcbug112.f90: In function ‘calc_w’: gfcbug112.f90:5:0: warning: ‘w.dim[2].stride’ may be used uninitialized in this function [-Wuninitialized] One can get really many of these in large modules... Harald