Bug 21971 – importC: Error: function conflicts with struct

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-25T16:37:43Z
Last change time
2021-06-27T10:04:44Z
Keywords
ImportC, rejects-valid
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2021-05-25T16:37:43Z
D doesn't allow this, but C has two different namespaces for function/variable/typedef symbol names and tags for struct/union/enum. This blocks quite a number of the standard library functions from being compilable. --- struct sigaction { int sa_flags; }; extern int sigaction(struct sigaction *);
Comment #1 by ibuclaw — 2021-05-25T16:39:40Z
An attempt to fix this issue was done in: https://github.com/dlang/dmd/pull/12567 However this was reverted as was found to cause more issues.
Comment #2 by bugzilla — 2021-06-27T10:04:44Z
This has been fixed. The C code works, but D can only see the function name. Not planning on fixing this for now.