[Issue 23718] New: runnable/initializer.c:583:10: error: cast specifies array type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 15 17:43:14 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=23718
Issue ID: 23718
Summary: runnable/initializer.c:583:10: error: cast specifies
array type
Product: D
Version: D2
Hardware: All
OS: Linux
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: ibuclaw at gdcproject.org
When compiling the test with `gcc -std=c11 -fsyntax-only`
runnable/initializer.c: In function ‘test38a’:
runnable/initializer.c:583:10: error: cast specifies array type
583 | i = ((int[3])a)[2];
| ^
Original test:
```
void test38a()
{
int i;
static int a[3] = { 1,2,3 };
// Casting to an array type is not allowed by C11, but
// CompoundLiterals are not there yet to test this
// grammar
i = ((int[3])a)[2];
assert(i == 3, __LINE__);
}
```
--
More information about the Digitalmars-d-bugs
mailing list