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

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Mar 25 17:56:57 UTC 2020


On Wed, Mar 25, 2020 at 05:34:11PM +0000, bachmeier via Digitalmars-d wrote:
> On Wednesday, 25 March 2020 at 14:10:18 UTC, Steven Schveighoffer wrote:
> 
> > Everything else in the DIP is possibly annoying to deal with but at
> > least doesn't silently destroy the meaning of @safe.
> 
> To be perfectly honest, I can't imagine D being a sensible option for
> someone wanting to work heavily with C code if you have to add
> pointless annotations and constantly deal with compiler errors. It's
> not a matter of annoyance, it's simply impractical to add that kind of
> overhead, particularly if someone else is involved. If you're using C,
> you're well aware that it's not going to be safe.
[...]

If you're interfacing D code with C code, your main() is probably
already @system anyway, so you might as well just stick @system: at the
top of your extern(C) declarations and call it a day.


T

-- 
The two rules of success: 1. Don't tell everything you know. -- YHL


More information about the Digitalmars-d mailing list