Cppcheck - C/C++ Code Analysis Tool
Posted: Sat Oct 21, 2023 6:18 am
Cppcheck is a tool for C/C++ code analysis: https://cppcheck.sourceforge.io/
Installation
To install the software, download and run the Windows 64-bit installer found on that page.
Thie installer requires admin rights as it installs to the following folder location:
The installer does not add the installation folder to the system PATH so this will need to be done as a seperate user step as described here: viewtopic.php?t=6176
Cppcheck User Manual
The user manual for this tool can be found here: https://cppcheck.sourceforge.io/manual.pdf
Zeus Integration
To use cppcheck from inside Zeus, use the Options, Document Types menu to edit the C/C++ Document Type and inside the Tools panel add new tool using the details shown below:
This will create a new C/C++ specific tool as shown below:
Testing the Cppcheck Tool
To test the newly created tool, save the following code to an example.cpp file:
With that file open in Zeus the Tools menu will now show the cppcheck option in the menu as shown below:
Running that tool will then result in the following output, highlighting the error in the code:
Cheers Jussi
Installation
To install the software, download and run the Windows 64-bit installer found on that page.
Thie installer requires admin rights as it installs to the following folder location:
Code: Select all
C:\Program Files\Cppcheck
Cppcheck User Manual
The user manual for this tool can be found here: https://cppcheck.sourceforge.io/manual.pdf
Zeus Integration
To use cppcheck from inside Zeus, use the Options, Document Types menu to edit the C/C++ Document Type and inside the Tools panel add new tool using the details shown below:
Code: Select all
Cppcheck '$f' File
cppcheck.exe
--platform=win64 "$fn"
$fdd
To test the newly created tool, save the following code to an example.cpp file:
Code: Select all
int main()
{
char a[10];
a[10] = 0;
return 0;
}