![]() |
![]() |
3318 | ![]() |
||||
![]() | |||||||
| Preprocessing | |||||||
A '#else', '#elif' or '#endif' has been encountered in an included file and it appears to be related to a '#if' or #ifdef directive in the parent file. This is not illegal, but if intentional, it is certainly very unconventional and likely to result in confusion. The structure of the code will be much easier to understand if #else, #elif and #endif directives are always located in the file which contains the corresponding #if or #ifdef.
MISRA C:2012 Rules applicable to message 3318:
| 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 |
See also:
![]() | ||
| 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 |