From: Tobias Schlüter Date: Mon, 14 Jun 2004 16:04:41 +0000 (+0200) Subject: re PR fortran/15510 (Should not warn about unused variables from used modules) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce738b86f9cb4e73b7e7458c8e9a6c4865aa187b;p=gcc.git re PR fortran/15510 (Should not warn about unused variables from used modules) 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 From-SVN: r83113 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 72a0678b5e7..47b7e24df84 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,10 @@ -2004-06-05 Tobias Schlueter +2004-06-14 Tobias Schlueter + + 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 Andrew Vaught PR fortran/14928 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 9b11dd86a91..ecabfc4d550 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -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); } }