SDCC : z80/sm83/mos6502/mos65c02 TD- 4.3.2 #14228 (Linux)
Filing a bug report for a gbdk user. The type assignment in the following minimized example code is incorrect, but instead of a warning or error SDCC, consistently crashes on Linux (have not checked on Windows)
Caught signal 11: SIGSEGV
sdcc -msm83 -c test.c -o test.o
const unsigned char TestMap_map[1];
typedef struct {
unsigned char x;
const unsigned char maps[];
} test_struct;
test_struct test = {
.x=0,
.maps=TestMap_map
};
There is a minor variation on the example which errors out in a different way:
test.c:8: error 9: FATAL Compiler Internal Error in file 'SDCCast.c' line number '1637' : sym->isstrlit
Contact Author with source code
sdcc -msm83 -c test.c -o test.o
const unsigned char TestMap_map[];
typedef struct {
unsigned char x;
const unsigned char maps[];
} test_struct;
test_struct test = {
.x=0,
.maps=TestMap_map
};
Edit, forgot that I'd simplified the array index on the struct item out of it, which is where the title for the ticket came from.
Last edit: bbbbbr 2023-09-11