This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
no warning when assigning an unsigned int to signed double
- From: Zhang Le <ejoy at xinhuanet dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 2 Jun 2003 15:47:31 +0800
- Subject: no warning when assigning an unsigned int to signed double
- Organization: NEU
Hello,
I'm not sure if this is a bug:
============
size_t i = 3;
double d;
d = -i;
cout << d << endl;
============
compile is ok without any warning with -Wall flag.
and I get:4.29497e+09
But what I want is -3
Clearly here gcc should generate a warning message when assigning an
unsigned int to signed double. Or people may not get what they want.
I'm using gcc3.2 on BSD.
--
Sincerely yours,
Zhang Le