Search code examples
bashcppcheck

CPP check not on local machine


I want to run a bash script that will run cppcheck not on my local machine.

I cloned the cppcheck repository and I want to run the cppcheck command on a certain file using bash script.

is there a an actual script in the cppcheck repository I can use (for example ./cppcheck/cppcheck.sh file.cpp ) in order to get the results on file.cpp?

what will be the best way to approach this?

Thanks!


Solution

  • this can be done with the following commands:

    cd cppcheck

    then build cpp check on the machine with :

    make MATCHCOMPILER=yes CXXFLAGS=-O2

    then run the check simply by

    ./cppcheck </somefile>