I am curios how does the SonarQube/Sonar Scanner handle the preprocessor include instructions in C language?
Does the scanner run on the final source file, AFTER the include file, or on each source + header file?
My concern is the following:
if I want to exclude a header file, do I risk that also the files where that particular header file is included, to be automatically excluded from the scan?
The analysis runs on the entire translation unit (all the included header files are part of the translation unit)
When a header file is exluded the issues on it will no be shown. That will not affect the results of the other files.
When a source file is excluded, the headers that are only included in that file will no be analyzed. That is due to the fact that we don’t analyze headers by themselves.