dmd icon indicating copy to clipboard operation
dmd copied to clipboard

ImportC: .di generator emits both forward declarations and definition

Open dlangBugzillaToGithub opened this issue 2 years ago • 1 comments

dave287091 reported this on 2024-02-09T19:34:15Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=24381

Description

C code:
struct foo;
struct foo {
    int x;
};

struct bar {
    int x;
};
struct bar;

emitted .di file:
extern(C)
{
        // ...
	struct foo;
	struct foo
	{
		int x = void;
	}
	struct bar
	{
		int x = void;
	}
	struct bar;
        // ...
}

Which leads to an error about conflicting structs.

dlangBugzillaToGithub avatar Feb 09 '24 19:02 dlangBugzillaToGithub

marked down!

Emmankoko avatar Dec 10 '25 13:12 Emmankoko