Moderators: david ward, misra cpp
- Posts: 109
- Joined: Wed Apr 27, 2016 2:33 pm
- Company: Elektrobit Automotive GmbH
Dear MISRA team,
the following comparison of two values of the same type is marked as violation of 5-0-4:
Code: Select all
typedef unsigned char ui8;
extern ui8 a;
extern ui8 b;
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.
- Posts: 148
- Joined: Mon Jun 02, 2008 1:55 pm
- Company: MISRA
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