Bug 831 – Warning!! String literals are read-only one some platforms.

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dlang.org
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-01-11T19:54:00Z
Last change time
2014-02-15T13:13:12Z
Assigned to
bugzilla
Creator
digitalmars-com

Comments

Comment #0 by digitalmars-com — 2007-01-11T19:54:57Z
The Strings section of the arrays page (http://www.digitalmars.com/d/arrays.html) needs a big, bold WARNING that string literals may be read-only on some platforms (for example Linux). A simple example would also be helpful. Maybe something like the following. char[] a = "abc"; a[1] = "-"; // Invalid. Will compile, but may crash. Since this is a portability and a reliabilty issue, it should have high priority. The compiler page (http://www.digitalmars.com/d/dcompiler.html) appears to be the only place this issue is noted.
Comment #1 by bugzilla — 2007-02-12T03:38:18Z
Fixed DMD 1.005