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 c/36392] New: gcc doesn't warn if a static recursive function is unused


Take the following example:

  static 
  int a (void)
  {
        return a();
  }

  int 
  main ()
  {
        return 0;
  }

GCC doesn't warn that a() is an unused function.

This is problematic if you remove all calls to a() from your code. Although a()
uses itself, GCC should warn that no other function is using it, so that the
user could remove it.


-- 
           Summary: gcc doesn't warn if a static recursive function is
                    unused
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: csaavedra at igalia dot com


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


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