Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Something similar to checkstyle for C++ to be working on Linux

Tags:

java

c++

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?

like image 388
rkb Avatar asked Feb 10 '11 19:02

rkb


People also ask

What is Cppcheck in Linux?

Cppcheck is a command-line tool that tries to detect bugs that your C/C++ compiler doesn't see. It is versatile, and can check non-standard code including various compiler extensions, inline assembly code, etc. Its internal preprocessor can handle includes, macros, and several preprocessor commands.

What is Cppcheck tool?

Cppcheck is a static code analysis tool for the C and C++ programming languages. It is a versatile tool that can check non-standard code. The creator and lead developer is Daniel Marjamäki. Cppcheck.

How do I use Cppcheck tool?

Running Cppcheck on Selected FilesSelect Analyze > Cppcheck. In the Binary field, enter the path to the Cppcheck executable file. In the Checks group, select the checks to perform. Note: By default, Cppcheck uses multiple threads to perform checks.

Which command can be used to static analysis using Cppcheck?

--max-configs=<limit> If used together with --force, the last option is the one that is effective. By default the platform which was used to compile Cppcheck is used. Only print something when there is an error.


2 Answers

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.

like image 116
Mark Loeser Avatar answered Oct 26 '22 17:10

Mark Loeser


Vera

Astyle (Artistic Style)

Universal Indent GUI

Bcpp (C++ Beautifier)

Polystyle

Also see this question

like image 45
ayush Avatar answered Oct 26 '22 18:10

ayush