This is the mail archive of the gcc-patches@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]

[C/C++] PR c/4076 -Wunused doesn't warn about static function only called by itself


:ADDPATCH C / C++:

-Wunused currently does not warn about static functions that are
called only by themselves. This patch prevents marking a function as
used if the call is done within the same function.

Bootstrapped and regression tested with --enable-languages=all.
This patch has found a few unused in GCC codebase.

OK for mainline?


2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>


 PR c/4076
 * c-typeck.c (build_external_ref): Don't mark as used if called from itself.
 * calls.c (rtx_for_function_call): Likewise.

cp/
 * call.c (build_call_a): Don't mark as used if called from itself.
 * semantics.c (finish_id_expression): Likewise.

testsuite/
 * gcc.dg/Wunused-function.c: New.
 * g++.dg/warn/Wunused-function.C: New.

Attachment: wunused-function.diff
Description: Text document


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