If you needed any more evidence that memory safety is the future...

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 25 04:23:03 PST 2017


On 25.02.2017 01:50, Chris Wright wrote:
> On Fri, 24 Feb 2017 21:16:28 +0100, Timon Gehr wrote:
>
>> On 24.02.2017 16:29, Chris Wright wrote:
>>> On Fri, 24 Feb 2017 09:14:24 +0200, ketmar wrote:
>>>> forget about "-release" dmd arg. forget about "-boundscheck=off". no,
>>>> really, they won't do you any good. after all, catching a bug in your
>>>> program when it doesn't run in controlled environment is even more
>>>> important than catching a bug in debugging session! don't hate your
>>>> users by giving 'em software with all safety measures removed! please.
>>> Especially since -release disables assertions and contracts.
>>
>> No.
>
> It does in fact disable assertions and contracts.
> ...

If 'disable' (as can be reasonably expected) means the compiler will 
behave as if they were never present, then it does not.

If it means AssertErrors will not be thrown, then this is indeed what 
DMD will do in practice, but it is not guaranteed by the spec.

>> Worse. It turns failures into UB.
>
> Which is what ketmar described.
>

Ketmar described the removal of safety measures. With -release, 
assertions pose an additional safety risk.


More information about the Digitalmars-d mailing list