Hi, since we have updated to Cppcheck 2.5 from 2.4, we see many false positives in misra add on for rule 12.4 (Evaluation of constant expressions should not lead to unsiged integer wrap around). It also happens with Cppcheck 2.6.
This rule is intented for checking the limits in the operations with unsigned integers, but cppcheck is giving the warning in simple functions like:
uint16_t simple_function(void)
{
uint16_t result = 0;
retun result;
}
Does anyone have experience something similar?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ok!! I think i got it!!! Find attached an screenshot of the problem.
I've been reviewing my setup and I found the problem: I was updating the installation of cppcheck, but I was not updating the addons folder. I have it in a separate folder, and I didn't realize it has many changes in release 2.5 and 2.6. So I just downloaded the latest version of it from github and now this strange FP have dissapeared.
Hi, since we have updated to Cppcheck 2.5 from 2.4, we see many false positives in misra add on for rule 12.4 (Evaluation of constant expressions should not lead to unsiged integer wrap around). It also happens with Cppcheck 2.6.
This rule is intented for checking the limits in the operations with unsigned integers, but cppcheck is giving the warning in simple functions like:
Does anyone have experience something similar?
ouch!
I fail to reproduce:
Do you get the FP for this with that command? Or do I need to adjust something to get the FP..
Mmm...
I will come back with more details.
Thanks!
El mié., 26 ene. 2022 20:59, "Daniel Marjamäki" danielmarjamaki@users.sourceforge.net escribió:
ok!! I think i got it!!! Find attached an screenshot of the problem.
I've been reviewing my setup and I found the problem: I was updating the installation of cppcheck, but I was not updating the addons folder. I have it in a separate folder, and I didn't realize it has many changes in release 2.5 and 2.6. So I just downloaded the latest version of it from github and now this strange FP have dissapeared.
Thanks for the support anyway!! :-)