Bug 22312 – importC: redundant typedefs are rejected

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-09-18T06:25:31Z
Last change time
2021-09-30T01:46:11Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
dave287091
See also
https://issues.dlang.org/show_bug.cgi?id=22263

Comments

Comment #0 by dave287091 — 2021-09-18T06:25:31Z
The following trivial C code fails to compile: // redundant.c typedef int Integer; typedef int Integer; redundant.c(3): Error: alias `redundant.Integer` conflicts with alias `redundant.Integer` at redundant.c(2) Section 6.7.3 of C11 allows redundant typedefs to the same type. This is problematic as at least on macOS there are types that are typedef’d more than once in standard headers. The following also ought to compile (but currently does not): // redundant2.c typedef int Integer; typedef Integer Int; typedef int Int;
Comment #1 by bugzilla — 2021-09-19T08:05:07Z
This is going to have to wait until https://github.com/dlang/dmd/pull/13085 gets pulled, as the fix will build on that.
Comment #2 by dlang-bot — 2021-09-27T08:57:14Z
@WalterBright created dlang/dmd pull request #13102 "fix Issue 22312 - importC: redundant typedefs are rejected" fixing this issue: - fix Issue 22312 - importC: redundant typedefs are rejected https://github.com/dlang/dmd/pull/13102
Comment #3 by dlang-bot — 2021-09-27T10:07:11Z
dlang/dmd pull request #13102 "fix Issue 22312 - importC: redundant typedefs are rejected" was merged into stable: - a28277c4ee41bb9fcf8125ea07ead97728722e5b by Walter Bright: fix Issue 22312 - importC: redundant typedefs are rejected https://github.com/dlang/dmd/pull/13102
Comment #4 by dlang-bot — 2021-09-30T01:46:11Z
dlang/dmd pull request #13108 "merge stable" was merged into master: - e63066f0e5bc5828a77fe4e3ea58269f56d9c4e9 by Walter Bright: fix Issue 22312 - importC: redundant typedefs are rejected (#13102) https://github.com/dlang/dmd/pull/13108