This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
-Wunused-function doesn't work for recursive functions
- From: Brian Wellington <Brian dot Wellington at nominum dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Jul 2002 11:44:45 -0700 (PDT)
- Subject: -Wunused-function doesn't work for recursive functions
When a recursive static function is defined but not used and
-Wunused-function is enabled, no warning is printed. That is:
----
#include <stdlib.h>
static void
foo() {
foo();
}
int
main(int argc, char **argv) {
exit(0);
}
----
does not print
testwarn.c:4: warning: `foo' defined but not used
as it would if foo() did not call itself. Presumably it should, as the
function isn't used.
Brian