[Issue 11176] array.ptr in @safe code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 5 18:37:24 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11176



--- Comment #6 from David Nadlinger <code at klickverbot.at> 2013-10-05 18:37:22 PDT ---
(In reply to comment #5)
> And with so many C
> functions taking pointers of one variety of another (combined with the fact
> that we don't have the actual source code for C functions normally), I'd be
> tempted to argue that marking C functions with @trusted should simply not be
> done under normal circumstances.

I invite you to take up this argument with the people who are working hard to
make Phobos usable in @safe code. ;)

Jokes aside, C functions that are @safe should be marked as such, otherwise
this will just lead to client code being marked as @trusted. And this not only
shifts the problem, but as the expected fan-in of a druntime declaration is
larger than one, makes the problem *worse* because now that difficult decision
has to be made in several places instead of just one.

I agree that marking functions as trusted (external or not) comes with a high
potential for mistakes, but I'd argue that the best way to avoid making them is
to help with reviewing the related pull requests (and the existing code once
new pitfalls such as the reentrancy issue are discovered).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list