Bug 22972 – importC: static variable cannot be read at compile time
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-02T20:57:30Z
Last change time
2022-04-05T06:54:00Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
duser
Comments
Comment #0 by duser — 2022-04-02T20:57:30Z
struct op {
char text[4];
};
struct op ops[] = {
{ "123" }
};
char *x[] = { ops[0].text };
Error: static variable `ops` cannot be read at compile time
Comment #1 by bugzilla — 2022-04-05T04:21:29Z
Simplified:
struct op {
char text[4];
};
struct op ops[] = {
{ "123" }
};
char *y = ops[0].text;
Comment #2 by dlang-bot — 2022-04-05T05:28:31Z
@WalterBright updated dlang/dmd pull request #13948 "fix Issue 22971 - importC: can't initialize unsigned char array with …" fixing this issue:
- fix Issue 22972 - importC: static variable cannot be read at compile time
https://github.com/dlang/dmd/pull/13948
Comment #3 by dlang-bot — 2022-04-05T05:33:54Z
@WalterBright created dlang/dmd pull request #13949 "fix Issue 22972 - importC: static variable cannot be read at compile …" fixing this issue:
- fix Issue 22972 - importC: static variable cannot be read at compile time
https://github.com/dlang/dmd/pull/13949
Comment #4 by dlang-bot — 2022-04-05T06:54:00Z
dlang/dmd pull request #13949 "fix Issue 22972 - importC: static variable cannot be read at compile …" was merged into master:
- 0072b8ad6251c57d78651baa0ca7ff6adda60f71 by Walter Bright:
fix Issue 22972 - importC: static variable cannot be read at compile time
https://github.com/dlang/dmd/pull/13949