I have the following code:
#include <stdlib.h>
#include <stdio.h>
typedef void (*func_t)(void * data);
void func2(int * arg, func_t free_func) {
free_func(arg);
}
void func(int * a) {
printf("%d\n", *a);
}
int main(int argc, char ** argv) {
int a = 4;
func2(&a, func);
return 0;
}
Compiling which gives me warning: passing arg 2 of `func2' from incompatible pointer type
Why is that? Shouldn't int pointer be compatible with void pointer?