New LibreCAD CI features including static analysis

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

New LibreCAD CI features including static analysis

maqifrnswa
I set up LibreCAD to work with travis. All pull requests will be test built (you'll see it on the pull request).

Also, every commit will have clang's static analyzer run over it. The output will be visible:
http://librecad.github.io/static-analyzer-reports

There are already quote a few potential bugs. We can also set up a coverity scan, but that requires manual intervention. This static analysis is automatic.

I also built the packages on travis with clang, which has different warnings than gcc - and there were actually too many warnings that the build had to stop. That might be something to look at if you're interested in cleaning up some code -- try building librecad with clang and see what happens.
Reply | Threaded
Open this post in threaded view
|

Re: New LibreCAD CI features including static analysis

maqifrnswa
> Also, every commit will have clang's static analyzer run over it. The output
> will be visible:
> http://librecad.github.io/static-analyzer-reports

I just wanted to point out how cool clang's static analyzer is.
Here is a potential memory leak - it walks you through the source code
and tells you exactly which branches/conditions would cause the memory
leak and exactly where memory is allocated and not destroyed!
http://librecad.github.io/static-analyzer-reports/report-70f308.html#Path1
Reply | Threaded
Open this post in threaded view
|

Re: New LibreCAD CI features including static analysis

ravas
Thanks! That's very helpful.

I have been using clang for a few weeks now, but was unaware that it had a static analyzer.
It's much faster than gcc... a full build only takes 2.5 to 3 minutes.

The extreme amount of warnings (around 50k) can be suppressed with -Wno-inconsistent-missing-override

I did some research two nights ago, and ended up with this in my custom.pri

QMAKE_CXXFLAGS_WARN_ON = -Wall -Wextra -Wpedantic -Wno-inconsistent-missing-override -Wno-nested-anon-types

-Wno-nested-anon-types is needed because of muparser.

-Wdocumentation can be added for anyone interested in cleaning up the dox.
Reply | Threaded
Open this post in threaded view
|

Re: New LibreCAD CI features including static analysis

R. van Twisk
Administrator
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: New LibreCAD CI features including static analysis

ravas
I'm using Qt 5.5.1 which uses clang by default on OS X.

I don't use macports.

I don't use build-dmg-externalqt-clang.sh

You are remembering my email about -j4 and -j3.
It doesn't fail on -j4,
but things can freeze if I try to do anything else during the build.
-j3 already builds it in under 3 minutes.