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

Vladimir Panteleev thecybershadow.lists at gmail.com
Fri Mar 27 02:31:13 UTC 2020


On Wednesday, 25 March 2020 at 14:10:18 UTC, Steven Schveighoffer 
wrote:
> I would argue that if the compiler is going to make things 
> @safe by default, then things that are not marked and are not 
> @safe should not compile AT ALL COSTS. Otherwise the value of 
> @safe is completely lost.

I don't think extern(C) should get special behavior.

- For code which can be machine-verified that it's @safe, the 
compiler should default to assuming they're @safe and ask the 
programmer to otherwise specify when it's not (@system or 
@trusted).

- For code which the compiler cannot verify whether it's safe, it 
should be assumed that it's @system.

This applies to extern(D) declarations, too. Effectively, this 
would mean that functions with a body won't need a @safe 
annotation, but functions without a body will require it. 
However, I think this is a more correct solution despite this 
issue.


More information about the Digitalmars-d mailing list