ow Integers Should Work

bearophile bearophileHUGS at lycos.com
Mon Dec 5 19:23:55 PST 2011


Don:

> The "overflow12.pdf" paper on that site shows statistics that overflow 
> is very often intentional.

This is expected, the C/C++ programmers are using the semantics of their language. But it's just because they are using a language with a bad integer semantics.
A better designed language gives you a way to tell the compiler where you want overflow (or the default behaviour of the ALU you are using), where you want wraparound, and where you want some overflow errors. I have seen enough overflow-related bugs in supposed higher-quality C code written by experts.

Bye,
bearophile


More information about the Digitalmars-d mailing list