[Issue 22929] New: importC: extern array with unknown length gives bounds errors
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Mar 25 12:12:52 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22929
Issue ID: 22929
Summary: importC: extern array with unknown length gives bounds
errors
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: ImportC, rejects-valid
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: duser at neet.fi
CC: duser at neet.fi
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]`
--
More information about the Digitalmars-d-bugs
mailing list