void *p;
extern void g(int (*h)(int));
void f() {
g((int (*)(int))p);
}
/*
casting5.c:6: error: too few parameters
casting5.c:6: error: incompatible types
from type 'int generic* '
to type 'int function code* '
casting5.c:6: error: code not generated for 'f' due
to previous errors
*/
~
Logged In: YES
user_id=888171
Anyone have any idea if the original cast is legal C?
On the other hand, the next fragment works perfectly fine
and produces the same code as I would expect from the
former if it did not generate an error.
void *p;
extern void g(int (*h)(int));
void f() {
int (*fp)(int) = p;
g(fp);
}
Greets,
Maarten
Logged In: YES
user_id=203539
Fixed in SDCC.y 1.105, sdcc build 1197
For reference: this was applied in [r4024] by Bernhard.