P
Phil Carmody
Say I wrote:
// includes elided
int code_to_talk_to_chip_specific_copro(int funcid, ...)
{
va_list va;
uint32_t addr;
int ret;
va_start(va, funcid);
addr = *(uint32_t*)&va;
switch(funcid)
{
case do_X:
ret = get_copro_to_do_job_X(addr);
break;
// others
}
va_end(va);
}
Would you pat me on the back for cleverly getting the address of
nameless parameters, or would you get out your cane and say
"wroooong, do it again!".
Phil
// includes elided
int code_to_talk_to_chip_specific_copro(int funcid, ...)
{
va_list va;
uint32_t addr;
int ret;
va_start(va, funcid);
addr = *(uint32_t*)&va;
switch(funcid)
{
case do_X:
ret = get_copro_to_do_job_X(addr);
break;
// others
}
va_end(va);
}
Would you pat me on the back for cleverly getting the address of
nameless parameters, or would you get out your cane and say
"wroooong, do it again!".
Phil