I have simple program in two units:
count_words.c:
int main( int argc, char ** argv )
{
printf("starting\n");
int i = aaa(55555);
printf("%d",i);
printf("ending\n");
return i;
}
clean.c:
int aaa(int i)
{
printf("aaa\n");
return 5;
}
Makefile:
count_words: clean.o count_words.o -lfl
gcc count_words.o clean.o -lfl -ocount_words
%.o:%.c
gcc -c -o $@ $<
Program builds fine and runs, but in count_words.c
I didn't include header file with function int aaa(int)
declaration from clean.c
. Why I need to have header file at all since I have no problem to compile program without them?