Is there any way to make this code shorter?
long call_f(int argc, long *argv) {
switch (argc) {
case 0:
return f();
break;
case 1:
I don't know how you can make your code shorter but I saw this line in your code:
return f();
From the next calls to f
function, it seems that f is a function that takes variable number of arguments.
You can read in wikipedia that:
Variadic functions must have at least one named parameter, so, for instance,
char *wrong(...);
is not allowed in C.
Based on that, maybe the return f();
statement is causing you trouble?