This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49693] Spurious "unused-variable" warnings for COMMON block module variables.
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 01 Jan 2012 16:37:27 +0000
- Subject: [Bug fortran/49693] Spurious "unused-variable" warnings for COMMON block module variables.
- Auto-submitted: auto-generated
- References: <bug-49693-4@http.gcc.gnu.org/bugzilla/>
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)