[Issue 9195] Can do pointer arithmetic in safeD!
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Dec 30 04:20:35 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9195
--- Comment #2 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2012-12-30 04:20:34 PST ---
(In reply to comment #1)
> I don't see the problem here. The pointer arithmetic is in @trusted code. It's
> up to the programmer - not the compiler - to verify the safety of the code in
> that case. And all of the unsafe operations are in @trusted code. If you don't
> want this to happen, then don't mark a function as @trusted when it doesn't
> make sense to. This code is a problem simply because code which had no business
> being marked as @trusted was marked as @trusted. What would you expect to work
> differently about this?
It's not @trusted. casual is a doing a pointer atirhmetic just fine.
But see 'glorious' function in this example. It is does the same pointer
arithmetic but it's marked @safe and main is @safe! All compiles and runs, it's
a bug in @safety.
--
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