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

John Colvin <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from John Colvin <[email protected]> ---
This is nothing to do with `put`. As far as `put` is concerned it's been given
a mutable buffer.

A segfault is a good outcome when you try to write to a string literal.

Do you mean a compile-time error? If so:

I suggest opening an enhancement request for something like "Disallow obvious
cases of writing to string literals" or similar, but I doubt you'll get much
traction with it as it's only practically possible to do in trivial cases and
only occurs when someone has already broken the rules by casting away
immutable.

If you mean a runtime error:

That's what the segfault is for. There's no need to duplicate the work that the
CPU does (with all the performance implications that would have).


I'm gonna close this again, re-open if you're really motivated but I think a
new issue would be better, without the confusion of `put`.

--

Reply via email to