From: Tobias Schlüter Date: Fri, 14 May 2004 12:44:40 +0000 (+0200) Subject: re PR fortran/14568 (should not warn about unused variables in common blocks) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce8fc97bdf64cb3abbe042de3d9030b0c22b74dc;p=gcc.git re PR fortran/14568 (should not warn about unused variables in common blocks) PR fortran/14568 * trans-decl.c (generate_local_decl): Don't warn for unused variables which are in common blocks. From-SVN: r81837 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index d8185353d25..efd2a60659c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2004-04-22 Tobias Schlüter + + 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 * Make-lang.in, f95-lang.c, trans-array.c, trans-decl.c, diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index c1e80508457..13a40e04f27 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -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); } }