[Issue 8838] Slicing static arrays should be considered unsafe (@system)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 17 16:36:00 PDT 2012


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



--- Comment #2 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-10-17 16:35:57 PDT ---
> This is a big change in D, so before going this route I suggest to think well
about this topic.

The thing is that it _isn't_ memory safe. There's no question of that. So, per
the definition of @safe, it has no business being @safe. It needs to be
@system. If it's not, then SafeD is broken. I don't see how anyone could argue
otherwise.

Yes, it's breaking change in the cases where people actually use @safe, but
there's no way around that, and honestly, I suspect that most people don't mark
their code @safe anyway, and it's only applicable to where static arrays are
sliced, so I don't know how much code will really be broken. For folks who use
static arrays and @safe heavily, it'll break a lot. For most other people,
probably nothing.

Regardless, I don't see how we can _not_ make this change given what @safe is
supposed to do.

-- 
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