This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Assignment of long long to long: No Warning with -Wall
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Assignment of long long to long: No Warning with -Wall
- From: Meenaradchagan Vishnu <mvishnu at bbcr dot uwaterloo dot ca>
- Date: Mon, 22 Jan 2001 12:35:31 -0500
Hi,
Assignment of long long (64bits) into long (32bits) produces no
warnings even when using -Wall flag.
I am not sure whether this is a bug, but I certainly think a warning
when compiled with -Wall would be nice.
#include <iostream>
int main()
{
unsigned long long x = 0xffffffffffffffffLL;
unsigned long y = x;
cout << x << endl;
cout << y << endl;
}
> g++ -v
Reading specs from
/tools/sw/gnu/gcc/2.95.2/sun5/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/specs
gcc version 2.95.2 19991024 (release)
Also in
> g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.0)
Thank You,
Meenan Vishnu