Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
- 阅读更多 关于 Function pointer “assignment from incompatible pointer type” only when using vararg ellipsis
问题 I know that declaring a function (or function pointer) with no parameter list (and without specifying void in the parameter list) that means that the function (or function pointer) has an unknown number of arguments. I wrote some test scripts to check this behavior out: int my_func_1() { return(0); } int my_func_2(int x) { return(x); } int my_func_3(char x, ...) { va_list va; va_start(va, x); return(va_arg(va, int)); } int (*fp)(); fp = my_func_1; printf("%d\n", fp()); fp = my_func_2; printf(