[Bug c/36392] New: gcc doesn't warn if a static recursive function is unused

csaavedra at igalia dot com gcc-bugzilla@gcc.gnu.org
Fri May 30 14:12:00 GMT 2008


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



More information about the Gcc-bugs mailing list