I am porting some code to an 8051. (header.h)
typedef int (Writer) (int , u_char * , u_char , size_t , u_char * , int *) reentrant;
Writer bob;
. . . int bob(int val1, u_char * dat1, u_char dat2, size_t val2, u_char * dat3, int *pval) reentrant { }
//Comment out Writer bob; int (bob)(int val1, u_char * dat1, u_char dat2, size_t val2, u_char * dat3, int *pval) reentrant;
Thank you for the help. Extern did not improve anything unforunately. It appears that it is coded this way because the function is also passed within structures and other functions. In this way, we are not rewriting all of the details of the function pointer. This style is being used quite often in the code. I only seem to have a problem when I am forced to define the function as reentrant(too many arguments). For example:
(header.h) typedef int (Writer) (int); Writer bob;
(header.c) int bob(int a){ ... }
"I am only having the problem when the function is too large and I have to redefine it as reentrant." Why does the Size of the function affect the need for the reentrant attribute?