[Issue 18632] enable use of fromStringz with char[n]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 19 22:07:23 UTC 2018


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

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m

--- Comment #1 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
(In reply to elpenguino+D from comment #0)
> This would possibly also have the benefit of being @safe and pure.

Without -dip1000, treating the result as @safe would be a huge mistake, because
slicing a static array like this is inherently unsafe. The fact that the
compiler does not treat slicing static arrays as @system without -dip1000 and
scope is a bug (and it's in bugzilla somewhere, but I don't feel like searching
for it at the moment). And on that note, the function would have to accept the
static array by ref, or it would have a huge @safety bug.

--


More information about the Digitalmars-d-bugs mailing list