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]

[Bug fortran/54997] -Wunused-function gives false warnings for procedures passed as actual argument


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54997

--- Comment #4 from janus at gcc dot gnu.org 2012-10-20 21:46:12 UTC ---
The following removes the warning for s3:


Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c    (revision 192619)
+++ gcc/fortran/trans-decl.c    (working copy)
@@ -1854,6 +1854,9 @@ build_function_decl (gfc_symbol * sym, bool global
          || sym->attr.public_used))
     TREE_PUBLIC (fndecl) = 1;

+  if (sym->attr.referenced)
+    TREE_USED (fndecl) = 1;
+
   attributes = add_attributes_to_decl (attr, NULL_TREE);
   decl_attributes (&fndecl, attributes, 0);



but it also removes the warning on procedures which are really unused :(


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