recently discovered a very useful static code analysis tool, Pvs-studio, developed by a Russian company to diagnose errors in C/c++/c++11 source code. It is compatible with the visual Studio development environment and the latest version supports visual Studio2015. After the Pvs-studio is installed, Pvs-studio will appear in the Visual Studio navigation bar , as shown in visual Studio2010 .
Here is an example of some of the problems that I used Pvs-studio to check out the current program:
1. Assign values to variables.
2, the missing member variable assignment.
3. The condition is judged exactly the same.
4, the pointer is not checked before use.
5, memset the size of the incoming pointer, not the actual size of the array.
Finally attach the tool download link:
http://download.csdn.net/detail/johnsonlee86/9515591
Pvs-studio Static code analysis tools recommended