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.
Hello all, i have DECT handset based on 8051 controller.. and i also have an application software running on it.
I am planning to run this software in debug mode in Keil IDE itself, so that i can run some keypad simulators interfaced through AGSI driver interface.
SO i commented a funtion call which internally declares some local variables. then the linker gives me this error.. if i uncomment the function call ... every thing works fine...
i am using SMALL memory model...
can anyone please suggest me the reason for it.
error is
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: _DATA_GROUP_ LENGTH: 000050H
thanks, supreet
Comment out the function too.
Comment out the function too. cumbersome to undo if your editor does not have "column edit" (mine do :) )
Erik
Long Thread for a short topic Let me summarize: Comment out the function too. Look in the manual for "Uncalled functions" Moving from small to large is not a fix It is not a bug it is how the compiler works
But that could still leave whatever other functions it calls as "uncalled"...
Maybe a better solution would be to set the 'Exclude from build' option for the appropriate file(s)...
so use a #if instead - that's what they're there for!
It's not called "conditional compilation" for nothing...
or what I suggested above (the uncalled function error killer)
I do find that one the simplest and the beauty of it is that if you forget to remove the function from the "uncalled function error killer", you are no worse off, it does not matter because they are not called from there. Thus you can go back and forth between calling it (at the actual place) and not calling it.
Why do I do this, well quite often I have a "develop when waiting for someone/something function that we will need next month" and there the minimal change between called and not called is very beneficial.
It is important to remember that "comment away" may be a common expression, but in C or C++ you normally only play with /* */ or // for a few lines of code, and always switch to conditional compilation for larger blocks.
Many editors can't mark multiple lines and automatically insert or remove // and even if the editor has such a function, someone else may use an editor without such a function, resulting in a very tedious job to remove all the // from the block.
/* */ is nice but most compilers do not support recursive comments, which can make it a bit dangerous.
I normally settle for
#ifdef SKIP_THIS ... #endif
to quickly "park" work-in-progress or test code that are nice to have, but not nice enough to be always included in debug builds.
The only time it did not work as expected, was when we got a consultant to help in a project, and the consultant decided to activate such a block by adding
#define SKIP_THIS
to a global header file, suddenly not just activating a function that the consultant should finish, but some other code blocks too, including a couple of destructive black-box tests.
Had we been a bit brighter, we should have switched to another consultant immediately...
To not tempt people to define symbols that are never intended to be defined, it may be best to write:
#if 0 ... #endif
Now, only a single character needs to be changed locally, to reactivate the block.