[Bug c/32324] unsigned long long operator << and integer literals
andrew dot stubbs at st dot com
gcc-bugzilla@gcc.gnu.org
Wed Jun 13 18:00:00 GMT 2007
------- Comment #2 from andrew dot stubbs at st dot com 2007-06-13 18:00 -------
As it happens, I encountered your real problem quite recently. :)
"(int)(1<<31)" is undefined (C99 standard 6.5.7/4).
This modified version gives the same result both ways:
int main (){
unsigned long long a = 18446744065119617024llu;
/* results expected to be identical */
#ifdef EXPECTED
unsigned int b = ((unsigned int)(1<<31));
a = a / b;
#else
a = a / ((unsigned int)(1<<31));
#endif
return a;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32324
More information about the Gcc-bugs
mailing list