D - Unsafe and doomed

deadalnix deadalnix at gmail.com
Mon Jan 6 16:13:03 PST 2014


On Monday, 6 January 2014 at 21:09:44 UTC, Walter Bright wrote:
> On 1/6/2014 1:03 PM, Walter Bright wrote:
>> On 1/6/2014 11:21 AM, deadalnix wrote:
>>> Or, we can decide that trapping in not guaranteed, and then 
>>> dereferencing null
>>> is undefined behavior,
>>> which is much worse that a compile time failure.
>>
>> Realistically, this is a non-problem.
>
> Or better, if you want to issue a pull request for the 
> documentation that says unless it is a dead load, a null 
> reference will cause a program-ending fault of one sort or 
> another, I'll back it.

You realize that every

foo.bar();

is undefined behavior unless it is preceded by a null check under 
that definition ?


More information about the Digitalmars-d mailing list