From ce8fc97bdf64cb3abbe042de3d9030b0c22b74dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Schl=C3=BCter?= Date: Fri, 14 May 2004 14:44:40 +0200 Subject: [PATCH] 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 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/trans-decl.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) 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); } } -- 2.30.2