re PR fortran/15510 (Should not warn about unused variables from used modules)
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Mon, 14 Jun 2004 16:04:41 +0000 (18:04 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Mon, 14 Jun 2004 16:04:41 +0000 (18:04 +0200)
PR fortran/15510
* trans-deecl.c (generate_local_decl): Do not issue warning for
unused variables if they're use associated.

Co-Authored-By: Andrew Vaught <andyv@firstinter.net>
From-SVN: r83113

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

index 72a0678b5e78fea4b27376f29f19b6e79bbc1047..47b7e24df84c531b6af9d5f37f84071ef94ea7b5 100644 (file)
@@ -1,4 +1,10 @@
-2004-06-05  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+2004-06-14  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/15510
+       * trans-deecl.c (generate_local_decl): Do not issue warning for
+       unused variables if they're use associated.
+
+2004-06-14  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
         Andrew Vaught <andyv@firstinter.net>
 
        PR fortran/14928
index 9b11dd86a919fef71cb86ce0906c9adbd5a20cba..ecabfc4d5507ac0cc2674fb2dda16b85e1d2a873 100644 (file)
@@ -1921,9 +1921,10 @@ generate_local_decl (gfc_symbol * sym)
             warning ("unused parameter `%s'", sym->name);
         }
       /* 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);
+        block or are use_associated.  */
+      else if (warn_unused_variable
+              && !(sym->attr.in_common || sym->attr.use_assoc))
+       warning ("unused variable `%s'", sym->name); 
     }
 }