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!
I don't use printf or like this. I can see the adress of the pointer in the list file (.m66). So I read the contents of the address via an RS232 communication.
Thank you for the efforts!