Just found this acticle on the Internets. It is an advertishment of a Cpp static analyser, with a demonstration on OpenMW source.
I guess it could be interesting for the devs.
Link
Static analysis
- psi29a
- Posts: 5361
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: Static analysis
It is nice that did that, but it is a gigantic advertisement for their product. "Buy our product for your C++ team."
Many of these errors can be caught if people used clang/llvm by default.
for me it is dead simple:
It took about 10 minutes to run on my system:
This will produce a report in /tmp with everything you wanted to know, but didn't want to pay for it.
Many of these errors can be caught if people used clang/llvm by default.
for me it is dead simple:
Code: Select all
scan-build cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE="Release" -DUSE_SYSTEM_TINYXML=TRUE -DBUILD_WITH_DPKG=TRUE ../openmw
scan-build make -j8 # 8 cores of fun
By comparison, this is normal gcc compile time:real 9m30.033s
user 66m25.562s
sys 2m39.715s
real 3m49.013s
user 26m23.129s
sys 1m23.451s
This will produce a report in /tmp with everything you wanted to know, but didn't want to pay for it.
Re: Static analysis
I think Cppcat has a few bugs of its own if it attempts to sell its product. Good luck selling plugins for Windows software to this team.cppcat wrote:CppCat is a tool to search for bugs in C/C++ programs that comes as a plugin for Microsoft Visual Studio 2010, 2012, 2013
Re: Static analysis
Guys, my point was to show that some bugs were already found by someone, not to advertise the tool. Please dont be so agressive
Re: Static analysis
Fair enough, I'll go have a look at those pointed out (I have a feeling that one of them was fixed not so long ago)
- psi29a
- Posts: 5361
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: Static analysis
Not aggressive, just stating the facts.
Have a look here at my static analysis done a few months ago, for free.
viewtopic.php?f=6&t=2059&p=23852
Some of those mentioned in his post are in this report, meaning they are still there.
Lazydevs...
Here is someone's chance to make commits.
Have a look here at my static analysis done a few months ago, for free.
viewtopic.php?f=6&t=2059&p=23852
Some of those mentioned in his post are in this report, meaning they are still there.
Lazydevs...
Here is someone's chance to make commits.
Re: Static analysis
Had a quick look. Here is my take on it:
#1 - probably duplicate & no real harm, no action for now since I don't know utf8
#2 - already fixed a few weeks back
#3 - probably no real harm, no action for now since I don't know this code
#4 - not sure if this really needs fixing IMHO
#5 - I'll fix this one (because it is easy )
#6 - #8 - I'll fix these (even easier )
#9 - looks like a recent change, probably meant to be mUpperBodyState != UpperCharState_UnEquipingWeap but I'll leave that for the author to confirm
#10 - #11 - left for the author to confirm
#12 - I'll fix this one
EDIT: I'm awed by the power of marketing - there is even a bug raised for this https://bugs.openmw.org/issues/1355 in addition to three separate forum topics
#1 - probably duplicate & no real harm, no action for now since I don't know utf8
#2 - already fixed a few weeks back
#3 - probably no real harm, no action for now since I don't know this code
#4 - not sure if this really needs fixing IMHO
#5 - I'll fix this one (because it is easy )
#6 - #8 - I'll fix these (even easier )
#9 - looks like a recent change, probably meant to be mUpperBodyState != UpperCharState_UnEquipingWeap but I'll leave that for the author to confirm
#10 - #11 - left for the author to confirm
#12 - I'll fix this one
EDIT: I'm awed by the power of marketing - there is even a bug raised for this https://bugs.openmw.org/issues/1355 in addition to three separate forum topics
- EmperorArthur
- Posts: 33
- Joined: 17 May 2014, 07:52
Re: Static analysis
Here's a scan-build from latest master (538aa6607ecdb6d105ef994b62f8f29711732a1e).
Re: Static analysis
Hmm... a few div by zero and null ptr ones. Will have to check them out.