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/54997] New: -Wunused-function gives false warnings for procedures passed as actual argument


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.


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