7

I am looking for some tool to help with C++ like checkstyle, which is for JAVA. It should be available for LINUX.

Are you guys aware of any?

sth
  • 222,467
  • 53
  • 283
  • 367
rkb
  • 10,933
  • 22
  • 76
  • 103
  • 2
    possible duplicate of [A free tool to check C/C++ source code against a set of coding standards?](http://stackoverflow.com/questions/93260/a-free-tool-to-check-c-c-source-code-against-a-set-of-coding-standards) – philant Feb 10 '11 at 19:04

2 Answers2

6

Cppcheck is the best free tool you are going to get. If you're willing to spend money, there are a lot of very nice other tools out there. If you want to hack up your own solution, you can do what I did for my job and hack up cpplint with any additional rules you want to add.

Mark Loeser
  • 17,657
  • 2
  • 26
  • 34
  • 1
    @aaa: cpplint does style as well (which was why I threw that one in too) – Mark Loeser Feb 10 '11 at 19:18
  • Cppcheck does not check style. From the link above: "Cppcheck focus on bugs instead of stylistic issues. Therefore a tool that focus on stylistic issues could be a good addition." – Daniel R. Collins Feb 05 '23 at 02:25
1

Vera

Astyle (Artistic Style)

Universal Indent GUI

Bcpp (C++ Beautifier)

Polystyle

Also see this question

Community
  • 1
  • 1
ayush
  • 14,350
  • 11
  • 53
  • 100
  • 1
    Those are all links to code formatters (and one dead link) which are different from static analysis tools because with the latter only a check is performed and the dev is forced to correct the issues him_herself which has pro and con. – Kalle Richter Jul 13 '18 at 22:29
  • @KalleRichter that is true, but i know at least astyle has a dry run option. so can still be used as an analysis tool. – Itay Bianco Feb 09 '22 at 10:14
  • @ItayBianco: To my knowledge, the Astyle --dry-run option does not give any output or analysis, it just tests whether the tool itself can be run. If someone knows how to get analysis output out of that, I'd love to hear about it. – Daniel R. Collins Feb 05 '23 at 02:22