I am sure this is not the only reason, but you can compile files with calls to other functions when you only know the declaration of the function for example from a header file. This is possible without recompiling the definition of the function itself (which might be in another file). But to verify the function is called correctly, the compiler has to know its declaration. Then the linker will take care of the rest.
Here a little example
main.c:
#include "function.h"
int main(){
function();
return 0;
}
function.h:
#ifndef FUNCTION_H
#define FUNCTION_H
void function();
#endif
function.c:
#include "function.h"
void function(){}
I am using gcc to compile like that:
gcc function.c -c
this will produce an object file function.o. Now, when I want to compile my main function, I don t have to compile my function.c file anymore, I only have to know the declaration from the header file and the object file:
gcc main.c function.o -o test
Now, the object file will get linked into my program without recompiling.