[Issue 13572] etc.c.zlib must be nothrow

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jun 23 11:08:01 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=13572

--- Comment #14 from ag0aep6g at gmail.com ---
(In reply to Ketmar Dark from comment #13)
> assign to .ptr no. but you *can* call the @safe code from unsafe with
> invalid pointer, what i was trying to show.

I think that's agreed upon. In that case, all guarantees are out the window.

But @safe/@trusted functions must be memory-safe when called from other @safe
functions with non-garbage arguments.

For example, functions that take a pointer and a length separately can't be
@safe/@trusted, because an @safe caller can mess up the length.

So can't just mark arbitrary C functions @trusted without checking what they
do.

--


More information about the Digitalmars-d-bugs mailing list