ref is unsafe

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Jan 2 15:34:20 PST 2013


On Wed, Jan 02, 2013 at 06:30:38PM -0500, Jonathan M Davis wrote:
> On Wednesday, January 02, 2013 15:06:24 H. S. Teoh wrote:
> > All extern(C) functions must be @system by default. It makes no sense to
> > allow a @safe extern(C) function, since there is no way for the compiler
> > to verify anything at all. The best you can do is @trusted.
> 
> Agreed. And @trusted is seriously questionable.
[...]

We may not have a choice on that, if some Phobos code needs to call C in
the backend but needs to expose a @safe interface. But yeah, if
possible, we should prohibit @trusted on extern(C) functions as well.


T

-- 
Two American lawyers went down to the beach for a swim. Seeing a canoe rental nearby, one asked the other, "Roe, or Wade?"


More information about the Digitalmars-d mailing list