public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/53917] Wuninitialized warning points to place where variable doesn't occur
Date: Thu, 25 Mar 2021 22:40:23 +0000	[thread overview]
Message-ID: <bug-53917-4-2nJ7hdw5US@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53917-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53917

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |msebor at gcc dot gnu.org
             Status|NEW                         |RESOLVED

--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
The underlying problem with the test case in comment #1 is the same as the one
discussed in bug 40635 comment #13.  With the patch there applied, GCC issues a
note after the warning that points to the uninitialized variable:

pr53917-c1.c: In function ‘fn4’:
pr53917-c1.c:38:8: warning: ‘valid’ may be used uninitialized
[-Wmaybe-uninitialized]
   38 |     if (fn3 (&p_t1_rw_fsm_data.tag_mem_config))
      |        ^
pr53917-c1.c:25:9: note: ‘valid’ was declared here
   25 |     int valid;
      |         ^~~~~

There may be more that can be done to improve the context of the warning to
make it clearer but we can track those improvements separately.

*** This bug has been marked as a duplicate of bug 40635 ***

      parent reply	other threads:[~2021-03-25 22:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10 16:13 [Bug middle-end/53917] New: Warning message line about variable " Paulo.Matos at csr dot com
2012-07-10 16:37 ` [Bug middle-end/53917] " Paulo.Matos at csr dot com
2012-07-10 16:38 ` Paulo.Matos at csr dot com
2021-03-25 22:40 ` msebor at gcc dot gnu.org [this message]

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-53917-4-2nJ7hdw5US@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).