2021-04-28 18:08:03 +02:00
|
|
|
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
|
|
|
|
|
|
|
|
|