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



             Bug #: 55352

           Summary: Erroneous gfortran warning of unused module variable

                    when variable is only used in namelist

    Classification: Unclassified

           Product: gcc

           Version: 4.7.2

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: fortran

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: astrofl...@gmail.com





Created attachment 28709

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28709

Minimal example source code



gfortran-4.7.2 -Wall gives a warning about unused module variables when those

variables are only used in a namelist.



Test: compile the attached minimal example source file test.f90 with:

gfortran -v -Wall -Werror test.f90 -o test



The following warning is printed:

test.f90:14.6:



  use data, only: a

      1

Warning: Unused module variable 'a' which has been explicitly imported at (1)



The warning goes away when print*,a is uncommented in line 20.  Verbose output

is in the attached file compile_output.txt





Get:     warning about unused module variable

Expect:  no warning

Reproduceable:  always

gfortran version: gcc version 4.7.2 (Gentoo 4.7.2 p1.3, pie-0.5.5)

Reply via email to