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.
Hey guys, why would I get the following errors if i comment out a piece of code? the code is in my main loop.
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: ?DT?PROCESS_TEL?PROCESS LENGTH: 0009H *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: ?DT?_ASC_TO_BCD?MISC LENGTH: 0008H
Thanx :)
Xarion
yeah i did get those errors
Each uncalled function starts a new call tree, unless you instruct the linker to strip uncalled functions.
Looking around in the Target options, where can i find to strip uncalled functions?
thanx!
Don't forget to look through the linker manual, since that would probably be the best place to learn what the linker does, and what options it takes.
when i have (temporarily during development) uncalled functions, I use this 'trick'
skipbit = 0; if (skipbit) ( uncalled_function(); }
Erik
Note that there are two linkers available for use with C51; viz, BL51 and LX51. See: http://www.keil.com/c51/selector.asp
I think it's only LX51 that has the facility to remove uncalled functions...?
The alternative, of course, is to not have functions that you don't use!
Not sure what the advantage of that would be over, say:
#if 0 uncalled_function(); #endif
Or even
#if DO_NOT_CALL uncalled_function(); #endif
Simply uncheck the 'Include in build' option for the relevant file(s).
Can also be applied to Groups.
If, like Erik, you don't use uVision, you could still build a similar effect into your preferred build system (.BAT file, or whatever)...
Oops - now I see it!!
My examples should be:
#if 0 // Definition of the function void uncalled_function( void ) { // Your code here } #endif : : #if 0 uncalled_function(); #endif
and the advantage is then obvious.
Taking it a step further:
#if DO_NOT_CALL_THIS_FUNCTION // Definition of the function void this_function( void ) { // Your code here } #endif : : #if DO_NOT_CALL_THIS_FUNCTION this_function(); #endif
or
/* ...
*/