While reading an online tutorial Makefile - OSDev Wiki I found a section mentioning quite a few compiler warnings I'd never seen before. I thought Wall Wextra and pedantic included all the warnings, the important ones at least, yet it seems that is not the case.
One of the warning flags caused the compiler to complain about some sections of my code: warning: no previous prototype for "functionName". Some digging showed me the problem was I didn't include the header file with the prototype in the source file containing the function definition.
I didn't do it because the source file does not require anything from the header. If it had any structure or macros, obviously I would have; but this is not the case this time.The only reason for the header's existence is to prototype the functions of the source file so they can be used elsewhere in my program.
Is it expected that every source file with external functions should include its own header with the function prototypes? If so, is there a particular reason, I mean it seems unnecessary and rather wasteful.