[OT] OT: Null checks.
Walter Bright
newshound2 at digitalmars.com
Sun May 4 04:36:53 UTC 2025
On 5/3/2025 8:55 PM, Timon Gehr wrote:
> I don't understand why you think demonstrating something with your own backend
> disproves a point about the world at large excluding your own backend. You did
> also run a test with GCC for the C version, but UB is simply not reliable.
It shows that dmd *does* do data flow analysis that can statically detect null
dereferences at compile time.
> You can go to d.godbolt.org, select "ldc latest CI", pass arguments "-O" and
> confirm for yourself that `_Dmain` is simply this:
> This is in accordance with the C standard.
ldc should disable that particular behavior, as it has negative utility. No
wonder you're having difficulties with it.
More information about the Digitalmars-d
mailing list