What's the D equivalence?

Paul Backus snarwin at gmail.com
Fri Mar 5 15:22:51 UTC 2021


On Friday, 5 March 2021 at 15:17:29 UTC, Imperatorn wrote:
> On Friday, 5 March 2021 at 13:09:26 UTC, Jacob Carlborg wrote:
>> On Friday, 5 March 2021 at 10:13:32 UTC, Imperatorn wrote:
>>> As the title says, some of the things I know right away D 
>>> already has. But is there something checkedc has that we 
>>> don't?
>>>
>>> https://github.com/Microsoft/checkedc/wiki/Extension-overview
>>
>> One thing that is missing in D is runtime error on 
>> dereferencing a null pointer. D relies on the platform to 
>> trigger a segmentation fault. Of course, there are some 
>> platforms that don't do that.
>>
>> --
>> /Jacob Carlborg
>
> Ok, that's fine though imo.

It's actually a bit problematic because @safe relies on the fact 
that dereferencing a null pointer has defined behavior (i.e., it 
crashes the program). On platforms that don't guarantee this, D 
currently allows undefined behavior in @safe code.


More information about the Digitalmars-d mailing list