From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15456 invoked by alias); 16 Nov 2012 13:42:40 -0000 Received: (qmail 15233 invoked by uid 48); 16 Nov 2012 13:42:22 -0000 From: "AstroFloyd at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55352] New: Erroneous gfortran warning of unused module variable when variable is only used in namelist Date: Fri, 16 Nov 2012 13:42:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: AstroFloyd at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg01499.txt.bz2 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: unassigned@gcc.gnu.org ReportedBy: AstroFloyd@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)