Sumit Kumar

Metrowerks compiler issue

Discussion created by Sumit Kumar on Aug 17, 2011
Latest reply on Aug 18, 2011 by Sumit Kumar

Hello all,

 

I have 2 functions, both are identical except that one function is a template function. When I send the functions as function_pointer arguments to some other function, Metrowerks compiler complains for the template function.

 

template <typename T>
static void
call_stub (void *argument)
{

    ...........

    ..............
}

static void
call_stub_ (void *argument)
{

    ...........

    ..............

}

 

void register_callback ( (void (*)())(&call_stub<T>) )  ---- Gives error

void register_callback ( (void (*)())(&call_stub_) )      ---- Works fine.

 

Error Description:

Illegal explicit conversion from 'void' to 'void (*)()'.

 

Am I missing something here ? Is it a problem with the Metrowerks compiler ?

 

I am using PowerPC EABI Linker. Version: Code Warrior PowerPC ISA, Release 8.5 Build 50425.

Thanks !!

Outcomes