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

Problems with init of a function pointer

Hello

I've a problem when initializing a global function pointer. Depending on where the function pointer is created, the adress of the funciton pointer is 0 (=wrong). There are no warnings in the compiler!
Compiler: c166 v4.23
Tool: uVision2 v2.31

Example:

typedef UINT16 (*pModul_Para)(UINT16, UINT16 *, void *, UINT16);

//prototype of the function
UINT16 Controller_Para(UINT16 ParamNr, UINT16 *pElementNr, void *pValue, UINT16 Action);

//create and init the function pointer
pModul_Para FunctionPtr123 = &Controller_Para;

//Function definition
UINT16 Controller_Para(UINT16 ParamNr, UINT16 *pElementNr, void *pValue, UINT16 Action)
{ ...
}

//create and init a second function pointer
pModul_Para FunctionPtr55 = &Controller_Para;

--> Result: FunctionPtr123 would be 0, FunctionPtr55 can be the address of Controller_Para.

Any idea? Thanks!

Parents Reply Children
No data