This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

adding reentrant to typedef function pointers causes redefinition in code

I am porting some code to an 8051.

(header.h)

typedef int     (Writer) (int ,
                                   u_char * ,
                                   u_char ,
                                   size_t ,
                                   u_char * ,
                                   int *) reentrant;
(source.h)
Writer bob;

(source.c)
.
.
.
int     bob(int val1,
            u_char * dat1,
            u_char dat2,
            size_t val2,
            u_char * dat3,
            int *pval) reentrant
{
}

When I attempt to compiler this, I get
error C231: '_bob' : redefinition. If I go to source.h and do the following:
(source.h)
//Comment out Writer bob;
int     (bob)(int val1,
            u_char * dat1,
            u_char dat2,
            size_t val2,
            u_char * dat3,
            int *pval) reentrant;


It compiles fine. Is this a limitation of the compiler? Any shortcuts I could use so I don't have to rewrite large chunks of code

Parents Reply Children