[previous] MISRA C:2012  Rule-20.1:  (Advisory) [next] #include directives should only be preceded by preprocessor directives or comments

Amplification:

The rule shall be applied to the contents of a file before preprocessing occurs.

Example Code:


#include "misra.h"
#include "m3cmex.h"

extern int16_t rule_2001( void )
{
   return 1;
}

#include "rule-20.01.h"                         /* 5087 */



QAC messages that encompass this guideline:

5087 Use of #include directive after code fragment.



(c) The Motor Industry Research Association, 2012
QA C Source Code Analyser 8.1.2
MISRA C:2012 Compliance Module 1.0
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents