From 3c10a9c659a7c0005fe1d96093cd3fec605e3b73 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 24 Jun 2020 18:09:30 -0500 Subject: [PATCH] Update message --- lib/checkstl.cpp | 2 +- test/teststl.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 86d768953..6d51bd928 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -2417,7 +2417,7 @@ void CheckStl::globalLockGuardError(const Token* tok) { 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); + "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) diff --git a/test/teststl.cpp b/test/teststl.cpp index 6d2fcb093..bec982336 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -4420,7 +4420,7 @@ private: " static std::lock_guard g(m);\n" "}\n", 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" " static std::mutex m;\n" @@ -4484,7 +4484,7 @@ private: " }\n" "};\n", 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" "void f() {\n"