FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 03-09-2010, 12:20 PM
Falk Hueffner
 
Default Bug#532871: g++-4.4: No warning about value-altering conversion inspite of -Wconversion and -Wsign-conversion

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-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100309132004.GA14934@minet.uni-jena.de">http://lists.debian.org/20100309132004.GA14934@minet.uni-jena.de
 

Thread Tools




All times are GMT. The time now is 10:36 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org