digitalmars.D.bugs - [Issue 24031] New: ImportC: DMD Rejects valid nested C initializers
- d-bugmail puremagic.com (47/48) Jul 05 2023 https://issues.dlang.org/show_bug.cgi?id=24031
https://issues.dlang.org/show_bug.cgi?id=24031 Issue ID: 24031 Summary: ImportC: DMD Rejects valid nested C initializers Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: ImportC Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: dkorpel live.nlFrom the discussion in https://github.com/dlang/dmd/pull/15375```C typedef struct { struct { char data[24]; }; int length; } ES; ES empty = {{.data = {0}}, .length = 0}; ``` ``` Error: `[ constant-expression ]` expected for C array element initializer `{.short_data={0}}` ``` ```C typedef struct { int k; struct { struct { struct { int s; } f; }; }; } SH; SH data = (SH) { .k = 0, {{.f = {.s = 0}}} }; ``` ``` Error: unrecognized C initializer `{.f={.s=0}}` ``` --
Jul 05 2023