Struct with default ctor (Was: [dmd-beta] dmd 2.064 beta take 2)

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun May 19 13:08:06 PDT 2013


On 5/19/13 4:05 PM, Walter Bright wrote:
> On 5/19/2013 12:10 PM, deadalnix wrote:
>> On Sunday, 19 May 2013 at 18:46:31 UTC, Walter Bright wrote:
>>>> You also never provided any convincing solution to the safety hole.
>>>> We can't
>>>> even add check only on some edges cases as D also have values types.
>>>> The only
>>>> solution we are left with that is really safe is to null check every
>>>> dereference
>>>> or give up on @safe.
>>>
>>> Please don't make us guess what exactly you mean by this.
>>
>> This isn't new and I discussed that again and again.
>>
>> When you dereference null, you hit the first plage, which is protected
>> on most
>> systems. But if you access an element with sufficient offset you
>> bypass all
>> protections provided by the type system and you are back in unsafe world.
>
>
> And we've replied to this before. But when you say "give up on @safe",
> that implies a far more serious issue, so I want to make sure what
> you're talking about.
>
> I agree that we need to deal with the issue. But on a practical note, if
> we solve 99% of the @safe issues, and fail at 1%, that doesn't mean
> there is no value to @safe and we should give up on it.

Almost safe == almost pregnant. @safe must be 100% safe.

Andrei




More information about the Digitalmars-d mailing list