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.
I decided to start a new thread since this problem is different than the original one. When I compile the attached code, I get four L13: Recursive Call to Segment Warnings. One of the functions called out in the warnings is this one:
BYTE process_Help(char xdata *cmdBuf) { printf("\r\nP2_CMDHELP\r\n"); printf(cmdBuf); cmdBuf[0] = '\0'; printf( "\r\nHelp Message\r\n" return TRUE; }
// First two lines of corrected reg530.h #ifndef _REG530_H #define _REG530_H . . . #endif // Last line of corrected reg530.h
The Kiel compiler/linker is not stacked based w.r.t. to local variables. The linker makes a call tree for the functions and statically allocate variables, overlapping them whenever possible. So it is imperative that the linker can create this tree error free, else you can get incorrectly overlapped variables. (That error is great fun to debug.) Things work fine until you get to fn ptrs. In your case the fn ptrs values were declare in the "constants" space of one particular file. To get the program to link correctly, you have to remove this association to this "constants" space of the particluar file and remap it to the correct function. I find this a high maintenance way of doing things (and difficult to explain). I perfer to move the fn ptr declarations into the proper function (even if I have to make a helper function). At that point it is a no brainer, which is something I can handle.