I'd like to share some issues I have faced when I started migrating my library from SDCC+NEWLIB to SDCC+Classic. I have found workarounds for all but the last one, but I thought it would be good to share them here and get feedback. Also, if some of them are wrong, please tell me so :-)
So here are my findings:
- SCCZ80 apparently supports only C89/C90, not C99. This means that designated initializers for const static unions or structs are not supported. The following compiles OK with SDCC but does not compile with SCCZ80:
Code: Select all
struct data { char a; int b; }; struct data instance = { .b = 16, .a = 'A' }; void main(void) { }
- This also means that you cannot statically initialize any fields in a union except the first one (as per C89). For the moment this forces me to use SDCC (which is no problem, since I prefer it).
- BeepFX routines (`bit_beepfx` and pals) are available in NEWLIB but not in Classic
- Current SP1 header file (sp1.h) for Classic does not compile with SDCC, but if it is replaced with the NEWLIB one it compiles OK (using Classic). It seems some `__FASTCALL__` decorators should be replaced with `__z88dk_fastcall` ones
- M_BEGIN_ISR and M_END_ISR macros in Classic's im2.h seem not compatible with SDCC, they use 'asm("...")' syntax. If it is replaced by '__asm__("...")' they work OK.
Thanks in advance, and as I said, any feedback is welcome.
J.