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
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.
When conditional compilation directives include or exclude blocks
of code and are spread over multiple files, confusion arises. If you
terminate an #if directive within the same file,
you reduce the visual complexity of the code and the chances of an
error.
If you terminate #if directives within the
same file, you can use #if directives in included
files
'#else' not within a conditional.
'#elseif' not within a conditional.
'#endif' not within a conditional.
Unterminated conditional directive.
If you expect a rule violation but do not see it, refer to Coding Standard Violations Not Displayed.
| Group: Preprocessing Directives |
| Category: Required |
| AGC Category: Required |