I'm using Cppcheck as an alternative to Polyspace Bug Finder for Misra compliancy checking.
It's a great tool and finds many bugs that Polyspace doesn't.
We are using C89 so we don't have bool types.
Misra 10.1 is not triggering in this scenario. Polyspace is detecting this as a violation.
I think in this case Polyspace is correct.
I think this check should consider all operators that are listed in the Misra 10.1 rule and see if the operators are of the boolean type.
uint8_t frrt_misra_function(uint8_t value)
{
uint8_t retval;
if (value) //10.4 here, this is correct
{
retval = 1;
}
if (!value) //expect 10.1. 10.4 is not triggered either
{
retval = 2;
}
return retval;
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Great! I can assist in checking the solution for all operators.
This Misra rule is important to us as it takes a lot of effort to go back and forth between Polyspace and the code to fix these kinds of violations.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm using Cppcheck as an alternative to Polyspace Bug Finder for Misra compliancy checking.
It's a great tool and finds many bugs that Polyspace doesn't.
We are using C89 so we don't have bool types.
Misra 10.1 is not triggering in this scenario. Polyspace is detecting this as a violation.
I think in this case Polyspace is correct.
I think this check should consider all operators that are listed in the Misra 10.1 rule and see if the operators are of the boolean type.
Thanks! I have created https://trac.cppcheck.net/ticket/11712
Great! I can assist in checking the solution for all operators.
This Misra rule is important to us as it takes a lot of effort to go back and forth between Polyspace and the code to fix these kinds of violations.