Although it is theoretically possible to integrate an external static analyzer into Eclipse as demonstrated here (i.e. for Cppcheck), I was wondering whether a more up to date solution exists which does not require plug-in development? For example an existing plug-in, an available option in CODAN or a simplified version of the above tutorial for Clang Static Analyzer specifically.

- 378,754
- 76
- 643
- 1,055

- 783
- 7
- 14
-
So instead of extending CDT to make it a fuller solution, you want to do a half-baked integration of another solution? My experience is that trying to glue two program analysis infrastructures together ends badly; you fight too many impedance mismatches. – Ira Baxter Jul 31 '16 at 17:50
-
What I was aiming for is a solution which provides the static analysis quality of clang. I am not sure of this answers your question. And yes, I am not sure if its a good idea to do that, I was hoping that someone has already tried that and can share his/her experience. In the end of the day, I do observe a much better static analysis with clang compared to CODAN outside of Eclipse. If extending CDT is the only way to go, I am willing to look into that option. However I am neither an expert in plugin development nor an expert in Eclipse, I was hoping to find an existing solution. – Teodor Nikolov Jul 31 '16 at 18:37
-
Maybe you just want to ignore CDT and use Clang under Eclipse? Apparantly there is a plugin already. I have no experience with it but this seems appropriate: http://stackoverflow.com/q/32726175/120163 – Ira Baxter Aug 01 '16 at 00:13
-
I am aware of that option but, unfortunately, it works only for LLVM older than 3.2 ([link](https://github.com/TuononenP/llvm4eclipsecdt)). – Teodor Nikolov Aug 01 '16 at 08:25
3 Answers
CodeCheckerEclipsePlugin is an Eclipse plugin that shows Clang Static Analyzer and Clang Tidy defects for your C/C++ projects.
After installation you can add it to your CDT project as "CodeChecker nature". The only software requirement is that you must have Clang and CodeChecker tools installed on your machine. You will need to set up your project so it builds from from Eclipse CDT. Clang static analyzer will be called automatically on your code whenever you build your project in eclipse.
The plugin will call the CodeChecker tool in the background which in turn calls the analysis engines (tidy and static-analyzer) on your build.
As an extention to ClangSA, you may also suppress false positives by using codechecker_suppress code comments like: // codechecker_suppress [deadcode.DeadStores] suppress deadcode
The plugin is hosted on github, see https://github.com/Ericsson/CodeCheckerEclipsePlugin

- 81
- 1
- 3
You can take a look at Artemis plugin. Open source project with real-time check based on CODAN framework and quickfix support.

- 21,813
- 18
- 54
- 108