This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/66869] [6 regression] -Wunused-function no longer warns for static declarations without definition
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Dec 2015 12:57:16 +0000
- Subject: [Bug debug/66869] [6 regression] -Wunused-function no longer warns for static declarations without definition
- Auto-submitted: auto-generated
- References: <bug-66869-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66869
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu.org,
| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The problem is caused by the move of check_global_declaration* into cgraph; the
problem is that these decls that are never used are simply never added to the
cgraph.
Trying to emit this warning at the end of c_write_global_declarations_1 (if a
decl satisfies those conditions and does not have a cgraph node, emit warning)
might be ok, unless there is the possibility that a cgraph node would be
created for it later on.