Synopsis: | All headers files shall be identified by an #include directive. |
Language: | C |
Severity Level: | 2 |
Category: | Preprocessing Directives |
Description: |
Justification Because "include <>" also searches system directories while "include """ doesn't, we shall use "#include <>" for inclusion of system header files (such as stdio.h). For other files "#include """ shall be used. Using (absolute) paths is a cause of build errors in a complex and/or flexible build environment. Example #include <stdio.h> /* RIGHT: System Includes */ #include "own_lib.h" /* RIGHT: Own Component Includes */ #include " somefile.h" /* WRONG: extra space */ #include"somefile.h" /* WRONG: missing space */ #include "../any_header_file.h" /* WRONG: do not use .. */ |