On Tuesday, 25 November 2014 at 11:43:01 UTC, Don wrote:
Why are defining behaviour that is always a bug? Java makes it defined, but it has to because it doesn't have unsigned types. I think the intention probably was to improve on the C situation, where there is undefined behaviour that really should be defined.

Mostly to prevent optimizations based on no-overflow assumption.

But do we really want to preclude ever having overflow checking for integers?

Overflow checking doesn't contradict to overflow being defined. The latter simply reflects how hardware works, nothing else. And hardware works that way, because that's a fast implementation of arithmetic for general case.

Reply via email to