From: Sébastien L. <sq...@gm...> - 2009-07-28 23:50:49
|
Hi, I have a set of functions with different arguments and different return types, all declared reentrant. I want to build an entry point table so I declared: __code void* romcalls[] = { /* serial */ serial_init, serial_available, etc }; but the compiler complains on each array entry : error 47: indirections to different types assignment from type 'void function ( ) ' to type 'const-void code* ' error 47: indirections to different types assignment from type 'unsigned-char function ( ) ' to type 'const-void code* ' isn't it possible to cast a function pointer to __code void* ? this is not the same error reported a few days ago with the "pointer = &function() " bad syntax, what I write is (I think) legal C code on a "normal" (~gcc) compiler. How can I achieve this behaviour? I just want the functions addresses in an array or 2-bytes values! Sebastien PS: the final goal is to write a set of functions in ROM (0000-7FFF) along with a loader that loads an user supplied program at 8000-FFFF and then runs it, using ROM stored functions - I have this type of thing in my TI89 calculator (ok that's a 68k but that's not the point) and that's quite useful: no need to re-implement classic functions in user code, just use the ROM routines :-) |