> The native int size on your x86 compiler is probably 32 bits.  Each
> argument to the shift is promoted to int first; that's the bit about
> "integer promotions" and this gets you answer you're expecting.  I
> believe the native int size on avr-gcc is 16 bits, so your left operand:
> 
>   ((uint16_t)0xffffL)
> 
> stays at 16 bits on the AVR.

Ok, thanks for bearing with me... I had been under the impression that 
shift requires both operands to have the same width (there are web pages 
that appear to say this), but a close read of the spec says that the 
result of a shift is the type of the promoted left operand.

John Regehr


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to