20

Possible Duplicate:
What open source C++ static analysis tools are available?

Does anybody know of an open source,good static code analyzer for C++ code in Linux ? The idea is to catch programming errors even before the code goes in to the code review state. It would be great to have the possibility to add rules the tool. Does anybody know of such tool?

Community
  • 1
  • 1
Ajay
  • 9,167
  • 7
  • 29
  • 34

4 Answers4

7
NullUserException
  • 77,975
  • 25
  • 199
  • 226
LisztLi
  • 232
  • 2
  • 6
3

you can give a try pvs-studio:

http://www.viva64.com/en/pvs-studio/ (1)

also there is (bla-bla-lint): http://www.gimpel.com/html/index.htm (2)

missed note about linux, FlexeLint for C/C++ from (2) has linux support, (1) only for windows, you can check it only if your product crossplatform.

fghj
  • 7,599
  • 3
  • 22
  • 48
2

Take a look at clang's static analizer: http://clang-analyzer.llvm.org/

There are other tools like KLEE based on llvm, might worth a look, too.

Tim Cooper
  • 144,163
  • 35
  • 302
  • 261
mitchnull
  • 5,758
  • 2
  • 26
  • 23
  • Check out clang -Weverything but be aware that there will be a lot of false positives – koan Aug 25 '15 at 10:38
2

You can also customize GCC (4.6) by using plugins (coded in C) or MELT extensions (MELT is a high-level domain specific language to extend and customize GCC). This approach could be appropriate if you have your own coding rules that you want to check. However, it does take some work.

Basile Starynkevitch
  • 1
  • 16
  • 251
  • 479