This question is to understand the standard behavior for header file inclusion (not the one implemented on my compiler).
I have two header files with same names (but contents are different):
1) /user/include/myheader.h # In standard system folder
2) /private/myheader.h # In my private folder
Assume both the headers contains same multiple inclusion prevension macros
#ifndef MYHEADER
#define MYHEADER
...
#endif
I have C file /private/test.c, which includes both the above headers:
#include <myheader.h> // Includes from standard system folder
#include "myheader.h" // Includes from the folder where test.c is present
Do the content from both files go into the C file while pre-processing, since each MYHEADER definition has separate name space ? Or the second inclusion will be prevented since MYHEADER is already defined in same namespace ?
N1570:
Emphasis mine.
As written, only the contents of the first
myheader.hfile will be processed.