Closed marekmosna closed 2 years ago
OK, most of these will be easy. The memmove
ones are interesting and may represent actual bugs. So definitely will take a look at those ASAP.
Thanks!
Yeah. As soon as you deploy testing framework style
and portability
issues disappear. The only real issue is that memmove
. I know what is going on there and now, I'm trying to find out some fancier solution :1st_place_medal:
Out of curiosity, what version of cppcheck are you using? I ran the same exact command with 2.6.3 (I'm installing 2.7.x now) and it only had style and portability errors listed, the memmove
didn't come up.
Hmm, perhaps the memory error check is only available in the "premium" version?
Good question. This one is in stable ubuntu:focal
tree
$ cppcheck --version
Cppcheck 1.90
Interesting, so maybe they are false positives? For the memmove? Because neither 2.6 or 2.7 emit those (though they do emit a few more style related warnings)
Well I addressed the trivial stuff by using %zu
to print size_t
types. The only ones left that show up in cppcheck 2.7 are redundant condition warnings, which while true... are also (as far as I can tell) necessary because we're using macros here and they need to work correctly both when used indepdendently and when composed.
So I presume that this issue is going to be closed. The higher versions of cppcheck
clarify the results. If you don't have any further questions, close it @eteran .
Cheers
Maybe at the end, link it to your commit 1b205da9cb26d35c0aa14d8ec02082570fc1be74.
@marekmosna Correct, all findings I was able to both confirm and conclude aren't necessary quirks have been address in commit: https://github.com/eteran/c-vector/commit/1b205da9cb26d35c0aa14d8ec02082570fc1be74
Of course, I will continue to both use and encourage users to search for any memory error class bugs as those are particularly harmful.
Thanks for the help looking into this!
Hello @eteran I made static c code analysis by
cppcheck
and here is the result. If you want to fix it let me know, or close the issue otherwise. I can even integrate it into CI but there is already any CodeQL static analysis. I don't know what it doing butcppcheck
I know.