Shouldn't invalid references like this fail at compile time?
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Wed Jan 24 23:18:53 UTC 2018
On Wednesday, January 24, 2018 21:24:16 Seb via Digitalmars-d wrote:
> On Wednesday, 24 January 2018 at 19:12:50 UTC, Steven
>
> Schveighoffer wrote:
> > While I understand your argument, the truth is that avoiding
> > null dereferencing *statically* has to be built into the
> > language from the beginning. As D is already too far along to
> > retrofit this, your 2 options are:
> >
> > a) instrument the code, as Jonathan suggests (every dereference
> > checks for null ahead of time).
> >
> > b) restrict your code, design, and functions that you use to
> > ensure null pointers cannot happen.
>
> There's also:
>
> c) Improve/split the language by introducing -dip25 / -dip1000
> and hope that people interested in memory safety will migrate
> their code to it.
Those really have nothing to do with null pointers though.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list