else-branch with empty debug statement
I have a lot of debug message options in my code.
define DBG_INFO(txt) WriteLn(txt)
void foo(UInt16 a)
if (a != 0)
DBG_INFO("a = 0");
With Lint 9.00L I get a note "960" Violates MISRA 2004Required Rule 14.10, else-branch must have a comment or action.
However, the else branch is not empty. It contains code that is just removed by the preprocessor.
I have seen some similar effects with asm statements where for lint I have done:
Only give a 960 note when the else branch is truly empty.
Wouldn't adding a "-dDO_DEBUG" to your lint file resolve this issue? Then Lint should always see your else blocks as non-empty.