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/56670] New: Allocatable-length character var causes bogus warning with -Wall


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56670

             Bug #: 56670
           Summary: Allocatable-length character var causes bogus warning
                    with -Wall
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: townsend@astro.wisc.edu


Compiling this short test case with the -Wall option:

program uninit_test

  implicit none

  character(LEN=:), allocatable :: name_format

  name_format = ''

end program uninit_test

...causes the following bogus warning:

uninit_test.f90: In function âuninit_testâ:
uninit_test.f90:7:0: warning: â.name_formatâ may be used uninitialized in this
function [-Wmaybe-uninitialized]
   name_format = ''
 ^

(Note also that the warning arises in the main program, and not in a function
as the message suggests).

gfortran -v:

Using built-in specs.
COLLECT_GCC=/Applications/madsdk/bin/gfortran.exec
COLLECT_LTO_WRAPPER=/Applications/madsdk/libexec/gcc/x86_64-apple-darwin11.4.2/4.8.0/lto-wrapper
Target: x86_64-apple-darwin11.4.2
Configured with: ./configure CC='gcc -D_FORTIFY_SOURCE=0'
--build=x86_64-apple-darwin11.4.2 --prefix=/Applications/madsdk
--with-gmp=/Applications/madsdk --with-mpfr=/Applications/madsdk
--with-mpc=/Applications/madsdk --enable-languages=c,c++,fortran
--disable-multilib
Thread model: posix
gcc version 4.8.0 20130314 (experimental) (GCC)

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