Odd compile bug SDCC

Post Reply
jacotton
Member
Posts: 89
Joined: Fri Nov 24, 2017 1:35 am

Odd compile bug SDCC

Post 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.
Timmy
Well known member
Posts: 392
Joined: Sat Mar 10, 2012 4:18 pm

Re: Odd compile bug SDCC

Post 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.
jacotton
Member
Posts: 89
Joined: Fri Nov 24, 2017 1:35 am

Re: Odd compile bug SDCC

Post by jacotton »

did try that, no joy.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: Odd compile bug SDCC

Post 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
jacotton
Member
Posts: 89
Joined: Fri Nov 24, 2017 1:35 am

Re: Odd compile bug SDCC

Post 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
jacotton
Member
Posts: 89
Joined: Fri Nov 24, 2017 1:35 am

Re: Odd compile bug SDCC

Post by jacotton »

ops, caught an error.
That did fix the parsing bug.
I never would have found that one.

tnx
jacotton
Member
Posts: 89
Joined: Fri Nov 24, 2017 1:35 am

Re: Odd compile bug SDCC

Post 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
jacotton
Member
Posts: 89
Joined: Fri Nov 24, 2017 1:35 am

Re: Odd compile bug SDCC

Post by jacotton »

I now have it building with zcc +cpm

This creates a runnable binary program.

tnx :)
Post Reply