Why is this an issue?
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
Resources
- 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