This issue has brought us a lot of trouble, hoping to repair it as soon as possible.
yeah it is not nice.
By the way, how is the problem going?
I have not started looking at it yet. It's very hard to say when it will be fixed, we have fixed 145 defects so far this year. The number of open defects remains steady just above 200. It's a tough battle against defects.
If you want to investigate the issue please feel free to do it. imho cppcheck source code is pretty easy to install and debug, there are no dependencies you have to install.
This false positive is fixed in the git repo and will be part of the next release. There is still room for improvements to set the correct values but t least wrong values will not be set.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
error report :
test_5.cpp:10:16: error: Division by zero. [zerodiv]
return 100 / B;
^
Incorrectly parse enum value B into 0 which is really 18.
Thanks! I believe this is covered by the ticket: https://trac.cppcheck.net/ticket/9647
Thanks for your reply!
This issue has brought us a lot of trouble, hoping to repair it as soon as possible. By the way, how is the problem going?
yeah it is not nice.
I have not started looking at it yet. It's very hard to say when it will be fixed, we have fixed 145 defects so far this year. The number of open defects remains steady just above 200. It's a tough battle against defects.
https://trac.cppcheck.net/query?status=closed&changetime=01%2F01%2F2020..06%2F28%2F2020&type=defect&col=id&col=summary&col=type&col=status&col=component&col=priority&col=milestone&order=priority
Personally I think problems in the parser are extra important though. Those can have a bad effect on so many checks.
If you want to investigate the issue please feel free to do it. imho cppcheck source code is pretty easy to install and debug, there are no dependencies you have to install.
If you want to speedup my bugfix feel free to look at: https://github.com/sponsors/danmar/
This false positive is fixed in the git repo and will be part of the next release. There is still room for improvements to set the correct values but t least wrong values will not be set.