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

Question on Function Pointer

Hallo,

the function Test is calling the functions func1 and func2 via a function pointer. Looking the *.map file, the addresses of func1 and func2 are located on even address, but the function pointer always has the correct address + 1.

In my example:
pf1:00101929 pf2:0010192d
In *.map
00101928H CODE --- func1?T
0010192CH CODE --- func2?T

Can anybody explain me this difference?

Thanks
Eugen

void func1(void)
{ }

void func2(void)
{ }


void Test(void)
{
char Buf[100];
void  (*pf1)(void);
void  (*pf2)(void);

	pf1 = func1;
	pf2 = func2;

	sprintf(Buf, "pf1:%08p    pf2:%08p", pf1, pf2);
        //Result:pf1:00101929     pf2:0010192d

        pf1();
	pf2();
}

0