tags 532871 + moreinfo
thanks

On Fri, Jun 12, 2009 at 01:20:54PM +0200, Sven Marnach wrote:
> The following program compiles cleanly using the given command line:
> 
>     #include <iostream>
>     using namespace std;
>     int main()
>     {
>         unsigned int j = 5;
>         double t;
>         t = -j;
>         cout << t << endl;
>     }
> 
> Command line:
> 
>     g++-4.4 -g -Wall -Wextra -Wconversion -Wsign-conversion test.cc -o test
> 
> The output of the program is
> 
>     4.29497e+09
> 
> which is what is expected.  But I would also expect some kind of
> warning.

The result of "-j" is the unsigned value 4294967291, which can be
losslessly represented in a double. So why do you expect a warning?

  Falk



-- 
To UNSUBSCRIBE, email to debian-gcc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100309132004.ga14...@minet.uni-jena.de

Reply via email to