Page 1 of 1

Odd compile bug SDCC

Posted: Mon Apr 04, 2022 6:45 pm
by jacotton
make liboled.o
zcc +rc2014 -subtype=cpm -create-app --am9511 -c liboled.c
liboled.c:278: syntax error: token -> '' ; column 0
make: *** [Makefile:31: liboled.o] Error 1

liboled.c
font.h
Can be found at https://github.com/jayacotton/am9511

This also shows up compiling other files.

Re: Odd compile bug SDCC

Posted: Mon Apr 04, 2022 9:00 pm
by Timmy
Pure speculation, but could you try to end the file with an empty line and then try again? I don't use SDCC myself, but I know that with the other compiler I have to end every file with an empty line. Perhaps this "bug" also applies to SDCC too.

Re: Odd compile bug SDCC

Posted: Mon Apr 04, 2022 10:38 pm
by jacotton
did try that, no joy.

Re: Odd compile bug SDCC

Posted: Tue Apr 05, 2022 12:42 pm
by dom
Try this:

Code: Select all

diff --git a/liboled.c b/liboled.c
index 5c2e4a0..06a4b99 100644
--- a/liboled.c
+++ b/liboled.c
@@ -19,7 +19,7 @@ extern void oled_clean ();
 #endif

 #ifdef __SDCC
-#define ENDASM __asmend
+#define ENDASM __endasm;
 #else
 #define ENDASM #endasm
 #endif

Re: Odd compile bug SDCC

Posted: Tue Apr 05, 2022 4:16 pm
by jacotton
That does not seem to work here. Tried various combinations of spelling and ';', no help.

#ifdef __SDCC
#define ASM __asm
#define ENDASM __endasm
#else
#define ASM #asm
#define ENDASM #endasm
#endif

zcc +rc2014 -subtype=cpm -create-app --am9511 mathtest.c font.c snaplib.c liboled.c -omathtest
mathtest.c:32: syntax error: token -> '__endasm' ; column 8
make: *** [Makefile:25: mathtest] Error 1

#ifdef __SDCC
#define ASM __asm
#define ENDASM __endasm;
#else
#define ASM #asm
#define ENDASM #endasm
#endif

zcc +rc2014 -subtype=cpm -create-app --am9511 mathtest.c font.c snaplib.c liboled.c -omathtest
mathtest.c:32: syntax error: token -> '__endasm' ; column 8
make: *** [Makefile:25: mathtest] Error 1

#ifdef __SDCC
#define ASM __asm
#define ENDASM __asmend;
#else
#define ASM #asm
#define ENDASM #endasm
#endif

zcc +rc2014 -subtype=cpm -create-app --am9511 mathtest.c font.c snaplib.c liboled.c -omathtest
liboled.c:275: syntax error: token -> '' ; column 0
make: *** [Makefile:25: mathtest] Error 1

Re: Odd compile bug SDCC

Posted: Tue Apr 05, 2022 4:20 pm
by jacotton
ops, caught an error.
That did fix the parsing bug.
I never would have found that one.

tnx

Re: Odd compile bug SDCC

Posted: Tue Apr 05, 2022 7:54 pm
by jacotton
Updated my repo to the lastest code....

Main is clearly defined in the mathtest.c file.

zcc +rc2014 -subtype=cpm -create-app -lmath32 mathtest.c font.c snaplib.c liboled.c -omathtest
C:/cygwin64/home/lbmgm/projects/z88dk/lib/config/\..\..\\libsrc\_DEVELOPMENT\target\rc2014\rc2014_crt.asm.m4:1993: error: undefined symbol: _main
^---- _main
make: *** [Makefile:25: mathtest] Error 1

Re: Odd compile bug SDCC

Posted: Tue Apr 05, 2022 8:28 pm
by jacotton
I now have it building with zcc +cpm

This creates a runnable binary program.

tnx :)