[Issue 6175] String corruption when passing static char arrays to std.conv
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Apr 19 07:43:56 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6175
Steven Schveighoffer <schveiguy at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schveiguy at yahoo.com
--- Comment #5 from Steven Schveighoffer <schveiguy at yahoo.com> 2012-04-19 07:44:51 PDT ---
(In reply to comment #4)
> import std.conv, std.stdio;
>
> void main()
> {
> immutable char[9] statCArr = "BlaBlaBla";
> writeln("poupoupidouwah");
> auto res1 = to!(char[])(statCArr);
> writeln(res1);
> writeln(statCArr[]);
> }
This is converting const, so to is likely doing a dup/idup. If you change res1
to immutable(char)[], it fails in the same way.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list