[Issue 4552] New: Struct initialization results in struct member garbage values

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 1 10:23:54 PDT 2010


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

           Summary: Struct initialization results in struct member garbage
                    values
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2010-08-01 10:23:51 PDT ---
This is a modified example from the structs page in the d spec:

import std.stdio;

struct S { 
    int a;
    int b;
    int c;
    int d = 7;
}

void test(int i)
{
    S q = {2, i};
    writeln(q);
}

void main() { 
    test(4); 
}


This writes S(2, 4, 33686018, 33686018). 
These look like garbage values to me.

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