[Issue 24031] New: ImportC: DMD Rejects valid nested C initializers
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jul 5 19:21:12 UTC 2023
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 at puremagic.com
Reporter: dkorpel at live.nl
>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}}`
```
--
More information about the Digitalmars-d-bugs
mailing list