Following are three files,
/* HANDLERS.H */
#define TRUE 1
#define FALSE 0
/* Functions declarations - included in both UI.C & tiffhandler.c */
int canHandle(char *);
int drawImage(char *);
int saveFile(char *);
/* tiffhandler.c */
#include "HANDLERS.H"
int canHandle(char *fileName){
return TRUE;
}
int drawImage(char *fileName){
return TRUE;
}
int saveFile(char *fileName){
return TRUE;
}
/* UI.C */
#include "HANDLERS.H"
int main(void){
}
that are compiled as,
>gcc HANDLERS.H tiffhandler.c UI.C
My question,
HANDLERS.H is included in both UI.C & tiffhandler.c. So, function declarations are included in both.
During linking phase, before tiffhandler.o & UI.o are linked, Why linker does not complain, by saying, multiple function declarations for each function(say canHandle)?