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]

-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


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