I am curious about how usable the bug hunting feature is so far.
If you have used it. Do you have some opinions? Do you feel that it is too stupid to be useful? Did you try the function contracts in the GUI yet, if so how do you feel about those?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just tried cppcheck 2.0 for the first time and found bug hunting reports too many obvious false positives. This is in contrast to other checks that cppcheck is doing, which have got smarter in the 2.0 release (for example the knownArgument check).
The best example I have is this code, for which cppcheck reports error (bughuntingDivByZeroFloat): There is division, cannot determine that there can't be a division by zero.
I am curious about how usable the bug hunting feature is so far.
If you have used it. Do you have some opinions? Do you feel that it is too stupid to be useful? Did you try the function contracts in the GUI yet, if so how do you feel about those?
I've just tried cppcheck 2.0 for the first time and found bug hunting reports too many obvious false positives. This is in contrast to other checks that cppcheck is doing, which have got smarter in the 2.0 release (for example the knownArgument check).
The best example I have is this code, for which cppcheck reports error (bughuntingDivByZeroFloat): There is division, cannot determine that there can't be a division by zero.
(Don't ask why the code is bothering to divide by 1.0, or why there is a weird mix of int and unsigned int, I have no idea!)
I haven't tried using contracts yet but that seems like a really useful feature.
Last edit: Steven Cook 2020-05-20
Thanks! I created https://trac.cppcheck.net/ticket/9733 for that false positive.