diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index f84233997..b64676aaf 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -255,6 +255,11 @@ int CppCheckExecutor::check(int argc, const char* const argv[]) void CppCheckExecutor::reportErr(const std::string &errmsg) { + // Alert only about unique errors + if (std::find(_errorList.begin(), _errorList.end(), errmsg) != _errorList.end()) + return; + + _errorList.push_back(errmsg); std::cerr << errmsg << std::endl; } diff --git a/cli/cppcheckexecutor.h b/cli/cppcheckexecutor.h index b507917b6..e56491fd2 100644 --- a/cli/cppcheckexecutor.h +++ b/cli/cppcheckexecutor.h @@ -107,6 +107,11 @@ protected: private: + /** + * Used to filter out duplicate error messages. + */ + std::list _errorList; + /** * Report progress time */