We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Dear All,
I created a serial.lib file with four functions, and added to new project . in main i called only 2 function which is present in lib file. so its giving me an warning "*** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS" this is because of other 2 function which is not called in main.
how to clear this warning...
Thanks & regards Kiran Kumar D
all functions in a single file and seperate objects one file generates one object.
The linker can not include 1/4 of an object file and thus if one function in an object in a library is needed all functions in that object get linked in.
Instead of making your library from one file with 4 functions make it from 4 files with one function each .
Erik
uvision do not have a smart linker :( and best as every function in seporate file
uvision do not have a smart linker :(
One of the linkers (I do not rely on tools, I write stuff that works - and, thus, do not recall which one) can remove unused functions.
It's smart enough - but you have to structure your project appropriately.
Motto for today: Know your tools!
http://www.keil.com/support/man/docs/lx51/lx51_removeunused.htm
Most are not. They just include the unused code quietly. Since Keil for the 8052 overlays, it can not just ignore unused functions. It can not know if they are call via a pointer.
then how standard lib like stdio,conio are created with all functions in a single lib.
if i make each function with different files, then there will be huge number of files.
how can i manage like default library.
"then how standard lib like stdio,conio are created with all functions in a single lib."
One source file for each function - as stated.
"if i make each function with different files, then there will be huge number of files."
Only if you have a "huge" number of functions in your library!
You said that you have 4 functions - so 4 source files is hardly a "huge" number, is it?!
There is still only one library file.
"how can i manage like default library."
Surprisingly enough, by using the Library Manager:
http://www.keil.com/support/man/docs/lib51/ http://www.keil.com/support/man/docs/libx51/