SDCC sometimes crashes during compiling when the forward declaration for a function has the __banked keyword and the defined function body does not.
While the user should not declare them mismatched, it would be ideal for a warning to be emitted instead of a crash. Some variations of the example code do not produce the crash, this seems to be close to the minimum required.
Version (happens for windows build too, based on info from the reporting user)
sdcc -v
SDCC : z80/sm83/mos6502 4.2.2 #13350 (Linux)
published under GNU General Public License (GPL)
extern unsigned char some_var;
void some_function(unsigned char passedarg) __banked;
void some_function(unsigned char passedarg)
{
switch (passedarg)
{
case 0: some_var = 1;
break;
}
}
sdcc -msm83 --no-std-crt0 --fsigned-char --use-stdout -D__PORT_sm83 -D__TARGET_gb -DINT_16_BITS -c sdcc_crash.c -o sdcc_crash.o
Caught signal 11: SIGSEGV
Thanks!
Another user encountered this crash due to mismatched function header versus body declaration with the
__bankedkeyword. In this scenario it was a stale header file that hadn't been updated.Since the compiler was crashing it was not immediately clear to them what the error was.
In [r13829], I made it an error for __banked to mismatch. I hope I didn't break someones use-case (I'm not really familiar with the __banked stuff).
Related
Commit: [r13829]
I think this has broken my use-case. Nothing tragic, I can probably fix that -- but I was wondering if there's some command line option to ignore this mismatch check instead?
Thank you!