checkedint call removal

Artur Skawina via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 2 06:20:54 PDT 2014


On 08/02/14 14:54, Tobias Pankrath via Digitalmars-d wrote:
> I agree that this might hide bugs, but I don't agree that the additional trouble is bigger than the additional payoffs.

The bug was _introduced_ by the assert, the code was 100% correct.

Imagine working on a project with dozen+ developers that use asserts
extensively ("it never hurts to have more assertions"). If one of them
makes a simple mistake or forgets to update an assert expression
somewhere, your own perfectly fine and safe code becomes buggy and
exploitable. If you're lucky the problem will be found in testing, but
that's far from certain.

We use high level languages to (aot) protect ourselves from our own
mistakes. Just because I can write:

   S* p = 0x12345678;

does not mean that the compiler has to accept it.

artur


More information about the Digitalmars-d mailing list