rspec/rules/S956/cfamily/rule.adoc

29 lines
719 B
Plaintext
Raw Normal View History

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 {cpp}: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