Assignment of long long to long: No Warning with -Wall

Meenaradchagan Vishnu mvishnu@bbcr.uwaterloo.ca
Mon Jan 22 09:35:00 GMT 2001


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


More information about the Gcc-bugs mailing list