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.

Reply via email to