null and type safety

cemiller chris at dprogramming.com
Tue Nov 4 15:35:48 PST 2008


On Tue, 04 Nov 2008 12:32:59 -0800, Walter Bright  
<newshound1 at digitalmars.com> wrote:

> Brendan Miller wrote:
>> This is obviously a problem. Everyone knows that null pointer
>> exceptions in Java/C#, or segmentation faults in C and C++ are one of
>> the biggest sources of runtime errors.
>
> Yes, but those are neither type safe errors or memory safe errors. A  
> null pointer is neither mistyped nor can it cause memory corruption.

null pointers DO cause memory corruption:

    byte* foo = null;   // NULL!
    foo[1244916] = 5;   // WORKS; CORRUPTS!



More information about the Digitalmars-d mailing list