Bug 24031 – ImportC: rejects nested C initializers

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-07-05T19:21:12Z
Last change time
2023-11-24T08:41:19Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
Dennis
See also
https://issues.dlang.org/show_bug.cgi?id=24026

Comments

Comment #0 by dkorpel — 2023-07-05T19:21:12Z
From 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}}` ```
Comment #1 by dlang-bot — 2023-11-23T06:11:02Z
@WalterBright updated dlang/dmd pull request #15855 "fix Issue 24042 - ImportC: Error: no definition for static function" fixing this issue: - fix Issue 24031 - ImportC: rejects nested C initializers https://github.com/dlang/dmd/pull/15855
Comment #2 by dlang-bot — 2023-11-23T06:18:37Z
@WalterBright created dlang/dmd pull request #15856 "fix Issue 24031 - ImportC: rejects nested C initializers" fixing this issue: - fix Issue 24031 - ImportC: rejects nested C initializers https://github.com/dlang/dmd/pull/15856
Comment #3 by dlang-bot — 2023-11-23T08:30:53Z
@WalterBright created dlang/dmd pull request #15858 "fix Issue 24031 - ImportC: rejects nested C initializers" fixing this issue: - fix Issue 24031 - ImportC: rejects nested C initializers https://github.com/dlang/dmd/pull/15858
Comment #4 by dlang-bot — 2023-11-24T08:41:19Z
dlang/dmd pull request #15858 "fix Issue 24031 - ImportC: rejects nested C initializers" was merged into master: - ca2968c98ed4b808dd6514af9d102a979cf33a6b by Walter Bright: fix Issue 24031 - ImportC: rejects nested C initializers https://github.com/dlang/dmd/pull/15858