Oh! that one is nice. Thank you, this will solve my problem.

Sebastien

On Wed, Jul 29, 2009 at 8:37 AM, Maarten Brock <sourceforge.brock@dse.nl> wrote:
Hi,

Why don't you create a struct instead of an array and use the actual
function types?

Maarten

> 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 :-)


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
sdcc-devel mailing list
sdcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-devel