This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21310] New: warning: '<anonymous>' may be used uninitialized in this function
- From: "wanderer at rsu dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Apr 2005 22:15:46 -0000
- Subject: [Bug c++/21310] New: warning: '<anonymous>' may be used uninitialized in this function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Current mainline GCC generate strage warnings with -O -Wuninitialized options
if compile testcase:
--8X---------------------------------
#include<map>
struct W {
static int g(int v) { return std::min(v,0); }
};
struct R {
R();
R(int v);
int m;
};
int main() {
std::map<int,R> e;
e[0] = R(W::g(0));
}
--X8------------------------------
Output:
test.cc: In function 'int main()':
test.cc:4: warning: '<anonymous>' may be used uninitialized in this function
test.cc:15: warning: 'v' may be used uninitialized in this function
GCC 4.0.0 compile with same options without warnings.
Vladimir
--
Summary: warning: '<anonymous>' may be used uninitialized in this
function
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wanderer at rsu dot ru
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-unknown-freebsd5.3
GCC host triplet: i386-unknown-freebsd5.3
GCC target triplet: i386-unknown-freebsd5.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21310