Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macros & 14.3 II
#2
Moving the semicolon to the macro definition removes the null statement issue.
Code:
#if debugging
#define ASSERT(x)    asserttest(x); /* not compliant with 19.4. */
#else
#define ASSERT(x)
#endif

void f(int *p)
{
    ASSERT(p != 0)
}
Posted by and on behalf of the MISRA C Working Group


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)