void foo( int (*f)() )
{
f(1);
f(1, "2" , 3.0);
}
https://godbolt.org/z/s6e5rnqv9If you compile with -std=c23, both gcc and clang will throw an error ( (*f)() is now the same as (*f)(void) )
Homer nods.
Kids these days!
You can write a function declaration that's inconsistent with its definition in another translation unit. Declaring the function in a shared header file avoids this.
You can use an old-style declaration that doesn't specify what parameters a function expects. Don't do that. Use prototypes.
You can use a cast to convert a function pointer to an incompatible type, and call through the resulting pointer. Don't do that.
You can call a function with no visible declaration if your compiler overly permissive or is operating in pre-C99 mode. Don't do that.
Itanium? Stone age
Itanic had variable-sized register windows, plus extra tag bits for NaT ("not a thing") placeholder values. If you didn't set one of the argument registers the callee might trap in unexpected ways when it touches the register garbage.