[Bug fortran/49693] Spurious "unused-variable" warnings for COMMON block module variables.

tkoenig at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 1 16:37:00 GMT 2012


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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2012-01-01 16:37:27 UTC ---
Testing this patch:

Index: toplev.c
===================================================================
--- toplev.c    (Revision 182754)
+++ toplev.c    (Arbeitskopie)
@@ -501,6 +501,9 @@
         to handle multiple external decls in different scopes.  */
       && ! (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl)))
       && ! DECL_EXTERNAL (decl)
+      /* Don't warn about variables in Fortran common blocks because
+        they may be used elsewhere.  */
+      && ! DECL_COMMON(decl)
       && ! TREE_PUBLIC (decl)
       /* A volatile variable might be used in some non-obvious way.  */
       && ! TREE_THIS_VOLATILE (decl)



More information about the Gcc-bugs mailing list