# apt install cppcheck
$ git clone https://github.com/danmar/cppcheck.git $ cd cppcheck $ make PREFIX=/usr/local SRCDIR=build CFGDIR=/usr/local/share/cppcheck/cfg HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" $ sudo make install
# apt install libpcre3-dev
$ cppcheck --enable=all . 2> cppcheck.log
$ cppcheck --enable=all [解析対象フォルダ] 2> cppcheck.log