diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 72a0678b5e78..47b7e24df84c 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 9b11dd86a919..ecabfc4d5507 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); } }