[Bug libstdc++/25649] [4.2 regression] Bogus "uninitialized" warning
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Jan 24 17:14:00 GMT 2006
------- 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
More information about the Gcc-bugs
mailing list