I tried CPPcheck on a 15k LOC AVR embedded project which I recently had
to fix.
Tried it on the original sources:
- did identify some dogy coding, thanks!
- very few false positives, thanks!
- missed some egregious errors - how best to report?
- reports functions not used, that are in fact used.
What's your preferred method of reporting problems?
Unfortunately the sources are proprietary and require AVR libraries etc.
Thanks!
Best Regards, Dave
--
Dave Nadler, USA East Coast voice (978) 263-0097, drn@nadler.com, Skype
Dave.Nadler1
Here are some example misses, all taken from a real project I had to clean up:
Bugs that could (maybe?) be found by static analysis, but not found by CPPcheck.
Bug 1
//Don't know if this could be caught in static analysis.//Wronganswerfromstrtolbecausechararrayhadnoterminatorand//strtolfoundvalidhexdigitsinsubsequentbytes...
struct {
charID[6];int32_tfoof;
} s;s.foof=0x41414141;longl=strtol(s.ID, 0, 16);
Last edit: Dave Nadler 2021-04-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried CPPcheck on a 15k LOC AVR embedded project which I recently had
to fix.
Tried it on the original sources:
- did identify some dogy coding, thanks!
- very few false positives, thanks!
- missed some egregious errors - how best to report?
- reports functions not used, that are in fact used.
What's your preferred method of reporting problems?
Unfortunately the sources are proprietary and require AVR libraries etc.
Thanks!
Best Regards, Dave
--
Dave Nadler, USA East Coast voice (978) 263-0097, drn@nadler.com, Skype
Dave.Nadler1
Could you show some similar small example code?
Sure - Do you prefer I post here or set up on trac? Whatever is easiest for you...
Here are some example misses, all taken from a real project I had to clean up:
Bugs that could (maybe?) be found by static analysis, but not found by CPPcheck.
Bug 1
Bug 2
Bug 3
Bug 4
Last edit: Dave Nadler 2021-04-18