My understanding is that you put file guards in a file header1.h
to make sure that for any source file source.c
in your program, header1.h
is included at most once in it.
However, everyone seems to strongly advise that header files should only contain function/variable declarations, and macros. Never function/variable definitions.
If we follow this practice, then there should be no problem of including header1.h
multiple times in source.c
, because you are allowed to declare variables/functions as many times as you want.
The only downside is that your code will be longer, but then is the only purpose of file guards to keep code short?