Skip to content

Non matching mangled name for C functions using structs #2782

@jacob-carlborg

Description

@jacob-carlborg

Example:

module main;

struct Foo
{
    int a;
}

extern (C) void bar(Foo);
module foo;

struct Foo
{
    int a;
}

extern (C) void bar(Foo);
$ ldc2 main.d foo.d
main.d(8): Error: Function type does not match previously declared function with the same mangled name: bar

C functions doesn't have a mangling. I suspect the mangled name that would be used for a D function for the Foo struct is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions