Please explain what the statement: *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_FSUB?TEST
means in terms of not linking in a function that is not called. The memory map reports that code and data memory are being used in the build or that is the way I am interpreting it.
Below is a simple, do nothing, application indicating what I am referring to:
unsigned char fsub(unsigned long a,unsigned long b) { return b-a; }
unsigned long fadd(unsigned long a,unsigned long b) { return a+b; }
void main(void) { fadd (5,10); }
I see the compiler/linker reporting *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_FSUB?TEST
Program Size: data=25.0 xdata=0 code=76 LINK/LOCATE RUN COMPLETE. 1 WARNING(S), 0 ERROR(S)
I get a different report if I comment out the unused function. //unsigned char fsub(unsigned long a,unsigned long b) //{ // return b-a; //}
Rebuild target 'Target 1' compiling test.c... linking... Program Size: data=17.0 xdata=0 code=62 creating hex file from ".\Objects\junk"... ".\Objects\junk" - 0 Error(s), 0 Warning(s). Build Time Elapsed: 00:00:01
I am sure this is basic 'stuff' but I am a bit confused Thanks for your help Jim
OK... I understand now that if you use the LX51 linker and use the REMOVEUNUSED option I get the results I was expecting. I was misinterpreting the *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT message. It makes sense now.
This brings up my next question, I thought the Cx51/Lx51 tools were only intended for a specific microcontroller family. Is this correct or can they be used for the generic 51 family?
Yes.
Where did you see anything to suggest otherwise?
I saw this Keil link: http://www.keil.com/support/docs/2206.htm and *assumed* that the Cx51 was associated with the Lx51 tools and were only meant for the Philips 51MX devices.
Ah - I see!
Actually, Lx51 processes object files created by both C51 and CX51:
http://www.keil.com/c51/lx51.asp
Lx51 does add some extra features even for "standard" 8051s.
Thanks. I now understand.