This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/47386] New: Wrong warning: âw.dim[2].strideâ may be used uninitialized in this function [-Wuninitialized]


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


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