Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
5-0-4 false positive?
#1
Dear MISRA team,

the following comparison of two values of the same type is marked as violation of 5-0-4:

Code:
typedef unsigned char ui8;

extern ui8 a;
extern ui8 b;

void test(void)
{
  if (a != b)// false positive?
  {
    a = b;
  }
}

Is this a false positive?
I fail to see implementation-defined behaviour.
BTW, the rule scope/text fails to reference the implementation-defined behaviour.
Thanks.
<t></t>
Reply
#2
This is not one of our examples. If you are saying that your static analysis tool reports this as an error, you need to contact your tool vendor
The sign-ness of the underlying types haven't changed

You're right, we need a reference for the implementation defined behaviour
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)