#470 function pointer inside a structure

closed
Johan Knol
5
2013-05-25
2003-03-04
Bernhard Held
No

Reported by Yigal Hochberg
<hochberg@dmhsoftware.com>

warning: Functions called via pointers must be 'reentrant'
to take arguments

typedef int (Funcptr_t)(int x, int y, char *z) reentrant; /*
function pointer type */

struct abc {
Funcptr_t *funcptr;
};

void
foo(int a,
int (*func_ptr)(int x, int y, char *z) reentrant, /* function
pointer */
int b)
{

a = 5;
b = 5;
(*func_ptr)(a, b, "hello");
}

void
foo1(int a,
Funcptr_t *func_ptr,
int b)
{
struct abc myabc;

a = 5;
b = 5;
(*func_ptr)(a, b, "hello");

(*myabc.funcptr)(a, b,"hello"); /* sdcc does not like it */
}

Discussion

  • Johan Knol
    Johan Knol
    2003-03-12

    • status: open --> closed
     
  • Johan Knol
    Johan Knol
    2003-03-12

    Logged In: YES
    user_id=63512

    fixed in src/SDCC.y:1.62

     
  • Johan Knol
    Johan Knol
    2003-03-12

    • milestone: --> fixed
    • assigned_to: nobody --> johanknol