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/34092] New: Should warn about unused private variables


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


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