2012/1/22 Jonathan M Davis <[email protected]>:
> Another potentially nasty situation is subtraction. It
> can do fun things when you subtract one unsigned type from another if you're
> not careful...

It is unrelated to unsigned types in any way, isn't it?:

int a = 2_000_000_000;
assert( a + a == 4_000_000_000 ); // fail
assert( a + a == -294_967_296 );   // OK

Overflow bug is often related to casting negative value to unsigned
types, yes, but without these types we still may have unexpected
behaviour due to this bug, so this is barely a proper solution.

Reply via email to