Update text and change to warnings

This commit is contained in:
Paul 2020-06-16 10:32:39 -05:00
parent 7c9144ea47
commit 18225ee27e
2 changed files with 7 additions and 7 deletions

View File

@ -2408,16 +2408,16 @@ static bool isLockGuard(const Variable* var)
void CheckStl::globalLockGuardError(const Token* tok)
{
reportError(tok, Severity::error,
reportError(tok, Severity::warning,
"globalLockGuard",
"The lock guard won't unlock until the end of the program which could lead to a deadlock.", CWE833, false);
}
void CheckStl::localMutexError(const Token* tok)
{
reportError(tok, Severity::error,
reportError(tok, Severity::warning,
"localMutex",
"The mutex is locked at the same scope as the mutex itself.", CWE667, false);
"The lock is ineffective because the mutex is locked at the same scope as the mutex itself.", CWE667, false);
}
void CheckStl::checkMutexes()

View File

@ -4420,7 +4420,7 @@ private:
" static std::lock_guard<std::mutex> g(m);\n"
"}\n",
true);
ASSERT_EQUALS("[test.cpp:3]: (error) The lock guard won't unlock until the end of the program which could lead to a deadlock.\n", errout.str());
ASSERT_EQUALS("[test.cpp:3]: (warning) The lock guard won't unlock until the end of the program which could lead to a deadlock.\n", errout.str());
check("void f() {\n"
" static std::mutex m;\n"
@ -4434,7 +4434,7 @@ private:
" std::lock_guard<std::mutex> g(m);\n"
"}\n",
true);
ASSERT_EQUALS("[test.cpp:3]: (error) The mutex is locked at the same scope as the mutex itself.\n", errout.str());
ASSERT_EQUALS("[test.cpp:3]: (warning) The lock is ineffective because the mutex is locked at the same scope as the mutex itself.\n", errout.str());
check("void g();\n"
"void f() {\n"
@ -4454,7 +4454,7 @@ private:
" m.unlock();\n"
"}\n",
true);
ASSERT_EQUALS("[test.cpp:4]: (error) The mutex is locked at the same scope as the mutex itself.\n", errout.str());
ASSERT_EQUALS("[test.cpp:4]: (warning) The lock is ineffective because the mutex is locked at the same scope as the mutex itself.\n", errout.str());
check("class A {\n"
" std::mutex m;\n"
@ -4484,7 +4484,7 @@ private:
" }\n"
"};\n",
true);
ASSERT_EQUALS("[test.cpp:4]: (error) The lock guard won't unlock until the end of the program which could lead to a deadlock.\n", errout.str());
ASSERT_EQUALS("[test.cpp:4]: (warning) The lock guard won't unlock until the end of the program which could lead to a deadlock.\n", errout.str());
}
};