Why dont dlang check NullPointer?

Idan Arye via Digitalmars-d digitalmars-d at puremagic.com
Sat Mar 28 16:22:10 PDT 2015


On Saturday, 28 March 2015 at 22:53:54 UTC, Timothee Cour wrote:
> If there's no easy way to do it, there should be a way (eg a 
> compiler
> option) to throw an exception on null pointer access. Even if 
> it's unsafe,
> it would help for debugging (eg printing relevant application 
> specific
> context). This is made worse by the fact that stacktraces are 
> not very
> helpful on OSX (eg line number often missing etc).

In that case, it should be an Error, not an Exception, since 
it'll be disabled in release mode.


More information about the Digitalmars-d mailing list