This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54997] -Wunused-function gives false warnings for procedures passed as actual argument
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 21 Oct 2012 13:48:38 +0000
- Subject: [Bug fortran/54997] -Wunused-function gives false warnings for procedures passed as actual argument
- Auto-submitted: auto-generated
- References: <bug-54997-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54997
--- Comment #5 from janus at gcc dot gnu.org 2012-10-21 13:48:38 UTC ---
(In reply to comment #4)
> The following removes the warning for s3:
>
> [...]
>
> but it also removes the warning on procedures which are really unused :(
This fixed by the following:
Index: gcc/fortran/parse.c
===================================================================
--- gcc/fortran/parse.c (revision 192619)
+++ gcc/fortran/parse.c (working copy)
@@ -3928,7 +3928,6 @@ gfc_fixup_sibling_symbols (gfc_symbol *sym, gfc_na
gfc_symtree *st;
gfc_symbol *old_sym;
- sym->attr.referenced = 1;
for (ns = siblings; ns; ns = ns->sibling)
{
st = gfc_find_symtree (ns->sym_root, sym->name);
@@ -4050,7 +4049,6 @@ parse_contained (int module)
/* Mark this as a contained function, so it isn't replaced
by other module functions. */
sym->attr.contained = 1;
- sym->attr.referenced = 1;
/* Set implicit_pure so that it can be reset if any of the
tests for purity fail. This is used for some optimisation