[OT] OT: Null checks.
Timon Gehr
timon.gehr at gmx.ch
Tue May 6 03:38:01 UTC 2025
On 5/6/25 05:31, Timon Gehr wrote:
>
> I just wish everyone would refrain from actively putting invalid
> instructions and segfaults into druntime in the future. They are not
> _that_ useful and there are vastly more useful alternatives. x)
And the same is true for segfault-on-null. I don't want this. If a
standard null check can be implemented taking advantage of CPU features,
fine. But semantics should be the same as if the compiler inserted a
branch that throws an error every time a nullable pointer is dereferenced.
Even better would be the type system just ensuring nullable pointers are
never dereferenced, the OP's experience report notwithstanding. But I
guess this part is a pipe dream for now.
More information about the Digitalmars-d
mailing list