How to use CppCheck tool to review your c / cpp code in ubuntu?

Ganesh M S picture Ganesh M S · Dec 21, 2017 · Viewed 10k times · Source

I am trying to use the CppCheck tool in Ubuntu. I ran the following command

cppcheck --enable=all  --check-config --suppress=missingIncludeSystem main.c 2>err.txt

It is creating the err.txt file but it is empty.

How to get the ratings or check the code in the main.c file.

Answer

Daniel Marjamäki picture Daniel Marjamäki · Dec 23, 2017

remove --check-config .. that tells cppcheck that you only want to check the command line configuration.