This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/25649] [4.2 regression] Bogus "uninitialized" warning
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jan 2006 17:14:04 -0000
- Subject: [Bug libstdc++/25649] [4.2 regression] Bogus "uninitialized" warning
- References: <bug-25649-2736@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from pinskia at gcc dot gnu dot org 2006-01-24 17:14 -------
Here is an example of where we get a false postive:
#include <iostream>
using namespace std;
int main()
{
int x;
cin >> x;
if (!cin)
{
x = -1;
}
cout << x << endl;
}
We check the error status of cin after "cin >> x" has run and if that fails we
set x to -1 but the warning still shows up.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25649