From 3dc34f151572fd61f6924a3a49cc3e06770ee7f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 16 Mar 2019 09:17:50 +0100 Subject: [PATCH] Disable all simplified checks --- lib/check.h | 6 +----- lib/check64bit.h | 7 ------- lib/checkassert.h | 7 ------- lib/checkautovariables.h | 6 ------ lib/checkbool.h | 7 ------- lib/checkboost.h | 7 ------- lib/checkbufferoverrun.h | 6 ------ lib/checkclass.h | 8 -------- lib/checkcondition.h | 7 ------- lib/checkexceptionsafety.h | 6 ------ lib/checkfunctions.h | 5 ----- lib/checkinternal.h | 7 ------- lib/checkio.h | 6 ------ lib/checkleakautovar.h | 3 +-- lib/checkmemoryleak.h | 9 ++++----- lib/checknullpointer.h | 5 ----- lib/checkother.h | 9 --------- lib/checkpostfixoperator.h | 2 -- lib/checksizeof.h | 4 ---- lib/checkstl.h | 9 --------- lib/checkstring.h | 7 ------- lib/checktype.h | 7 ------- lib/checkuninitvar.h | 7 ------- lib/checkunusedfunctions.h | 8 ++------ lib/checkunusedvar.h | 7 ------- lib/checkvaarg.h | 2 +- lib/cppcheck.cpp | 13 ------------- test/testcondition.cpp | 2 -- test/testfunctions.cpp | 8 +------- test/testgarbage.cpp | 4 ---- test/testleakautovar.cpp | 10 ++++------ test/testnullpointer.cpp | 11 +---------- test/testother.cpp | 7 +------ test/teststl.cpp | 6 +----- test/teststring.cpp | 3 --- test/testvaarg.cpp | 4 ++-- 36 files changed, 19 insertions(+), 213 deletions(-) diff --git a/lib/check.h b/lib/check.h index b9c6b0a0a..82ad4c5e1 100644 --- a/lib/check.h +++ b/lib/check.h @@ -68,11 +68,7 @@ public: static std::list &instances(); /** run checks, the token list is not simplified */ - virtual void runChecks(const Tokenizer *, const Settings *, ErrorLogger *) { - } - - /** run checks, the token list is simplified */ - virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) = 0; + virtual void runChecks(const Tokenizer *, const Settings *, ErrorLogger *) = 0; /** get error messages */ virtual void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const = 0; diff --git a/lib/check64bit.h b/lib/check64bit.h index 44fee93fc..521c3502c 100644 --- a/lib/check64bit.h +++ b/lib/check64bit.h @@ -57,13 +57,6 @@ public: check64BitPortability.pointerassignment(); } - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** Check for pointer assignment */ void pointerassignment(); diff --git a/lib/checkassert.h b/lib/checkassert.h index e0e53358c..21ada9bf6 100644 --- a/lib/checkassert.h +++ b/lib/checkassert.h @@ -55,13 +55,6 @@ public: checkAssert.assertWithSideEffects(); } - - virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - void assertWithSideEffects(); protected: diff --git a/lib/checkautovariables.h b/lib/checkautovariables.h index 6f831c5c5..ba28c6797 100644 --- a/lib/checkautovariables.h +++ b/lib/checkautovariables.h @@ -57,12 +57,6 @@ public: checkAutoVariables.autoVariables(); } - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** assign function argument */ void assignFunctionArg(); diff --git a/lib/checkbool.h b/lib/checkbool.h index 427cf10ed..177e93125 100644 --- a/lib/checkbool.h +++ b/lib/checkbool.h @@ -66,13 +66,6 @@ public: checkBool.checkBitwiseOnBoolean(); } - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** @brief %Check for comparison of function returning bool*/ void checkComparisonOfFuncReturningBool(); diff --git a/lib/checkboost.h b/lib/checkboost.h index d365a6b74..b8a3fab01 100644 --- a/lib/checkboost.h +++ b/lib/checkboost.h @@ -57,13 +57,6 @@ public: checkBoost.checkBoostForeachModification(); } - /** Simplified checks. The token list is simplified. */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** @brief %Check for container modification while using the BOOST_FOREACH macro */ void checkBoostForeachModification(); diff --git a/lib/checkbufferoverrun.h b/lib/checkbufferoverrun.h index 5fad53add..ebf774b71 100644 --- a/lib/checkbufferoverrun.h +++ b/lib/checkbufferoverrun.h @@ -67,12 +67,6 @@ public: checkBufferOverrun.stringNotZeroTerminated(); } - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { CheckBufferOverrun c(nullptr, settings, errorLogger); c.arrayIndexError(nullptr, nullptr, nullptr); diff --git a/lib/checkclass.h b/lib/checkclass.h index 648fa02b5..dae23cfdf 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -81,14 +81,6 @@ public: checkClass.checkOverride(); } - /** @brief Run checks on the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - - /** @brief %Check that all class constructors are ok */ void constructors(); diff --git a/lib/checkcondition.h b/lib/checkcondition.h index f8c22a6bc..421ac0688 100644 --- a/lib/checkcondition.h +++ b/lib/checkcondition.h @@ -67,13 +67,6 @@ public: checkCondition.checkModuloAlwaysTrueFalse(); } - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** mismatching assignment / comparison */ void assignIf(); diff --git a/lib/checkexceptionsafety.h b/lib/checkexceptionsafety.h index 2999e1441..76884b61a 100644 --- a/lib/checkexceptionsafety.h +++ b/lib/checkexceptionsafety.h @@ -74,12 +74,6 @@ public: checkExceptionSafety.unhandledExceptionSpecification(); } - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** Don't throw exceptions in destructors */ void destructors(); diff --git a/lib/checkfunctions.h b/lib/checkfunctions.h index 4d74237a7..b4b093ab5 100644 --- a/lib/checkfunctions.h +++ b/lib/checkfunctions.h @@ -66,11 +66,6 @@ public: // --check-library : functions with nonmatching configuration checkFunctions.checkLibraryMatchFunctions(); - } - - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - CheckFunctions checkFunctions(tokenizer, settings, errorLogger); checkFunctions.checkProhibitedFunctions(); checkFunctions.invalidFunctionUsage(); diff --git a/lib/checkinternal.h b/lib/checkinternal.h index 4db6b2e1b..28d0800bc 100644 --- a/lib/checkinternal.h +++ b/lib/checkinternal.h @@ -59,13 +59,6 @@ public: checkInternal.checkStlUsage(); } - /** Simplified checks. The token list is simplified. */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** @brief %Check if a simple pattern is used inside Token::Match or Token::findmatch */ void checkTokenMatchPatterns(); diff --git a/lib/checkio.h b/lib/checkio.h index da2e6a1bb..c42cc642f 100644 --- a/lib/checkio.h +++ b/lib/checkio.h @@ -54,12 +54,6 @@ public: CheckIO checkIO(tokenizer, settings, errorLogger); checkIO.checkWrongPrintfScanfArguments(); - } - - /** @brief Run checks on the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - CheckIO checkIO(tokenizer, settings, errorLogger); - checkIO.checkCoutCerrMisusage(); checkIO.checkFileUsage(); checkIO.invalidScanf(); diff --git a/lib/checkleakautovar.h b/lib/checkleakautovar.h index ef81f23be..2b4ab49dd 100644 --- a/lib/checkleakautovar.h +++ b/lib/checkleakautovar.h @@ -103,8 +103,7 @@ public: : Check(myName(), tokenizer, settings, errorLogger) { } - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { CheckLeakAutoVar checkLeakAutoVar(tokenizer, settings, errorLogger); checkLeakAutoVar.check(); } diff --git a/lib/checkmemoryleak.h b/lib/checkmemoryleak.h index 4eb082852..398b18302 100644 --- a/lib/checkmemoryleak.h +++ b/lib/checkmemoryleak.h @@ -183,8 +183,7 @@ public: : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) { } - /** @brief run all simplified checks */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { CheckMemoryLeakInFunction checkMemoryLeak(tokenizer, settings, errorLogger); checkMemoryLeak.checkReallocUsage(); } @@ -245,7 +244,7 @@ public: : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) { } - void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) OVERRIDE { + void runChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) OVERRIDE { if (!tokenizr->isCPP()) return; @@ -292,7 +291,7 @@ public: : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) { } - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { CheckMemoryLeakStructMember checkMemoryLeak(tokenizer, settings, errorLogger); checkMemoryLeak.check(); } @@ -331,7 +330,7 @@ public: : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) { } - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { CheckMemoryLeakNoVar checkMemoryLeak(tokenizer, settings, errorLogger); checkMemoryLeak.check(); } diff --git a/lib/checknullpointer.h b/lib/checknullpointer.h index 6916727cd..ef7057a37 100644 --- a/lib/checknullpointer.h +++ b/lib/checknullpointer.h @@ -59,11 +59,6 @@ public: CheckNullPointer checkNullPointer(tokenizer, settings, errorLogger); checkNullPointer.nullPointer(); checkNullPointer.arithmetic(); - } - - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - CheckNullPointer checkNullPointer(tokenizer, settings, errorLogger); checkNullPointer.nullConstantDereference(); } diff --git a/lib/checkother.h b/lib/checkother.h index 710b7c2d7..613c28496 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -91,18 +91,9 @@ public: checkOther.checkPassByReference(); checkOther.checkComparisonFunctionIsAlwaysTrueOrFalse(); checkOther.checkInvalidFree(); - } - - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - CheckOther checkOther(tokenizer, settings, errorLogger); - - // Checks checkOther.clarifyStatement(); checkOther.checkCastIntToCharAndBack(); - checkOther.checkMisusedScopedObject(); - checkOther.checkAccessOfMovedVariable(); } diff --git a/lib/checkpostfixoperator.h b/lib/checkpostfixoperator.h index a802f6203..232e22a76 100644 --- a/lib/checkpostfixoperator.h +++ b/lib/checkpostfixoperator.h @@ -57,8 +57,6 @@ public: CheckPostfixOperator checkPostfixOperator(tokenizer, settings, errorLogger); checkPostfixOperator.postfixOperator(); } - void runSimplifiedChecks(const Tokenizer * /*tokenizer*/, const Settings * /*settings*/, ErrorLogger * /*errorLogger*/) OVERRIDE { - } /** Check postfix operators */ void postfixOperator(); diff --git a/lib/checksizeof.h b/lib/checksizeof.h index f9be8bca4..8e5ce2051 100644 --- a/lib/checksizeof.h +++ b/lib/checksizeof.h @@ -64,10 +64,6 @@ public: checkSizeof.sizeofVoid(); } - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer* /*tokenizer*/, const Settings* /*settings*/, ErrorLogger* /*errorLogger*/) OVERRIDE { - } - /** @brief %Check for 'sizeof sizeof ..' */ void sizeofsizeof(); diff --git a/lib/checkstl.h b/lib/checkstl.h index 839406495..7c558e342 100644 --- a/lib/checkstl.h +++ b/lib/checkstl.h @@ -72,15 +72,6 @@ public: checkStl.string_c_str(); checkStl.uselessCalls(); checkStl.useStlAlgorithm(); - } - - /** Simplified checks. The token list is simplified. */ - void runSimplifiedChecks(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) OVERRIDE { - if (!tokenizer->isCPP()) { - return; - } - - CheckStl checkStl(tokenizer, settings, errorLogger); checkStl.stlOutOfBounds(); checkStl.negativeIndex(); diff --git a/lib/checkstring.h b/lib/checkstring.h index cbd2b5bc6..d878b4783 100644 --- a/lib/checkstring.h +++ b/lib/checkstring.h @@ -63,13 +63,6 @@ public: checkString.checkAlwaysTrueOrFalseStringCompare(); } - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** @brief undefined behaviour, writing string literal */ void stringLiteralWrite(); diff --git a/lib/checktype.h b/lib/checktype.h index e870021ea..3776a5961 100644 --- a/lib/checktype.h +++ b/lib/checktype.h @@ -59,13 +59,6 @@ public: checkType.checkFloatToIntegerOverflow(); } - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** @brief %Check for bitwise shift with too big right operand */ void checkTooBigBitwiseShift(); diff --git a/lib/checkuninitvar.h b/lib/checkuninitvar.h index bf865e329..c88361238 100644 --- a/lib/checkuninitvar.h +++ b/lib/checkuninitvar.h @@ -68,13 +68,6 @@ public: checkUninitVar.valueFlowUninit(); } - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** Check for uninitialized variables */ void check(); void checkScope(const Scope* scope, const std::set &arrayTypeDefs); diff --git a/lib/checkunusedfunctions.h b/lib/checkunusedfunctions.h index 191a06500..3eb09ac5a 100644 --- a/lib/checkunusedfunctions.h +++ b/lib/checkunusedfunctions.h @@ -83,6 +83,8 @@ private: c.unusedFunctionError(errorLogger, emptyString, 0, "funcName"); } + void runChecks(const Tokenizer * /*tokenizer*/, const Settings * /*settings*/, ErrorLogger * /*errorLogger*/) OVERRIDE {} + /** * Dummy implementation, just to provide error for --errorlist */ @@ -90,12 +92,6 @@ private: const std::string &filename, unsigned int lineNumber, const std::string &funcname); - /** - * Dummy implementation, just to provide error for --errorlist - */ - void runSimplifiedChecks(const Tokenizer* /*tokenizer*/, const Settings* /*settings*/, ErrorLogger* /*errorLogger*/) OVERRIDE { - } - static std::string myName() { return "Unused functions"; } diff --git a/lib/checkunusedvar.h b/lib/checkunusedvar.h index 469479cf3..db330932b 100644 --- a/lib/checkunusedvar.h +++ b/lib/checkunusedvar.h @@ -61,13 +61,6 @@ public: checkUnusedVar.checkFunctionVariableUsage(); } - /** @brief Run checks against the simplified token list */ - void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { - (void)tokenizer; - (void)settings; - (void)errorLogger; - } - /** @brief %Check for unused function variables */ void checkFunctionVariableUsage_iterateScopes(const Scope* const scope, Variables& variables); void checkFunctionVariableUsage(); diff --git a/lib/checkvaarg.h b/lib/checkvaarg.h index 2402d0d55..c32c451f6 100644 --- a/lib/checkvaarg.h +++ b/lib/checkvaarg.h @@ -48,7 +48,7 @@ public: : Check(myName(), tokenizer, settings, errorLogger) { } - virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + virtual void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { CheckVaarg check(tokenizer, settings, errorLogger); check.va_start_argument(); check.va_list_usage(); diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index aaada68da..572df2a91 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -610,19 +610,6 @@ void CppCheck::checkNormalTokens(const Tokenizer &tokenizer) void CppCheck::checkSimplifiedTokens(const Tokenizer &tokenizer) { - // call all "runSimplifiedChecks" in all registered Check classes - for (std::list::const_iterator it = Check::instances().begin(); it != Check::instances().end(); ++it) { - if (mSettings.terminated()) - return; - - if (tokenizer.isMaxTime()) - return; - - Timer timerSimpleChecks((*it)->name() + "::runSimplifiedChecks", mSettings.showtime, &S_timerResults); - (*it)->runSimplifiedChecks(&tokenizer, &mSettings, this); - timerSimpleChecks.Stop(); - } - if (!mSettings.terminated()) executeRules("simple", tokenizer); } diff --git a/test/testcondition.cpp b/test/testcondition.cpp index fd25ab3f0..b6ff92d1c 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -515,8 +515,6 @@ private: CheckCondition checkCondition; checkCondition.runChecks(&tokenizer, &settings1, this); - tokenizer.simplifyTokenList2(); - checkCondition.runSimplifiedChecks(&tokenizer, &settings1, this); } void duplicateIf() { diff --git a/test/testfunctions.cpp b/test/testfunctions.cpp index 5aefb423c..7f3b630e0 100644 --- a/test/testfunctions.cpp +++ b/test/testfunctions.cpp @@ -62,7 +62,7 @@ private: // Invalid function usage TEST_CASE(invalidFunctionUsage1); - TEST_CASE(invalidFunctionUsageStrings); + // TODO TEST_CASE(invalidFunctionUsageStrings); // Math function usage TEST_CASE(mathfunctionCall_fmod); @@ -96,12 +96,6 @@ private: CheckFunctions checkFunctions(&tokenizer, settings_, this); checkFunctions.runChecks(&tokenizer, settings_, this); - - // Simplify... - tokenizer.simplifyTokenList2(); - - // Check... - checkFunctions.runSimplifiedChecks(&tokenizer, settings_, this); } void prohibitedFunctions_posix() { diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 11366cd79..208732dfd 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -277,10 +277,6 @@ private: } tokenizer.simplifyTokenList2(); - // call all "runSimplifiedChecks" in all registered Check classes - for (std::list::const_iterator it = Check::instances().begin(); it != Check::instances().end(); ++it) { - (*it)->runSimplifiedChecks(&tokenizer, &settings, this); - } return tokenizer.tokens()->stringifyList(false, false, false, true, false, 0, 0); } diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index 41a8cf86a..96bbab932 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -54,14 +54,14 @@ private: TEST_CASE(assign10); TEST_CASE(assign11); // #3942: x = a(b(p)); TEST_CASE(assign12); // #4236: FP. bar(&x); - TEST_CASE(assign13); // #4237: FP. char*&ref=p; p=malloc(10); free(ref); + // TODO TEST_CASE(assign13); // #4237: FP. char*&ref=p; p=malloc(10); free(ref); TEST_CASE(assign14); TEST_CASE(deallocuse1); TEST_CASE(deallocuse2); TEST_CASE(deallocuse3); TEST_CASE(deallocuse4); - TEST_CASE(deallocuse5); // #4018: FP. free(p), p = 0; + // TODO TEST_CASE(deallocuse5); // #4018: FP. free(p), p = 0; TEST_CASE(deallocuse6); // #4034: FP. x = p = f(); TEST_CASE(deallocuse7); // #6467, #6469, #6473 @@ -157,13 +157,12 @@ private: Tokenizer tokenizer(&settings, this); std::istringstream istr(code); tokenizer.tokenize(istr, cpp?"test.cpp":"test.c"); - tokenizer.simplifyTokenList2(); // Check for leaks.. CheckLeakAutoVar c; settings.checkLibrary = true; settings.addEnabled("information"); - c.runSimplifiedChecks(&tokenizer, &settings, this); + c.runChecks(&tokenizer, &settings, this); } void assign1() { @@ -1649,11 +1648,10 @@ private: Tokenizer tokenizer(&settings, this); std::istringstream istr(code); tokenizer.tokenize(istr, "test.c"); - tokenizer.simplifyTokenList2(); // Check for leaks.. CheckLeakAutoVar checkLeak; - checkLeak.runSimplifiedChecks(&tokenizer, &settings, this); + checkLeak.runChecks(&tokenizer, &settings, this); } void run() OVERRIDE { diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 9424fadd7..d70d8a719 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -128,10 +128,6 @@ private: // Check for null pointer dereferences.. CheckNullPointer checkNullPointer; checkNullPointer.runChecks(&tokenizer, &settings, this); - - tokenizer.simplifyTokenList2(); - - checkNullPointer.runSimplifiedChecks(&tokenizer, &settings, this); } void checkP(const char code[]) { @@ -158,10 +154,6 @@ private: // Check for null pointer dereferences.. CheckNullPointer checkNullPointer; checkNullPointer.runChecks(&tokenizer, &settings, this); - - tokenizer.simplifyTokenList2(); - - checkNullPointer.runSimplifiedChecks(&tokenizer, &settings, this); } @@ -1433,8 +1425,7 @@ private: " }\n" " return p;\n" "}", true); - ASSERT_EQUALS("[test.cpp:7]: (warning) Possible null pointer dereference: p\n" - "[test.cpp:7]: (error) Null pointer dereference\n", errout.str()); + ASSERT_EQUALS("[test.cpp:7]: (warning) Possible null pointer dereference: p\n", errout.str()); } void nullpointer_cast() { // #4692 diff --git a/test/testother.cpp b/test/testother.cpp index 1f3014ad1..71758d708 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -254,10 +254,7 @@ private: CheckOther checkOther(&tokenizer, settings, this); checkOther.runChecks(&tokenizer, settings, this); - if (runSimpleChecks) { - tokenizer.simplifyTokenList2(); - checkOther.runSimplifiedChecks(&tokenizer, settings, this); - } + (void)runSimpleChecks; // TODO Remove this } void check(const char code[], Settings *s) { @@ -296,8 +293,6 @@ private: // Check.. CheckOther checkOther(&tokenizer, settings, this); checkOther.runChecks(&tokenizer, settings, this); - tokenizer.simplifyTokenList2(); - checkOther.runSimplifiedChecks(&tokenizer, settings, this); } void checkposix(const char code[]) { diff --git a/test/teststl.cpp b/test/teststl.cpp index 8e126cafb..087d3857c 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -174,12 +174,8 @@ private: tokenizer.tokenize(istr, "test.cpp"); checkStl.runChecks(&tokenizer, &settings, this); - - tokenizer.simplifyTokenList2(); - - // Check.. - checkStl.runSimplifiedChecks(&tokenizer, &settings, this); } + void check(const std::string &code, const bool inconclusive=false) { check(code.c_str(), inconclusive); } diff --git a/test/teststring.cpp b/test/teststring.cpp index c3fd02614..c27f7f54f 100644 --- a/test/teststring.cpp +++ b/test/teststring.cpp @@ -67,9 +67,6 @@ private: // Check char variable usage.. CheckString checkString(&tokenizer, &settings, this); checkString.runChecks(&tokenizer, &settings, this); - - tokenizer.simplifyTokenList2(); - checkString.runSimplifiedChecks(&tokenizer, &settings, this); } void stringLiteralWrite() { diff --git a/test/testvaarg.cpp b/test/testvaarg.cpp index a11ac9c8c..8c82c3647 100644 --- a/test/testvaarg.cpp +++ b/test/testvaarg.cpp @@ -40,8 +40,8 @@ private: tokenizer.tokenize(istr, "test.cpp"); // Check.. - CheckVaarg checkVaarg(&tokenizer, &settings, this); - checkVaarg.runSimplifiedChecks(&tokenizer, &settings, this); + CheckVaarg checkVaarg; + checkVaarg.runChecks(&tokenizer, &settings, this); } void run() OVERRIDE {