On 10.09.2014 12:10, Ben Shi wrote: > I tried the following c code with command "sdcc a.c -mstm8", > > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > void ww(void *p, void *q, void *t) { > memcpy(p, q, 10); > memset(t, 0, 10); > } > int main(void) { > char w[10]; > char ww1[10]; > char wq[10]; > for (;;) > ww(w, ww1, wq); > return 0; > } > > and got error like > a.c:19: warning 126: unreachable code > ?ASlink-Warning-Undefined Global '_memset' referenced by module 'a' > ?ASlink-Warning-Undefined Global '_memcpy' referenced by module 'a' > > But I did find _memset.rel & _memcpy.rel were archived into stm8.lib, > what's wrong ?
I think I filed a bug for this (can't find the report now though, maybe I forgot to file it): Sometimes the linker doesn't find stm8 standard library functions. A workaround is to manually specify the path to the standard library when linking, so the linker sees the standard library twice (once from sdcc, once from the command line). Then it always seems to find all functions. Philipp
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user