Disallow null references in safe code?

Jonathan M Davis jmdavisProg at gmx.com
Sat Feb 1 23:54:02 PST 2014


On Saturday, February 01, 2014 19:44:44 Andrei Alexandrescu wrote:
> On 2/1/14, 7:35 PM, deadalnix wrote:
> > http://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html
> 
> Whoa, thanks. So the compiler figures null pointer dereference in C is
> undefined behavior, which means the entire program could do whatever if
> that does happen.

I think that article clearly illustrates that some of Walter's decisions in D 
with regards to fully defining some stuff that C didn't define were indeed 
correct. Undefined behavior is your enemy, and clearly, it gets even worse 
when the optimizer gets involved. *shudder*

- Jonathan M Davis


More information about the Digitalmars-d mailing list