diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index aeb98fe86..9b8a4226d 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -1846,7 +1846,6 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, }; #endif -#ifdef VERIFY_UNINIT // This is highly experimental std::function uninit = [=](const Token *tok, const ExprEngine::Value &value, ExprEngine::DataBase *dataBase) { if (!tok->astParent()) return; @@ -1865,7 +1864,6 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, "verificationUninit", "Cannot determine that '" + tok->expressionString() + "' is initialized", CWE_USE_OF_UNINITIALIZED_VARIABLE, false); errorLogger->reportErr(errmsg); }; -#endif std::function checkFunctionCall = [=](const Token *tok, const ExprEngine::Value &value, ExprEngine::DataBase *dataBase) { if (!Token::Match(tok->astParent(), "[(,]")) @@ -1966,7 +1964,6 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, } // Uninitialized function argument.. -#ifdef VERIFY_UNINIT // This is highly experimental if (settings->library.isuninitargbad(parent->astOperand1(), num) && settings->library.isnullargbad(parent->astOperand1(), num) && value.type == ExprEngine::ValueType::ArrayValue) { const ExprEngine::ArrayValue &arrayValue = static_cast(value); auto index0 = std::make_shared("0", 0, 0); @@ -1980,7 +1977,6 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, } } } -#endif }; std::vector callbacks; @@ -1989,9 +1985,7 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, #ifdef VERIFY_INTEGEROVERFLOW callbacks.push_back(integerOverflow); #endif -#ifdef VERIFY_UNINIT callbacks.push_back(uninit); -#endif std::ostringstream report; ExprEngine::executeAllFunctions(tokenizer, settings, callbacks, report); diff --git a/man/manual.md b/man/manual.md index 6b2bf3c2e..b6826398f 100644 --- a/man/manual.md +++ b/man/manual.md @@ -737,10 +737,6 @@ The focus will be to detect "hidden" bugs. Good candidates are undefined behavio make USE_Z3=yes -To get experimental checking for uninitialized data: - -make USE_Z3=yes CPPFLAGS=-DVERIFY_UNINIT - ## Verification for work-in-progress It is possible to instantly verify your code changes directly in your editor. diff --git a/test/testsuites/danmar-verify/uninit.c b/test/testsuites/danmar-verify/uninit.c index ab73d26d8..3eeadd528 100644 --- a/test/testsuites/danmar-verify/uninit.c +++ b/test/testsuites/danmar-verify/uninit.c @@ -1,5 +1,5 @@ -// make USE_Z3=yes CPPFLAGS=-DVERIFY_UNININIT +// make USE_Z3=yes // ./cppcheck --verify --inline-suppr --enable=information test/testsuites/danmar-verify/uninit.c int array1() {