Bug 22929 – importC: extern array with unknown length gives bounds errors

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-03-25T12:12:52Z
Last change time
2022-03-29T08:10:13Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
duser
See also
https://issues.dlang.org/show_bug.cgi?id=22935

Comments

Comment #0 by duser — 2022-03-25T12:12:52Z
two cases: // 1 extern int xs[]; void fn() { void *xp = &(xs[0]); } // 2 struct S { char text[4]; }; extern struct S ops[]; char *args[] = { ops[0].text }; Error: array index 0 is out of bounds `[0..0]`
Comment #1 by dlang-bot — 2022-03-28T08:39:25Z
@WalterBright created dlang/dmd pull request #13902 "fix Issue 22929 - importC: extern array with unknown length gives bou…" fixing this issue: - fix Issue 22929 - importC: extern array with unknown length gives bounds errors https://github.com/dlang/dmd/pull/13902
Comment #2 by dlang-bot — 2022-03-29T08:10:13Z
dlang/dmd pull request #13902 "fix Issue 22929 - importC: extern array with unknown length gives bou…" was merged into master: - 9cc80f73952cc486c0689032ae62cb92b93ca249 by Walter Bright: fix Issue 22929 - importC: extern array with unknown length gives bounds errors https://github.com/dlang/dmd/pull/13902