This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47386] New: Wrong warning: âw.dim[2].strideâ may be used uninitialized in this function [-Wuninitialized]
- From: "anlauf at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Jan 2011 21:19:50 +0000
- Subject: [Bug fortran/47386] New: Wrong warning: âw.dim[2].strideâ may be used uninitialized in this function [-Wuninitialized]
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: anlauf@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