Cppcheck is an static analysis tool for C/C++ code that we are using at work.
It's helping us to detect some problems that the compiler can not detect.
1- Install cppcheck:
- Go to cppcheck project site and download the current version of cppcheck.
- Untar it and compile it (e.g. "make" in the corresponding folder).
- Move it to a convenient folder (e.g. /home/bscuser/ )
- In Eclipse, go to Help > Eclipse Marketplace
- Look for "cppcheclipse" in the bar and click in "install"
- In Eclipse, go to Window > Preferences. In the C/C++ > cppcheclipse select the binary path (e.g. /home/bscuser/cppcheck-1.52/cppcheck)
The next menus can be found in Eclipse, go to Project > Properties.
- The configuration in the cppcheclipse menu can be found in the following snapshot:
- In cppcheclipse > Problems choose "Use project settings" and unselect "portability" (we are still not interested in this point). Keep the other ones selected.
- In the Project Explorer (by default at the left of the screen) right click on "src" and select cppcheck > Run cppcheck. Alternatively, use the shortcut: Shift + Ctrl + c.
No comments:
Post a Comment