#516 function pointers

closed-fixed
Erik Petrich
5
2013-05-25
2003-05-18
Anonymous
No

Reported by Steve Maddison:

#if defined (SDCC_mcs51)
# define REENTRANT reentrant
#else
# define REENTRANT
#endif

struct my_struct {
int (*fn_ptr)(int) REENTRANT;
};

int my_function( int parm ) REENTRANT
{
return parm;
}

void main( void )
{
struct my_struct test;

test.fn_ptr = my_function;
(*test.fn_ptr) (99);
test.fn_ptr (100);
}

Last line with mcs51:
f.c:22: warning: Functions called via pointers must be 'reentrant'
to take arguments

with -mz80:
f.c:22: error: too many parameters

Discussion

  • Erik Petrich
    Erik Petrich
    2004-02-08

    Logged In: YES
    user_id=635249

    Fixed by my recent function pointer related commits. See
    ChangeLog 1.618 through 1.623

     
  • Erik Petrich
    Erik Petrich
    2004-02-08

    • milestone: --> fixed
    • assigned_to: nobody --> epetrich
    • status: open --> closed-fixed