summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-09 00:08:20 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-09 00:08:20 +0000
commit72c9bfbc7fde36ea805b427d77417535f7da3ef2 (patch)
tree5c611eb5f633c5ebdc4ae5425eeb6d0baa842ec2 /gcc
parent8873d8a12d48fbd8d9b7a9e053227a88a0866e4a (diff)
downloadgcc-72c9bfbc7fde36ea805b427d77417535f7da3ef2.tar.gz
2010-11-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/43899 * trans-decl.c (generate_local_decl): Do not generate unused warning for variables in namelists. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166461 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-decl.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 86aad78e29c..22cf7d80816 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/43899
+ * trans-decl.c (generate_local_decl): Do not generate unused warning
+ for variables in namelists.
+
2010-11-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/46344
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 8e5c294b99f..a94556fb260 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -4017,9 +4017,10 @@ generate_local_decl (gfc_symbol * sym)
}
/* Warn for unused variables, but not if they're inside a common
- block or are use-associated. */
+ block, a namelist, or are use-associated. */
else if (warn_unused_variable
- && !(sym->attr.in_common || sym->attr.use_assoc || sym->mark))
+ && !(sym->attr.in_common || sym->attr.use_assoc || sym->mark
+ || sym->attr.in_namelist))
gfc_warning ("Unused variable '%s' declared at %L", sym->name,
&sym->declared_at);