Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
macro contains unaceptable items misra c 2004 19.4
#1
Example

#define MACRO_2 1(this macro is defined in some other file)

#define MACRO_1 MACRO_2

this statement is causing the warning in "macro contains unacceptable items misra c 2004 19.4".Is this warning valid? Is it really a invalid macro definition?
<t></t>
Reply
#2
This example has previously caused much debate within the team!

Under a strict interpretation of the Rules, then MACRO_2 probably should be in braces... but that is clearly unnecessary, probably unintentional, and serves no purpose.

For MISRA C:2012 the ambiguity is removed, and there is no requirement to add the additional parentheses.
Posted by and on behalf of the MISRA C Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)