Closed
Description
Affected rules
A16-0-1
Description
We erroneously identify otherwise acceptable conditionals with #else
or #elif
preprocessor directives as invalid, as the #else
and #elif
are not considered de facto valid.
This should be addressed by:
- Always considering
#else
acceptable, and relying on reporting any issues in the#..if
directive. - Considering
#elif
an acceptable directive within a preprocessor conditional, but still considering the#elif
on its own merits.
Example
#ifdef MACRO_ENABLED
#include "test1.h"
#else
#include "test2.h"
#endif