This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/52523] New: Missing "uninitialized" warning in simple code
- From: "andreac at unstable dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Mar 2012 20:21:12 +0000
- Subject: [Bug tree-optimization/52523] New: Missing "uninitialized" warning in simple code
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52523
Bug #: 52523
Summary: Missing "uninitialized" warning in simple code
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: andreac@unstable.it
Compiling this code:
#include <iostream>
int main()
{
int x;
std::cout << x;
std::cin >> x;
}
with g++ -Wall uninitialized.cc
give no warning.
But compiling this code:
#include <iostream>
int main()
{
int x;
std::cout << x;
}
with g++ -Wall uninitialized.cc
gives:
uninitialized.cc: In function âint main()â:
uninitialized.cc:6:17: warning: âxâ is used uninitialized in this function
[-Wuninitialized
Tested also on version 4.6.1 and 4.6.2