Discussion Thread: DIP 1028--Make @safe the Default--Final Review

rikki cattermole rikki at cattermole.co.nz
Fri Apr 3 14:39:34 UTC 2020


On 04/04/2020 12:27 AM, John Colvin wrote:
> On Friday, 3 April 2020 at 10:15:35 UTC, Mathias LANG wrote:
>> On Friday, 3 April 2020 at 09:50:39 UTC, Walter Bright wrote:
>>> On 3/27/2020 5:32 AM, aliak wrote:
>>>> So my understanding is if extern (C) is applied on a function 
>>>> declaration, then an annotation is explicitly required?
>>>
>>> No. Without an explicit annotation, it will be the default (@safe).
>>
>> And absolutely no one else thing it's a good idea, because it's 
>> essentially slapping `@trusted` on all `extern(C)` functions.
> 
> I think I agree. I'd sooner have no default at all on functions without 
> implementation (i.e. you have to explicitly say @system).

Unless the compiler has checked the body for @safe, it cannot be assumed 
to be @safe. As that breaks its guarantees.

So I am on the side of, without body, default = @system.


More information about the Digitalmars-d mailing list