From 2f9c73ce82e8958a5dee66ff2fa7b042488fd94c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 3 Jan 2009 15:22:53 +0000 Subject: [PATCH] Buffer overrun: Moved the "buffer overrun" and "array index out of bounds" to "--all" because there were false positives --- cppcheck.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cppcheck.cpp b/cppcheck.cpp index 623e85ddc..9468052aa 100644 --- a/cppcheck.cpp +++ b/cppcheck.cpp @@ -263,14 +263,13 @@ void CppCheck::checkFile(const std::string &code, const char FileName[]) if ( _settings._checkFunctionUsage ) _checkFunctionUsage.parseTokens(_tokenizer); + // Class for detecting buffer overruns and related problems + CheckBufferOverrunClass checkBufferOverrun( &_tokenizer, _settings, this ); + // Memory leak CheckMemoryLeakClass checkMemoryLeak( &_tokenizer, _settings, this ); checkMemoryLeak.CheckMemoryLeak(); - // Buffer overruns.. - CheckBufferOverrunClass checkBufferOverrun( &_tokenizer, _settings, this ); - checkBufferOverrun.bufferOverrun(); - // Check that all class constructors are ok. checkClass.constructors(); @@ -279,6 +278,9 @@ void CppCheck::checkFile(const std::string &code, const char FileName[]) if (_settings._showAll) { + // Buffer overruns.. + checkBufferOverrun.bufferOverrun(); + // Check for "if (a=b)" checkOther.CheckIfAssignment();