struct s { int a; }; struct s x; int y = ((struct s*)&x)->a;
Compiling this with sdcc test.c -mz80 yields Caught signal 11: SIGSEGV. Tested with commit 11672.
sdcc test.c -mz80
Caught signal 11: SIGSEGV
Wiki: NGI0-Entrust-SDCC
Wiki: z80
I can reproduce the issue on my Debian GNU/Linux testing system. On z80, hc08, s08, r2k, z180 (oddly not on gbz80).
Is it valid construction for C? As I know, you cannot assing value of one global variable to another one, am I wrong?
It is not valid C. But SDCC should give a proper error message ("Initializer element is not a constant expression") rather than crash.
P.S.: I noticed that for
int i; int j = i;
SDCC does crash, too. But at least it gives the proper error message first.
Still a SIGSEGV on 4.2.0, now also for sm83
Fixed in [r13852].
Commit: [r13852]
Log in to post a comment.
Related
Wiki: z80
I can reproduce the issue on my Debian GNU/Linux testing system. On z80, hc08, s08, r2k, z180 (oddly not on gbz80).
Is it valid construction for C? As I know, you cannot assing value of one global variable to another one, am I wrong?
It is not valid C. But SDCC should give a proper error message ("Initializer element is not a constant expression") rather than crash.
P.S.: I noticed that for
SDCC does crash, too. But at least it gives the proper error message first.
Still a SIGSEGV on 4.2.0, now also for sm83
Fixed in [r13852].
Related
Commit: [r13852]