re PR fortran/14568 (should not warn about unused variables in common blocks)
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Fri, 14 May 2004 12:44:40 +0000 (14:44 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Fri, 14 May 2004 12:44:40 +0000 (14:44 +0200)
       PR fortran/14568
       * trans-decl.c (generate_local_decl): Don't warn for unused
       variables which are in common blocks.

From-SVN: r81837

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c

index d8185353d25d2b6e6eae8e1cc9dcab7864b4ba62..efd2a60659c8822c3a9200bda43a936b8b614b39 100644 (file)
@@ -1,3 +1,9 @@
+2004-04-22  Tobias Schlüter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/14568
+       * trans-decl.c (generate_local_decl): Don't warn for unused
+       variables which are in common blocks. 
+
 2004-05-13  Diego Novillo  <dnovillo@redhat.com>
 
        * Make-lang.in, f95-lang.c, trans-array.c, trans-decl.c,
index c1e80508457c41022318a8f7492b9cca5df1a844..13a40e04f27fcf21fa06e4ac152f4ecec32ac828 100644 (file)
@@ -1855,7 +1855,9 @@ generate_local_decl (gfc_symbol * sym)
           if (warn_unused_parameter)
             warning ("unused parameter `%s'", sym->name);
         }
-      else if (warn_unused_variable)
+      /* warn for unused variables, but not if they're inside a common
+     block.  */
+      else if (warn_unused_variable && !sym->attr.in_common)
         warning ("unused variable `%s'", sym->name);
     }
 }