c++/7536: C++ front end does not warn of promotion of negative ints to unsigneds
bangerth@dealii.org
bangerth@dealii.org
Thu Nov 21 18:02:00 GMT 2002
Synopsis: C++ front end does not warn of promotion of negative ints to unsigneds
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Nov 21 17:52:26 2002
State-Changed-Why:
True:
--------------------------
#include <iostream>
double dostuff(int i)
{
const unsigned cx = 10;
return i-cx;
}
int main()
{
std::cout << dostuff(-10) << std::endl;
}
--------------------------
outputs
tmp/g> ./a.out
4.29497e+09
Weird. I don't know what the standard says, though.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7536
More information about the Gcc-bugs
mailing list