public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/43899] Wrong unused-variable warning with NAMELISTs
Date: Wed, 03 Nov 2010 17:48:00 -0000	[thread overview]
Message-ID: <bug-43899-4-v7ZaPDMiKH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-43899-4@http.gcc.gnu.org/bugzilla/>

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);


  parent reply	other threads:[~2010-11-03 17:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-43899-4@http.gcc.gnu.org/bugzilla/>
2010-11-03  4:29 ` jvdelisle at gcc dot gnu.org
2010-11-03 15:22 ` jvdelisle at gcc dot gnu.org
2010-11-03 15:28 ` jvdelisle at gcc dot gnu.org
2010-11-03 15:44 ` burnus at gcc dot gnu.org
2010-11-03 17:48 ` jvdelisle at gcc dot gnu.org [this message]
2010-11-09  0:08 ` jvdelisle at gcc dot gnu.org
2010-11-09  0:24 ` jvdelisle at gcc dot gnu.org
2010-11-09  0:25 ` jvdelisle at gcc dot gnu.org
2013-06-20 10:15 ` dominiq at lps dot ens.fr
2013-06-20 10:27 ` burnus at gcc dot gnu.org
2013-06-20 14:33 ` dominiq at lps dot ens.fr
2015-10-10 13:05 ` dominiq at lps dot ens.fr
2010-04-26 18:03 [Bug fortran/43899] New: " burnus at gcc dot gnu dot org
2010-04-26 19:05 ` [Bug fortran/43899] " jvdelisle at gcc dot gnu dot org
2010-04-26 20:16 ` burnus at gcc dot gnu dot org
2010-05-04  1:56 ` jvdelisle at gcc dot gnu dot org
2010-05-04  4:11 ` jvdelisle at gcc dot gnu dot org
2010-05-04  5:53 ` burnus at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-43899-4-v7ZaPDMiKH@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).