I guess really my question is, and then I stand corrected, is it
really necessary to include function declarations into the module
where the functions are implemented?
It is not *necessary*. It *is* a good idea.
A C compiler is not obliged to complain if we write the following, in
three separate files that build two translation units that build one
program:
/* main.c */
#include <stdio.h>
#include "bob.h"
int main(void) {
printf("bob() = %d\n", bob());
return 0;
}
/* bob.h */
int bob(void);
/* bob.c */
#include <string.h>
double bob(char *arg) {
if (strcmp(arg, "forty-two") == 0)
return 42.0;
return 3.1415926535897932384626433832795;
}
(Cut apart at comments, put into obvious files, and compile and see.)
Here main.c includes bob.h; bob.h lies, saying that bob() takes no
arguments and returns "int". Meanwhile, bob.c fails to include
bob.h. The compiler is not required to produce a diagnostic, and
most do not. The resulting executable (if we get one, and we usually
do) does not work right.
Had bob.c included bob.h, however, the compiler would have been
obligated to produce a diagnostic. We would have discovered, at
compile time, that bob.h lied about function bob(), and been given
a chance to fix the bug *before* it manifested.