From RidgeRun Developer Connection
C++
Tools Considered
- g++
- The plain compiler invoked as
g++ -Weverything -c
on the file. Not ideal nor a real linter, but mainly for convenience.
- clang++
- The plain compiler invoked as
clang++ -Weverything -c
on the file. Not ideal nor a real linter, but mainly for convenience.
- cppcheck
- A C/C++ linter with a novel flow sensitive analysis.
- cpplint
- A linter built by google specifically for their coding standard.
- clang-tidy
- A clang-based C++ linter
- clang-analyzer
- Another clang-based static c++ linter with awesome reporting features.
Checks
Memory Leaks (function variables)
Linter |
New |
Malloc |
Calloc |
Realloc
|
g++ -Weverything |
N |
N |
N |
N
|
clang++ -Weverything |
N |
N |
N |
N
|
cppcheck |
Y |
Y |
Y |
Y
|
clang-tidy |
Y |
Y |
Y |
Y
|
clang-analyze |
Y |
Y |
Y |
Y
|