Static code analysis with QtCreator-4.0.0, part 1


The latest version of QtCreator brings an option to run static-code-analysis using Clang. I struggled a lot with the setup of Coverity for Asset-Importer-Lib, so I had some hope that the setup for Clang will be a little bit easier. I wanted to run it on Windows 10 first, then move to Linux. So here is the report of my experiences:
First thing to do is get the latest QtCreator-version, the latest one is QtCreator-4.0.0. You can find it here: https://www.qt.io/ide/ .
QtCreator is able to open CMake-based projects. What a luck: Asset-Importer-Lib is based on a CMake build. So open it and run the clang-analyser, theoretically.

Unfortunately there is a bug with clang-analyser when you are using the Visual-Studio to build it. You can find the corresponding bug here: https://bugreports.qt.io/browse/QTCREATORBUG-16234 . When using VS together with the clang-analyser the executable of clang cannot been started in the correct way. The workaround to get it running is easy: add the folder conaining clang in the QtCreator-bin-directory to your Enrironment-variable path.
Did it, restarted QtCreator, open Asset-Importer-Lib, clang analysis began to work …

To be continued …