On Tue, 26 Mar 2013 14:30:21 -0400, Johannes Pfau <[email protected]>
wrote:
Am Tue, 26 Mar 2013 14:04:25 -0400
schrieb "Steven Schveighoffer" <[email protected]>:
The official stance is, it's not an error. If we treated it as an
error, then it would be very costly to implement, every operation
would have to check for overflow. The CPU does not assist in this.
I think this is way more annoying though if the overflow happens in
constant folding such as in the original example. In that case checking
"only" adds overhead at compile time, so a warning would be nice.
Yes, I agree there. The OP's code should either error out, or
auto-promote to long.
But not in the general case.
-Steve