On Thu, Apr 22, 2010 at 11:15:51PM +0200, [email protected] wrote:
>
> I get:
>
> gcc: -201
> ken-cc: 2147483447 (2^31 - 201)
>
> This is: signed long + signed long + unsigned char.
>
> Do you mean that there is first promotion :
>
> 1) unsigned char is promoted to unsigned int (A6.1).
>
> 2) And since there is an arithmetic operator (/ or shift),
> unsigned int value may exceeds signed long == signed int, the
> signed long is converted to unsigned long (A6.2)?
>
> Is it this?!!!!?
>
> And when I do first assignment, there is only promotion (since no
> operator is here). Yielding the correct value in x2, that is then
> divided (or shifted) by 2, hence signed, and no problem?
I say non-sense: even in the assignment, there is still arithmetic
conversions: the '+'...
I don't get it...
--
Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C