Hello, the following minimal example code gives the warning: "Variable 'lock' is assigned a value that is never used CppCheck(unreadVariable)" warning. In my opinion this is a false positive, as this is a valid RAII usage of a mutex lock guard. #include <mutex> std::mutex mutex; std::lock_guard<std::mutex> lock_raii() { return std::lock_guard<std::mutex>(mutex); } void test() { { auto lock = lock_raii(); // THIS LINE GIVES THE WARNING // some protected code } } What do you think? Regards, Frank