mwoehlke <[EMAIL PROTECTED]> writes: #error "Right shift of integers of type char does not work!!" #error "Casts from char to short works by zero-extend!!" #error "Casts from char to int works by zero-extend!!" #error "Casts from char to long works by zero-extend!!" #error "Casts from char to long long works by zero-extend!!" #error "Casts from char to unsigned short works by zero-extend!!" #error "Casts from char to unsigned int works by zero-extend!!" #error "Casts from char to unsigned long works by zero-extend!!"
I think these are due to a portability problem in the test program, not a bug in your compiler. The test program uses code like this: #ifdef __CHAR_UNSIGNED__ typedef signed char schar; #else typedef char schar; #endif but this assumes an GCC-like __CHAR_UNSIGNED__ macro. If you recompile with -D__CHAR_UNSIGNED__ those messages should go way. > I'm attaching the non-optimized output. The optimized ('cc -O') output > is identical, plus these two errors: > > #error "Left shift of integers of type long long does not work!!" This error is more troublesome. Can you debug the program to find out exactly which values caused the problem? You can insert printf statements to see exactly which shift messed up. Possibly it is a compiler bug, which means you should not use -O. But possibly it is due to a portability problem in the test program. > #error "Right shift of integers of type long long does not work!!" I'd like this to be analyzed similarly. Here, the test program assumes that right shifts of a signed number propagate the sign, which is not a portable assumption; possibly this is what's happening here, which would mean it's not a compiler bug. But still, it'd be good to know exactly what is going on here.