[Issue 21565] @safe code allows modification of a scalar that overlaps with a pointer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 21 17:19:16 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21565

--- Comment #9 from Paul Backus <snarwin+bugzilla at gmail.com> ---
> I'm disagreeing with the ability of safe code to access any part of this.

On what grounds? The point of @safe is to prevent undefined behavior, and
allowing access to the integer cannot possibly lead to undefined behavior,
because all integer values are safe values.

> the current rules are sound, just nonsensical. It makes such unions pointless when writing safe code.

I agree--which is why I would like to replace them with rules that are both
sound *and* sensical. Can we agree that that's a desirable goal?

--


More information about the Digitalmars-d-bugs mailing list