-
Type:
Bug Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Default Severity:Major
-
Impact:Low
-
Likelihood:High
-
Default Quality Profiles:Sonar way
-
Legacy Key:PPBadIncludeForm
-
Covered Languages:C, C++, Objective-C
-
Remediation Function:Constant/Issue
-
Constant Cost:10min
-
MISRA C 2004:19.3
-
MISRA C 2012:20.3
-
MISRA C++ 2008:16-2-6
-
PC-Lint:12, 1012, 9086
These are the only forms for the #include directive permitted by the standard. The behavior is undefined when other forms are used.
Noncompliant Code Example
#include filename.h // Noncompliant
Compliant Solution
#include "filename.h" // Compliant #include <filename.h> #define HEADER "filename.h" #include HEADER
See
- MISRA C:2004, 19.3 - The #include directive shall be followed by either a <filename> or "filename" sequence.
- MISRA C++:2008, 16-2-6 - The #include directive shall be followed by either a <filename> or "filename" sequence.
- MISRA C:2012, 20.3 - The #include directive shall be followed by either a <filename> or "filename" sequence
1.
|
C-Family | RSPEC-4365 |
|
Active | Unassigned |