Bug 23374 – ImportC: only 1 designator currently allowed for C struct field initializer

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-09-26T03:20:35Z
Last change time
2024-12-13T19:24:47Z
Keywords
ImportC
Assigned to
No Owner
Creator
dave287091
Moved to GitHub: dmd#20157 →

Comments

Comment #0 by dave287091 — 2022-09-26T03:20:35Z
struct Foo { int x; int y; }; struct Bar { struct Foo f; }; struct Bar b = {.f.x = 3}; // Error: only 1 designator currently allowed for C struct field initializer struct Bar b2 = { .f.x = 3, // Error: only 1 designator currently allowed for C struct field initializer .f.y = 4, };
Comment #1 by trikkuz — 2023-10-23T07:20:33Z
Same problem with unions: union t_union { int a; long b; }; struct t_struct { union t_union u; }; struct t_struct err = { .u.a = 1 }; // Error: only 1 designator currently allowed for C struct field initializer
Comment #2 by robert.schadek — 2024-12-13T19:24:47Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20157 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB