This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/36392] New: gcc doesn't warn if a static recursive function is unused
- From: "csaavedra at igalia dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 May 2008 14:12:11 -0000
- Subject: [Bug c/36392] New: gcc doesn't warn if a static recursive function is unused
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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