public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "caolanm at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/40146]  New: Unexplained "'<anonymous>' is used uninitialized in this function" warning
Date: Thu, 14 May 2009 13:09:00 -0000	[thread overview]
Message-ID: <bug-40146-8961@http.gcc.gnu.org/bugzilla/> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

With some code (attached) using an anonymous namespace I get an unexplained
"‘<anonymous>’ is used uninitialized in this function" with -Wall, with no
indication of what is seen to be used uninitialized. Changing the namespace to
a named one removes the error, as does removing part of the body of a used
method. 

g++ (GCC) 4.4.0 20090506 (Red Hat 4.4.0-4)

-DTEST1 names the namespace
-DTEST2 comments out the body of the offending method
"wiggling" the code makes it disappear/reappear, but difficult to know what the
problem is so as to make the test-case a more reasonable size

$ g++ -O2 -c -Wall foo.cxx
foo.cxx: In function ‘bool demo()’:
foo.cxx:4033: warning: ‘<anonymous>’ is used uninitialized in this function
foo.cxx:4033: note: ‘<anonymous>’ was declared here
$ g++ -DTEST1 -O2 -c -Wall foo.cxx
$ g++ -DTEST2 -O2 -c -Wall foo.cxx

Looks similar to bug #38908 but that one compiles without warnings here


-- 
           Summary: Unexplained "'<anonymous>' is used uninitialized in this
                    function" warning
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: caolanm at redhat dot com


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


             reply	other threads:[~2009-05-14 13:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 13:09 caolanm at redhat dot com [this message]
2009-05-14 13:09 ` [Bug c++/40146] " caolanm at redhat dot com
2009-05-14 14:32 ` pinskia at gcc dot gnu dot org
2009-08-25 13:54 ` bangerth at gmail dot com
2009-08-27 11:17 ` caolanm at redhat dot com
2009-08-27 11:20 ` caolanm at redhat dot com
2009-08-27 11:35 ` bangerth at gmail dot com
2009-09-10 17:44 ` shawn dot starr at rogers dot com
2009-09-10 18:15 ` pinskia at gcc dot gnu dot org
2009-09-10 18:19 ` pinskia at gcc dot gnu dot org
2009-10-16 11:06 ` gcc at abeckmann dot de
2009-10-16 13:11 ` gcc at abeckmann dot de
2010-01-10 22:01 ` matt at use dot net
2010-01-10 23:30 ` matt at use dot net
2010-01-11 18:39 ` manu at gcc dot gnu dot org
2010-07-13 14:37 ` caolanm at redhat dot com
2010-07-13 15:24 ` manu 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-40146-8961@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).