Movement against float.init being nan

wjoe invalid at example.com
Tue Aug 30 12:42:51 UTC 2022


On Tuesday, 30 August 2022 at 12:17:36 UTC, Adam D Ruppe wrote:
> On Tuesday, 30 August 2022 at 12:07:52 UTC, wjoe wrote:
>> [...]
>
> Yes. -release should seriously *never* be used for a lot of 
> reasons, but read this part of the spec:
>
> https://dlang.org/spec/expression.html#assert_expressions
>
>> [...]
>
> Notice that it doesn't say "must evaluate to true if actually 
> evaluated", it just says must evaluate to true. If it would 
> have failed, even if not actually compiled in, the program has 
> *still* entered the Invalid State.
>
>> [...]
>
>> [...]
>
> This combines to mean an optimizer is free to assume the 
> asserts were all true as it moves forward which can get pretty 
> random if it was never actually tested.
>
>
> I'm not sure if this is what Timon had in mind but it is its 
> own thing to watch out for.

That would make for a nice note in the spec :) Thanks for 
pointing this out.


More information about the Digitalmars-d mailing list