public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/36814]  New: G++ won't warn about an uninitialized value
@ 2008-07-12 20:04 jellegeerts at gmail dot com
  2008-08-18 17:37 ` [Bug c++/36814] " manu at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jellegeerts at gmail dot com @ 2008-07-12 20:04 UTC (permalink / raw)
  To: gcc-bugs

Hello,

I've compiled the code below using `g++ -Wuninitialized -O test.cc -o test':

<<<<<<<<<<<<<<<
bool cMyClass::Init()
{
    bool retval;

    if (some_function())
    {
        // If the `goto' is executed, 'return retval;' will use the
        // uninitialized value of 'retval'.
        goto error;
    }

    retval = true;
error:
    return retval;
}
>>>>>>>>>>>>>>>

The problem is explained in the code comments above.

I think that GCC is supposed to warn about this, is that correct?

Thanks, Jelle


-- 
           Summary: G++ won't warn about an uninitialized value
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jellegeerts at gmail dot com
 GCC build triplet: i386-undermydesk-freebsd
  GCC host triplet: i386-undermydesk-freebsd
GCC target triplet: i386-undermydesk-freebsd


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-18 18:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-12 20:04 [Bug c++/36814] New: G++ won't warn about an uninitialized value jellegeerts at gmail dot com
2008-08-18 17:37 ` [Bug c++/36814] " manu at gcc dot gnu dot org
2008-08-18 18:15 ` jellegeerts at gmail dot com
2008-08-18 18:16 ` jellegeerts at gmail dot com
2008-08-18 18:17 ` jellegeerts at gmail dot com
2008-08-18 18:57 ` manu at gcc dot gnu dot 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).