[previous] 3317 [next] '#if...' not matched by '#endif' in included file. This is probably an error.
Preprocessing

This message is identifying a probable problem in an include file. The file contains a '#if' or '#ifdef' and no corresponding '#endif' has been encountered before reaching the end of the include file.

This would not be illegal providing the corresponding #endif is encountered before the end of the translation unit. However, if this is really the intended structure, it is most unusual coding and certainly not recommended practice.

For example, message 3317 would be generated when including a file of the following form:

=======================
#ifdef MAC

#if (TOKEN == 3)
   ...
#endif

=======================


MISRA C:2012 Rules applicable to message 3317:

Rule-20.14  (Required) All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related


QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents