DIP 1006 - Preliminary Review Round 1
Paolo Invernizzi
paolo.invernizzi at gmail.com
Wed Mar 7 09:05:17 UTC 2018
On Wednesday, 7 March 2018 at 00:11:33 UTC, Timon Gehr wrote:
> On 06.03.2018 19:49, Paolo Invernizzi wrote:
>>
>> I simply don't understand why enforce or a custom check can't
>> be used @safe code, if you want that behaviour.
>> ...
>
> I have explained why. UB is non-modular and you don't (want to)
> control all the code that you use.
As I've written, you should ask for debug versions of every
closed source library that it's used in a project, it's always a
win-only things to do.
> Also, enforce cannot be disabled.
Because if you use it instead of assert, the enforce has just
detected a bug, so it's just doing the sane thing to join that
cases: stop the execution because the process is entering UB.
> And no, keeping the check or introducing UB are not the only
> sensible options.
Just to understand, as I've already asked: do we aim at UB that
guarantees no memory corruptions?
/Paolo
More information about the Digitalmars-d
mailing list