public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/71011] Wrong decl in a "may be uninitialized" warning
[not found] <bug-71011-4@http.gcc.gnu.org/bugzilla/>
@ 2021-03-31 20:52 ` msebor at gcc dot gnu.org
0 siblings, 0 replies; only message in thread
From: msebor at gcc dot gnu.org @ 2021-03-31 20:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71011
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
CC| |msebor at gcc dot gnu.org
--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 11 adds a note pointing to the declaration of the uninitialized variable
and prints something like:
allocate.C: In member function ‘void allocate_c::run_a_cycle()’:
allocate.C:44117:19: warning: ‘data’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
44117 | else if (uop->m_uop_type == UOP_IADD ||
| ~~~~~^~~~~~~~~~
allocate.C:38515:9: note: ‘data’ was declared here
38515 | T data;
| ^~~~
It might be possible to improve the output further (and I expect to) but given
that this is likely a true positive and with so many more serious
-Wuninitialized bugs I think it's good enough to resolve this report.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-31 20:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-71011-4@http.gcc.gnu.org/bugzilla/>
2021-03-31 20:52 ` [Bug middle-end/71011] Wrong decl in a "may be uninitialized" warning msebor at gcc dot gnu.org
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).