I created a library fuction having two fuction inside 1) Loop1() 2) Loop2() when i will call the only one fucnction still the copiler will add the code for both, below i am writing the content of the library file
#pragma SAVE #pragma REGPARMS extern void Loop1(void); extern void Loop2(void); #pragma RESTORE
void Loop1() { unsigned int i=0; while(i) { i--; }
}
void Loop2() { unsigned char i=0; while(i) { i--; } how can i avoid this problem
void main() { Loop1(); Loop2(); while(1);
"Version 8 of the C51 tools includes a lovely new LX51 linker option, REMOVEUNUSED, to remove "dead" (uncalled) code. This helps mitigate this problem to a large extent."
Err... doesn't that defeat the entire object of a Library?