Thread overview
[Issue 23389] ImportC: types from core.stdc.* are distinct types when imported from C
Oct 05, 2022
Adam D. Ruppe
Oct 05, 2022
Adam D. Ruppe
Oct 09, 2022
Walter Bright
Dec 17, 2022
Iain Buclaw
October 05, 2022
https://issues.dlang.org/show_bug.cgi?id=23389

Adam D. Ruppe <destructionator@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator@gmail.com

--- Comment #1 from Adam D. Ruppe <destructionator@gmail.com> ---
This one I actually don't think is a bug. This is the D module system working as designed for declarations in D. Yes, they are extern(C) definitions, but it is still D code so the D rules ought to apply.

Though if you had two different .c files that both #included the same thing, then I *would* call it a bug, since C isn't supposed to work that way.

--
October 05, 2022
https://issues.dlang.org/show_bug.cgi?id=23389

--- Comment #2 from dave287091@gmail.com ---
If this is working as intended, then the error messages need to be fixed as they currently are impossible to understand.

--
October 05, 2022
https://issues.dlang.org/show_bug.cgi?id=23389

--- Comment #3 from Adam D. Ruppe <destructionator@gmail.com> ---
Yeah, in some cases the compiler will print the full name to explain it, it apparently needs to here too.

--
October 09, 2022
https://issues.dlang.org/show_bug.cgi?id=23389

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
What's happening is that s.c is declaring struct Sfile. core.stdc.stdio is also declaring a struct Sfile, but a *different* one. Declarations in D files are not merged with declarations from C files.

One possible solution is for core.stdc.stdio to declare Sfile using ImportC.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=23389

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 13
https://issues.dlang.org/show_bug.cgi?id=23389

--- Comment #5 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/20161

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--