[Issue 5167] New: argument to function expecting a C callback parameter isn't checked for linkage type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 5 04:56:31 PDT 2010


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

           Summary: argument to function expecting a C callback parameter
                    isn't checked for linkage type
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: mrmocool at gmx.de


--- Comment #0 from Trass3r <mrmocool at gmx.de> 2010-11-05 04:55:30 PDT ---
extern(C)
{
    alias /* extern(C)*/ void function() ft;
    void func(ft fp)
    {
        fp();
    }
}

void foo()
{
}

void main()
{
    func(&foo);
}

This compiles just fine even though foo has improper linkage.
I guess this could yield a corrupt stack when used with a C library.

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