C99 does not forbid you to call functions that do not have a prototype.
I canβt provide details because you did not send the code for square() or its call, but it is assumed that the progress made for the arguments in the square() call leads to different types being passed to the function, which it actually declares in implementation.
This will lead to undefined behavior and will be an error.
For instance:
// in foo.c: int foo(void) { char x = 42; return square(x); // x is promoted to int, but is wrong } // in bar.c
And if square() is defined by a prototype declaring a parameter to have an argument of type char , there is no way to call it correctly if the prototype was not a "visible" calling code, since in such cases the argument will be increased to int .
source share