This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7536: C++ front end does not warn of promotion of negative ints to unsigneds
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, jss at ast dot cam dot ac dot uk, nobody at gcc dot gnu dot org
- Date: 22 Nov 2002 01:52:26 -0000
- Subject: Re: c++/7536: C++ front end does not warn of promotion of negative ints to unsigneds
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, jss at ast dot cam dot ac dot uk, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
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