http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43899

--- Comment #10 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2010-11-03 
17:47:51 UTC ---
This patchlet gets rid of the bogus warning.  All that remains is to check that
namelists are used or not.  Also note that we do not now check to see if
commons are used either.


Index: trans-decl.c
===================================================================
--- trans-decl.c    (revision 166182)
+++ trans-decl.c    (working copy)
@@ -4015,9 +4015,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);

Reply via email to