Bug 23217 – ImportC: extra initializer(s) error for array of structs

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-06-29T07:35:59Z
Last change time
2022-06-30T07:41:42Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
Walter Bright
See also
https://issues.dlang.org/show_bug.cgi?id=22610

Comments

Comment #0 by bugzilla — 2022-06-29T07:35:59Z
The following: typedef struct { int a,b,c; } code; const code array[2] = { {96,7,0}, {0,8,80} }; const code distfix[2] = { {22,5,193}, {64,5,0} }; fails for distfix with: test.c(8): Error: 2 extra initializer(s) for `struct __tag3` test.c(8): Error: 2 extra initializer(s) for `struct __tag3` It's related to the typedef and the const somehow.
Comment #1 by dlang-bot — 2022-06-30T01:23:45Z
@WalterBright created dlang/dmd pull request #14258 "fix Issue 23217 - ImportC: extra initializer(s) error for array of st…" fixing this issue: - fix Issue 23217 - ImportC: extra initializer(s) error for array of structs https://github.com/dlang/dmd/pull/14258
Comment #2 by dlang-bot — 2022-06-30T07:41:42Z
dlang/dmd pull request #14258 "fix Issue 23217 - ImportC: extra initializer(s) error for array of st…" was merged into master: - a0e1e5c4162c11da46b4119e3d45a40314f6a6db by Walter Bright: fix Issue 23217 - ImportC: extra initializer(s) error for array of structs https://github.com/dlang/dmd/pull/14258