Skip to content

Odd handling of globals with redefinition as a different kind of symbol #5050

@ibuclaw

Description

@ibuclaw
module ice;
extern(C) int _D3ice3funFZi;
int fun() { return 0; }

int main()
{
    return fun();
}

More subtle, but the same applies to conflicts from pragma(mangle).

pragma(mangle, "ice") int fun() { return 0; }
pragma(mangle, "ice") int var;

int main()
{
    return fun();
}

Where again LDC renames one of the conflicting symbols to ice.1 (https://compiler-explorer.com/z/TfPrjoM3n)

If an importing module were to call fun(), how would it know to reference the .1 symbol?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions