The following error occurs when I include minimp3.h
.
minimp3/minimp3.h:379: warning 116: left shifting more than size of object changed to zero
minimp3/minimp3.h:649: warning 116: left shifting more than size of object changed to zero
minimp3.h:876: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/SDCCopt.c' line number '312' : 0
Main.c:5: fatal error: when writing output to : Invalid argument
5|
|
minimp3.h
is from https://github.com/lieff/minimp3
sdcc version: 4.4.0
I don't see the compiler error (after changing 8052.H to 8052.h) using sdcc from current svn trunk on Debian GNU/Linux testing:
Can you try with SDCC from svn trunk or a current snapshot from https://sdcc.sourceforge.net/snap.php?
P.S.: regarding the warnings: those look like a bug in minimp3 to me: https://github.com/lieff/minimp3/issues/122
Last edit: Philipp Klaus Krause 2024-07-24
Yes, when I use http://sourceforge.net/projects/sdcc/files/snapshot_builds/x86_64-w64-mingw32/sdcc-snapshot-x86_64-w64-mingw32-20240723-14927.zip The same error occurred while compiling on Windows.
How can I make the compiler ignore the size of RAM? This code can be compiled normally on Keil (although the generated code is very long)
If you can compile and link this with Keil then you probably selected the correct memory model there. The same will have to be done for SDCC. The default small memory model will try to put all variables in data memory which is max 120 bytes and thus 18866 will never fit.
But even with --model-large you need 836 bytes for spilling of intermediate variables in those 120 bytes.
Going one step further using --stack-auto it still needs more than 256 bytes on stack. Even --xstack will not help you here.
This software is way too large for an mcs51-compatible when compiled with SDCC.
You will either have to rewrite it to make it fit using every trick in your book or just forget about it.