Update message

This commit is contained in:
Paul 2020-06-24 18:09:30 -05:00
parent f7029e62ac
commit 3c10a9c659
2 changed files with 3 additions and 3 deletions

View File

@ -2417,7 +2417,7 @@ void CheckStl::globalLockGuardError(const Token* tok)
{ {
reportError(tok, Severity::warning, reportError(tok, Severity::warning,
"globalLockGuard", "globalLockGuard",
"The lock guard won't unlock until the end of the program which could lead to a deadlock.", CWE833, false); "Lock guard is defined globally. Lock guards are intended to be local. A global lock guard could lead to a deadlock since it won't unlock until the end of the program.", CWE833, false);
} }
void CheckStl::localMutexError(const Token* tok) void CheckStl::localMutexError(const Token* tok)

View File

@ -4420,7 +4420,7 @@ private:
" static std::lock_guard<std::mutex> g(m);\n" " static std::lock_guard<std::mutex> g(m);\n"
"}\n", "}\n",
true); true);
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()); ASSERT_EQUALS("[test.cpp:3]: (warning) Lock guard is defined globally. Lock guards are intended to be local. A global lock guard could lead to a deadlock since it won't unlock until the end of the program.\n", errout.str());
check("void f() {\n" check("void f() {\n"
" static std::mutex m;\n" " static std::mutex m;\n"
@ -4484,7 +4484,7 @@ private:
" }\n" " }\n"
"};\n", "};\n",
true); true);
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()); ASSERT_EQUALS("[test.cpp:4]: (warning) Lock guard is defined globally. Lock guards are intended to be local. A global lock guard could lead to a deadlock since it won't unlock until the end of the program.\n", errout.str());
check("std::mutex& h();\n" check("std::mutex& h();\n"
"void f() {\n" "void f() {\n"