[Issue 19916] union member access should be un- at safe
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jun 5 11:36:14 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19916
--- Comment #16 from Simen Kjaeraas <simen.kjaras at gmail.com> ---
There's code that simply cannot be @trusted under Dennis' @safe regime that
would be perfectly safe without void initialization and union member access.
For instance, there's C libraries that return opaque handles that may or may
not be actual pointers, and that offer no way to determine if such a handle is
valid or not, and may summon nasal demons if invalid handles are used.
Also, unions are really a low-level trick that is very rarely used. Disallowing
their use in @safe code will impact very little code.
--
More information about the Digitalmars-d-bugs
mailing list