From 9d57b832b81a6ae3ca431b585b6cfd1bbdf6901b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Thu, 24 Dec 2020 20:09:11 +0100 Subject: [PATCH] fixed passedByValue warning hidden by suppression for false positive (#2974) --- cli/cppcheckexecutor.cpp | 2 +- cli/cppcheckexecutor.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 48a5663ad..14b3cdeb7 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -1170,7 +1170,7 @@ bool CppCheckExecutor::tryLoadLibrary(Library& destination, const char* basepath * Execute a shell command and read the output from it. Returns true if command terminated successfully. */ // cppcheck-suppress passedByValue -bool CppCheckExecutor::executeCommand(std::string exe, std::vector args, std::string redirect, std::string *output) +bool CppCheckExecutor::executeCommand(std::string exe, std::vector args, const std::string &redirect, std::string *output) { output->clear(); diff --git a/cli/cppcheckexecutor.h b/cli/cppcheckexecutor.h index ca3a09aac..63d853598 100644 --- a/cli/cppcheckexecutor.h +++ b/cli/cppcheckexecutor.h @@ -111,7 +111,7 @@ public: /** * Execute a shell command and read the output from it. Returns true if command terminated successfully. */ - static bool executeCommand(std::string exe, std::vector args, std::string redirect, std::string *output); + static bool executeCommand(std::string exe, std::vector args, const std::string &redirect, std::string *output); protected: