:ADDPATCH:
This is a version of a patch [1] just for the C front-end. The
original patch worked fine in C++ except for anonymous namespaces.
However, fixing that causes other problems that seem to have deeper
roots [2]. I called for help or to ignore the issue of anonymous
namespaces [3] more than one month ago. Being unsuccessful, I prefer
to at least commit the C bits, close the original PR and open a new PR
specifically for the C++ front-end.
Does this seem OK?
Bootstrapped and regression tested with --enable-languages=all on
i686-pc-linux-gnu
Cheers,
Manuel.
2007-05-20 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.
testsuite/
* gcc.dg/Wunused-function.c: New.
[1] http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00171.html
[2] http://gcc.gnu.org/ml/gcc-patches/2007-03/msg01606.html
[3] http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00118.html