This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/7536: C++ front end does not warn of promotion of negative ints to unsigneds


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]