Discussion Thread: DIP 1028--Make @safe the Default--Final Review
aliak
something at something.com
Fri Mar 27 12:32:41 UTC 2020
On Wednesday, 25 March 2020 at 07:02:32 UTC, Mike Parker wrote:
> This is the discussion thread for the Final Review of DIP 1028,
> "Make @safe the Default":
>
> https://github.com/dlang/DIPs/blob/5afe088809bed47e45e14c9a90d7e78910ac4054/DIPs/DIP1028.md
>
> The review period will end at 11:59 PM ET on April 8, or when I
> make a post declaring it complete. Discussion in this thread
> may continue beyond that point.
>
> Here in the discussion thread, you are free to discuss anything
> and everything related to the DIP. Express your support or
> opposition, debate alternatives, argue the merits, etc.
>
> However, if you have any specific feedback on how to improve
> the proposal itself, then please post it in the feedback
> thread. The feedback thread will be the source for the review
> summary I write at the end of this review round. I will post a
> link to that thread immediately following this post. Just be
> sure to read and understand the Reviewer Guidelines before
> posting there:
>
> https://github.com/dlang/DIPs/blob/master/docs/guidelines-reviewers.md
>
> And my blog post on the difference between the Discussion and
> Feedback threads:
>
> https://dlang.org/blog/2020/01/26/dip-reviews-discussion-vs-feedback/
>
> Please stay on topic here. I will delete posts that are
> completely off-topic.
I feel like this has gotten lost in the discussion, a comment
from ag0aep6g:
Today, this rightfully fails compilation:
----
extern (C) void* memcpy(void* dst, const void* src, size_t n);
int main() @safe
{
auto x = new int;
auto y = new int(13);
immutable r = new int(0);
memcpy(x, y, 100);
return *r;
}
----
With DIP 1028 in its current state, it passes.
I also do not think allowing that to compile is acceptable. But
it was unclear form the DIP if that's allowed or not because it
specifically says D functions.
So my understanding is if extern (C) is applied on a function
declaration, then an annotation is explicitly required? Is this
correct?
More information about the Digitalmars-d
mailing list