-
-
Notifications
You must be signed in to change notification settings - Fork 420
Add explicit @system attribute to extern functions #3117
Conversation
Needed for compatibility with @safe-by-default.
Thanks for your pull request and interest in making D better, @pbackus! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + druntime#3117" |
The
The
Both of these appear to be unrelated to this PR. |
The second failure, on Mac OSX, is definitely unrelated, and gone. But the first one is not only consistently showing, it is also showing an extra Regarding the PR: going ahead with this would add a lot of cruft to support something that not a single contributor but the DIP author has voiced support for. Should Walter revise his position, this change would not be needed anymore, yet it touches enough places that a revert will be difficult, and add little value, so it probably wouldn't happen anyway. |
@Geod24 What makes me think it's unrelated is:
EDIT: I had stale files left over from a previous build; I cannot reproduce locally with a clean build, on any branch. In fact, you yourself acknowledged that the very same test is likely suspect in a comment on #3009, so I'm not sure why you've changed your mind here. Regarding the PR, I am perfectly happy to leave this un-merged as long as the status of DIP 1028 remains uncertain. My main motivation in submitting this was to address some of the test failures for dlang/dmd#11176. |
@Geod24 I've done some digging, and I'm pretty sure this is issue 3796, based on this comment in Here's a reduced version of module testInference;
import core.demangle: demangle;
void foo8504()() {}
auto toDelegate8504a(F)(auto ref F fp) { return fp; }
extern(C) void testC8504() {}
void test8504()
{
// commenting out the following line makes the test pass on 32-bit linux
static assert(demangle(foo8504!().mangleof) == "pure nothrow @nogc @safe void testInference.foo8504!().foo8504()");
auto fp1 = toDelegate8504a(&testC8504);
static assert(typeof(fp1).stringof == "extern (C) void function()");
} I think the correct thing to do here in the short term is to change the test to not use |
@pbackus : Thanks for tracking it down. To clarify my previous comment:
If we are to pull this, yes.
Since that issue is closed, can you either re-open it with your test-case, or open a new issue ? Thanks! |
@Geod24 Filed as issue 20878. |
Closing this now that DIP 1028 has been withdrawn. |
I'm not sure it's a bad thing to have this anyway. DIP1028 is gone, but applying |
Needed for compatibility with @safe-by-default.
These
@system
-by-default function declarations were found using the deprecation message introduced in dlang/dmd#11176.These changes only apply to declarations that produce deprecation messages on
version (Posix)
, since that's all I can test locally.