[Bug fortran/54997] New: -Wunused-function gives false warnings for procedures passed as actual argument
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Oct 20 08:50:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54997
Bug #: 54997
Summary: -Wunused-function gives false warnings for procedures
passed as actual argument
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: janus@gcc.gnu.org
Follow-up to PR54224:
module m
implicit none
private :: s2,s3
contains
subroutine s1
call s2(s3)
end subroutine
subroutine s2(dummy)
procedure() :: dummy
end subroutine
subroutine s3()
end subroutine
end module
When compiled with -Wunused-function, this gives:
warning: ‘s3’ defined but not used [-Wunused-function]
subroutine s3()
Obviously s3 is not being called directly, but it is passed to s2, so it's
certainly not unused.
More information about the Gcc-bugs
mailing list