Should (p - q) be disallowed in @safe code?

Timon Gehr timon.gehr at gmx.ch
Sat Jan 3 18:22:41 UTC 2026


On 1/3/26 03:29, Walter Bright wrote:
> The bottom line here is why are we arguing about this?

You brought up some tangential points that I think are based on flawed 
reasoning.

> Haven't we agreed that p-q should be disallowed in @safe code?

With the semantics you clarified it is intended to have, it must indeed 
be `@system`.

> And yes, I oppose optimizers that detect UB and just delete it.

The optimizers don't crave or need your approval, all they need is your 
specification that it is UB. You are thereby inviting them to do this.

Your UB is their dead code. And it helps them delete real dead code that 
they otherwise would not be able to detect. They will not stop doing 
this unless the language stops giving them UB to exploit.

If you don't mean UB, don't say UB.

There are some claims in your last post with which I disagree, but as I 
said, I will not sacrifice sleep in order to argue against everything.


More information about the Digitalmars-d mailing list