expected array behaviour

John Reimer terminal.node at gmail.com
Fri Jan 2 09:38:06 PST 2009


Hello Anders,

> John Reimer wrote:
> 
>>> You'd get a runtime error if you were using Linux.  For some reason
>>> string literals are not read-only, or Windows doesn't respect it, or
>>> something like that.  Modifying either array1 or array2 is
>>> technically illegal.  So, uh, don't do it.
>>> 
>> Yes, that's one advantage to Linux.  String literals aren't read-only
>> on Win32.  This is unfortunate because it means that these sort of
>> bugs are significantly harder to diagnose on Windows than on Linux.
>> I remember that this was a bug in a early DUI version (now GtkD).
>> It's was pretty easy to spot on Linux because of the runtime error.
>> 
> The string literals are read-only on GDC for Win32 too, if that
> helps...
> 
> --anders
> 


That's interesting.  So it's actually a compiler issue, not a platform one.

-JJR




More information about the Digitalmars-d-learn mailing list