This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34092] New: Should warn about unused private variables
- From: "terry at chem dot gu dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Nov 2007 15:17:23 -0000
- Subject: [Bug fortran/34092] New: Should warn about unused private variables
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider the following module:
module fred
implicit none
private
integer,parameter::i=1
integer::j
end module fred
With gcc version 4.3.0 20071109 (experimental) (GCC), no warnings are issued:
[tjf@fkpc167 Explore]$ gfortran -Wall -Wextra -c fred.f90
[tjf@fkpc167 Explore]$
Normally those module-level variables should not be warned about as they likely
are accessed in using program units. But in this case they are private to the
module. Unused variables with the private attribute cannot be used elsewhere
and should be warned about as if they were in a main program.
--
Summary: Should warn about unused private variables
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: terry at chem dot gu dot se
GCC host triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34092