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
Ravas,

when you make builds for OSX (the DMG file for sourceforce)
it's best to use clang and a installation of Qt from www.qt.io.

Do not use macports for this!

The script build-dmg-externalqt-clang.sh (that uses build-osx.sh) attempt to make a few builds for the different versions of OS/X.
I did see if that the builds files have been modified, so make sure it will do the right thing.
This also means you don't need our mkspec for OS/X anymore, ensure that it's not used by any of the builds.
By default it builds with -j4 and I think I did read somewhere that for some users it fails, it always worked for me
but feel free to take that a notch back to -j 3.

Cheers,
Ries

On Mar 17, 2016, at 5:13 PM, ravas [via LibreCAD] <[hidden email]> wrote:

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 surpressed 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.


If you reply to this email, your message will be added to the discussion below:
http://forum.librecad.org/New-LibreCAD-CI-features-including-static-analysis-tp5713349p5713351.html
To start a new topic under LibreCAD-dev, email [hidden email]
To unsubscribe from LibreCAD, click here.
NAML

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.