[Issue 22610] New: ImportC: 3 extra initializer(s) for `struct __tag21`
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Dec 19 16:13:29 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22610
Issue ID: 22610
Summary: ImportC: 3 extra initializer(s) for `struct __tag21`
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: lance at lancebachmeier.com
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/zykchnrxsfvgftfjhczu@forum.dlang.org
--
More information about the Digitalmars-d-bugs
mailing list