C code:
typedef struct
{
unsigned char c[4];
} stb_easy_font_color;
stb_easy_font_color c = { 255,255,255,255 }; // use structure copying to avoid needing depending on memcpy()
DMD returns:
Error: 3 extra initializer(s) for `struct __tag21`
This can be manually fixed with explicit nesting:
stb_easy_font_color c = { { 255,255,255,255 } };
Forum thread: https://forum.dlang.org/post/[email protected]
@WalterBright created dlang/dmd pull request #14437 "fix Issue 22610 - ImportC: 3 extra initializer(s) for struct __tag21" fixing this issue:
- fix Issue 22610 - ImportC: 3 extra initializer(s) for struct __tag21
https://github.com/dlang/dmd/pull/14437
Comment #3 by dlang-bot — 2022-09-15T09:53:27Z
dlang/dmd pull request #14437 "fix Issue 22610 - ImportC: 3 extra initializer(s) for struct __tag21" was merged into master:
- 15d3270a7064764d97caae504c1cbd1ea7f06622 by Walter Bright:
fix Issue 22610 - ImportC: 3 extra initializer(s) for struct __tag21
https://github.com/dlang/dmd/pull/14437