7

I would like to know is it possible to analyze Embarcadero RAD Studio C++ project with Clang Static Analyzer. As far as I understand I need a makefile or something any and ability to build the project with clang. But Embarcadero uses it's own C++ extension, so code can't be compiled with clang.

If analyzing is possible (at least for separate files) it would be good if someone post a sequence of steps what I need to do.

αλεχολυτ
  • 4,792
  • 1
  • 35
  • 71

3 Answers3

2

Just found out that since RadStudio XE2, it has integrated C++ Analyzer.

From my initial tests, in RadStudio 10.2 it seems to be based on Clang Static Analyzer (not 100% sure)

Here is video instructions for XE2 https://edn.embarcadero.com/article/41862 In Tokyo you access it from menu View->Tool Windows->C++ Analyzer.

My preliminary results are: very slow but pretty helpful results with lots of possible tweaking.

Niki
  • 558
  • 4
  • 10
  • It seems in C++ Builder 10.3.3, C++ 17 standard is not supported by the static analyzer. – VLL Feb 07 '20 at 13:58
1

You can try CppDepend which use Clang and Clang-Tidy to report all the issues reported by them.

However you have to use the BuildMonitor tool to intercept your compilation and link commands before analyze it with CppDepend.

0

If clang static analyzer is a hard requirement, then I don't know of a solution. But if static analysis in general is your requirement, then GrammaTech CodeSonar supports Embarcadero.