[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:28:11 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=6175


SomeDude <lovelydear at mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear at mailmetrash.com


--- Comment #4 from SomeDude <lovelydear at mailmetrash.com> 2012-04-19 07:29:05 PDT ---
Isn't it the normal behaviour ?
If statCArr is declared const or immutable, it works as intended.

import std.conv, std.stdio;

void main()
{
    immutable char[9] statCArr = "BlaBlaBla";
    writeln("poupoupidouwah");
    auto res1 = to!(char[])(statCArr);
    writeln(res1);
    writeln(statCArr[]);
}


PS E:\DigitalMars\dmd2\samples> rdmd bug.d
poupoupidouwah
BlaBlaBla
BlaBlaBla
PS E:\DigitalMars\dmd2\samples>

-- 
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