Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a Windows equivalent of CppCheck?

I have an extreme problem.

I have been working on a game for about two years(20000+ lines of code), and Lately I have been noticing a ton of memory leaks. The problem is that I cannot track every single one of them since my game is way too big...

I have searched around and noticed that CppCheck would be useful in my situation, but the problem is that since I am using windows, i cannot use CppCheck(which is for linux only).

I am wondering if maybe there is a library or plugin that is CppCheck's equivalent for windows, or maybe a way to use CppCheck on windows instead.

All of the possibilities that I have come up with, along with solutions to other's problems(such as using smart pointers for std::deque and such) imply that my program is small or the more fitting: rewrite my entire program, something that I -really- do not want to do...

IDE: Code Blocks 10.05

Compiler: MinGW 3.81 GCC 4.4.1

like image 421
Molma Avatar asked Jan 13 '13 22:01

Molma


People also ask

What is Cppcheck tool?

Cppcheck is a static code analysis tool for the C and C++ programming languages. It is a versatile tool that can check non-standard code. The creator and lead developer is Daniel Marjamäki. Cppcheck.

What is Cppcheck in Linux?

Cppcheck is a static analysis tool for C/C++ code. It provides unique code analysis to detect bugs and focuses on detecting undefined behaviour and dangerous coding constructs.


1 Answers

CppCheck works on Windows too (check downloads on SourceForge). CppCheck is only a static check tool (it analyzes your source code to find some potential problems). In order to find real memory leaks it may be necessary to use some debugging tool that actually runs your code (look at Google's Dr. Memory for example).

like image 184
sirgeorge Avatar answered Oct 17 '22 20:10

sirgeorge