Re: Bugs in operations of "long" type from GCC-3.4.6 32 bit.

2007-03-27 Thread J.C. Pizarro
2007/3/28, Andreas Schwab <[EMAIL PROTECTED]>: "J.C. Pizarro" <[EMAIL PROTECTED]> writes: > The range of long should be -(2^63) .. +((2^63)-1). Your long has only 32 bits. > For shifts, the range of a long type should be 0 .. 64 (65 values), not 0 .. 31. Your long has only 32 bits. >> %ld

Re: Bugs in operations of "long" type from GCC-3.4.6 32 bit.

2007-03-27 Thread J.C. Pizarro
27 Mar 2007 16:35:16 -0700, Ian Lance Taylor <[EMAIL PROTECTED]>: You are confusing long and long long. This is C, not Java. The suffix for a long long constant is LL, not L. Very thanks, LL and %lld are the solution. The GCC compiler has not bugs that i said. testing_long_GCC_march2007_3.t

Re: Bugs in operations of "long" type from GCC-3.4.6 32 bit.

2007-03-27 Thread Andreas Schwab
"J.C. Pizarro" <[EMAIL PROTECTED]> writes: > The range of long should be -(2^63) .. +((2^63)-1). Your long has only 32 bits. > For shifts, the range of a long type should be 0 .. 64 (65 values), not 0 .. > 31. Your long has only 32 bits. >> %ld is not the correct format for a value of type l

Re: Bugs in operations of "long" type from GCC-3.4.6 32 bit.

2007-03-27 Thread Ian Lance Taylor
"J.C. Pizarro" <[EMAIL PROTECTED]> writes: > > > 1. Error and Warning in assignment of a long constant (with L letter) > > > (it's not true that a = 1410065408, high(a) = 0x). > > > > The constant overflows the range of long, causing undefined behaviour. > > The range of long should be -(

Re: Bugs in operations of "long" type from GCC-3.4.6 32 bit.

2007-03-27 Thread J.C. Pizarro
2007/3/28, Andreas Schwab <[EMAIL PROTECTED]> wrote: "J.C. Pizarro" <[EMAIL PROTECTED]> writes: > Brief summary, there are 3 bugs: None of them are bugs in the compiler, only in your program. Sure? My program is a testsuite of why the long type doesn't work, no why my program doesn't work.

Re: Bugs in operations of "long" type from GCC-3.4.6 32 bit.

2007-03-27 Thread Andreas Schwab
"J.C. Pizarro" <[EMAIL PROTECTED]> writes: > Brief summary, there are 3 bugs: None of them are bugs in the compiler, only in your program. > 1. Error and Warning in assignment of a long constant (with L letter) > (it's not true that a = 1410065408, high(a) = 0x). The constant overflows

Bugs in operations of "long" type from GCC-3.4.6 32 bit.

2007-03-27 Thread J.C. Pizarro
Hi people, bug_mult_and_shift_long.c - #include // it's for public domain by J.C. Pizarro, hahahahaha int main() { long long int a,b,c; unsigned int hi_a,lo_a,hi_b,lo_b,hi_c,lo_c; a = 100L; // 10G b = 1L; // 100M c = a * b; hi_a = (((unsigned