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:10:52 PST 2017


On 25.02.2017 04:12, Chris M wrote:
> On Friday, 24 February 2017 at 20:16:28 UTC, 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. Worse. It turns failures into UB.
>
> How so?

With -release, the optimizer is allowed to assume that assertions pass.
There is no switch to disable assertions.

https://dlang.org/dmd-linux.html#switch-release

"compile release version, which means not emitting run-time checks for 
contracts and asserts. Array bounds checking is not done for system and 
trusted functions, and assertion failures are undefined behaviour."


More information about the Digitalmars-d mailing list