Movement against float.init being nan

Timon Gehr timon.gehr at gmx.ch
Wed Aug 31 02:05:21 UTC 2022


On 30.08.22 17:47, Walter Bright wrote:
> On 8/29/2022 5:27 PM, Timon Gehr wrote:
>> Clearly you should throw away your computer after a failed assert.
> 
> Absolutely. My basement is full of junked computers that dared to fail.
> 
> 
>> Which is why asserts can introduce new _undefined behavior_?
> 
> DMD has a switch to insert a halt instruction upon assertion failures.

Let's assume whoever is compiling my code does not want to spend 
computational resources on checking my asserts. (Or invariants, etc.)

My problem is that DMD seems to _lack_ switches to _safely_ disable 
checking (as far as I understand; it's notoriously underdocumented).

The fact that something that's called "turn off checking" will introduce 
UB is just really bad UX design. You are nothing short of ensuring that 
the hydraulic lines are hooked to the wrong ports.

Aside: My experience with people running into "Illegal instruction" is 
that they just assume the compiler has a bug and produced invalid 
machine code. Also, the semantics of "hlt" is not to terminate anything 
at all, it just waits for the next interrupt to be fired. The only 
reason it crashes in user space is that it requires ring 0 access.


More information about the Digitalmars-d mailing list