If you are C/C++ developer and work with Microsoft Visual Studio or Borland C++ Builder, then you can use an open source tool called Cppcheck to check the source code for bugs. Cppcheck itself can be compiled using GCC version 4.6 or later. You can also use Clang++ package to compile it from the source code. Even though mainly targeted at Windows users, it also offers Linux packages for installation on Linux computers.
Before you install Cppcheck on your Windows PC, it is better that you install other development tools such as Clang++, Microsoft Visual Studio or GCC on your PC. This is because it may use some of the include files from these development packages.
Using Cppcheck is very easy. It uses the same approach as any other development software. We have to open the existing project files that were created using Microsoft Visual Studio or Borland C++ Builder 6. These projects are then opened in the Cppcheck window and it starts to analyze the loaded source code files belonging to the opened projects.
Depending on the project and the number of source code files inside them, it may take from a few seconds to many minutes for the analysis to complete. But you do not have to wait for the analysis to be completed, as it displays the results instantly in the results window.
In the window, it displays all sorts of findings such as errors, warnings, style warnings, portability, performance warnings, information etc. They are displayed in different colors and are labeled using different icons depicting the problem type. As you select these, it also displays the source code and the location of the error.
Cppcheck is able to find problems in your C/C++ projects and displays the information about the bugs too. It can save your precious time when fixing your source code and bringing it up to date.
You can download Cppcheck from https://github.com/danmar/cppcheck/.