![]() |
![]() |
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:2004 Rules applicable to message 3318:
| Rule 19.17 (Required) | All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if or #ifdef directive to which they are related. |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |