Signed integer overflow undefined behavior or not?

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 13 01:19:06 PST 2015


On Friday, 13 November 2015 at 09:09:33 UTC, Don wrote:
> Suppose we made it an error. We'd be in a much better position 
> than C. We could easily add a check for integer overflow into 
> CTFE. We could allow compilers and static analysis tools to 
> implement runtime checks for integer overflow, as well.
> Are we certain that we want to disallow this?

In C allowed undefined behavior resulted in questionable 
aggressive optimizations forced on everyone. That's what's 
disallowed.


More information about the Digitalmars-d mailing list