module crud_mod
implicit none
private
public :: foo
integer, parameter :: one = 1
contains
subroutine foo()
print*,"foo"
end subroutine foo
!
subroutine bar()
print*,"bar"
end subroutine bar
end module crud_mod
mingw gcc version 4.0.3 (g95 0.91!) Mar 8 2007 with the command
g95 -c -Wextra crud.f90
warns about unused PRIVATE entities, saying
In file crud.f90:5
integer, parameter :: one = 1
1
Warning (159): PARAMETER 'one' at (1) is never used
In file crud.f90:11
subroutine bar()
1
Warning (167): PRIVATE module procedure 'bar' at (1) is never invoked
I don't know of other compilers with this (IMO nice) feature -- I
tried gfortran and Intel. It's useful in detecting dead code.