-Wmaybe-uninitialized: warning in Windows but not in Linux.

Jorge D'ELIA jdelia@intec.unl.edu.ar
Tue Dec 27 19:29:00 GMT 2011


Hi Gfortran developers,

I have some warning messages in Windows but not 
Linux, when the attached example is compiled with the 
-Wmaybe-uninitialized flag (through the -Wall one) 
and the following lines:
    ...
    allocate (c (nb,nb), stat = ier1 )
    allocate (s (nb)   , stat = ier2 )
    allocate (y (nb,nz), stat = ier3 )
    ...

The warning messages are:

 D:\TMP>gfortran-beta -c -Wall -std=f2008 -O1 test.f90
 test.f90: In function 'trouble':
 test.f90:33:0: warning: 'y.offset' may be used 
   uninitialized in this function [-Wmaybe-uninitialized]
 test.f90:33:0: warning: 'y.dim[1].stride' may be used 
   uninitialized in this function [-Wmaybe-uninitialized]
 test.f90:60:0: warning: 'y.dim[1].ubound' may be used 
   uninitialized in this function [-Wmaybe-uninitialized]
 test.f90:60:0: warning: 'y.dim[0].ubound' may be used 
   uninitialized in this function [-Wmaybe-uninitialized]
 test.f90:62:0: warning: 's.dim[0].ubound' may be used 
   uninitialized in this function [-Wmaybe-uninitialized] 

However, these warning messages disappear with
    ...
    allocate (c (nb,nb) )
    allocate (s (nb)    )
    allocate (y (nb,nz) )
    ...

The version of the compiler is:

D:\TMP>gfortran-beta --version
  GNU Fortran (GCC) 4.7.0 20111212 (experimental) 
  [trunk revision 182257]
  Copyright (C) 2011 Free Software Foundation, Inc.

and the Windows version is the XP Colossus Edition 2, 
on an Intel (R), Pentium (R) 4 CPU 2.4 GHz machine.

Please, someone could give me any suggestions to fix it?

Regards,

Jorge.
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.f90
Type: text/x-fortran
Size: 1849 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111227/b971f0a0/attachment.bin>


More information about the Fortran mailing list