[Issue 6772] New: Cannot pass cfloat argument type to a function on x86_64

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 5 13:33:02 PDT 2011


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

           Summary: Cannot pass cfloat argument type to a function on
                    x86_64
           Product: D
           Version: D1 & D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: grahamc001uk at yahoo.co.uk


--- Comment #0 from Graham <grahamc001uk at yahoo.co.uk> 2011-10-05 13:32:18 PDT ---
In the example below the function gets a different value for argument n than
value passed cf.

Argument type and size is OK, but value is wrong.

Both D1 and D2 have this problem. Problem only present for 64 bit code.


import std.stdio;

void myfunc(cfloat n) {
    writefln("argument type is %s", typeof(n).stringof);
    writefln("n = 0x%X, sizeof = %d", *(cast(ulong*)&n), n.sizeof);
    writefln("real part %f, imag part %f", n.re, n.im);
}

void main() {
    cfloat    cf;

    cf = 1.02f+3.04fi;
    writefln("cf = 0x%X, sizeof = %d", *(cast(ulong*)&cf), cf.sizeof);
    myfunc(cf);

}

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