I request that gfortran optionally warn about entities appearing in a USE, ONLY
statement that are not later referenced in the program block where the USE
appears. For example, for the code

module util_mod
integer :: i,j
end module util_mod

program main
use util_mod, only: i,j
j = 1
print*,"j=",j
end program main

g95 -Wall -Wextra -c 

says

In file xunused_simple.f90:6

use util_mod, only: i,j
                      1
Warning (136): Module variable 'i' at (1) is never used
In file xunused_simple.f90:6

use util_mod, only: i,j
                      1
Warning (109): ONLY variable 'i' USE-d at (1) is never used or set


-- 
           Summary: warn about entities in USE, ONLY statement not later
                    used
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vivekrao4 at yahoo dot com


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

Reply via email to