Skip to content

Commit dc094c3

Browse files
committed
CheckUnusedFunctions: added dedicated getErrorMessages()
1 parent d0a02bb commit dc094c3

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/checkunusedfunctions.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,14 @@ class CPPCHECKLIB CheckUnusedFunctions : public Check {
7676
/** @brief Combine and analyze all analyzerInfos for all TUs */
7777
static void analyseWholeProgram(const Settings &settings, ErrorLogger * const errorLogger, const std::string &buildDir);
7878

79+
static void getErrorMessages(ErrorLogger *errorLogger) {
80+
unusedFunctionError(errorLogger, emptyString, 0, 0, "funcName");
81+
}
82+
7983
private:
8084
static void clear();
8185

82-
void getErrorMessages(ErrorLogger *errorLogger, const Settings * /*settings*/) const override {
83-
CheckUnusedFunctions::unusedFunctionError(errorLogger, emptyString, 0, 0, "funcName");
84-
}
86+
void getErrorMessages(ErrorLogger */*errorLogger*/, const Settings * /*settings*/) const override {}
8587

8688
void runChecks(const Tokenizer & /*tokenizer*/, ErrorLogger * /*errorLogger*/) override {}
8789

lib/cppcheck.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,7 @@ void CppCheck::getErrorMessages(ErrorLogger &errorlogger)
16821682
for (std::list<Check *>::const_iterator it = Check::instances().cbegin(); it != Check::instances().cend(); ++it)
16831683
(*it)->getErrorMessages(&errorlogger, &s);
16841684

1685+
CheckUnusedFunctions::getErrorMessages(&errorlogger);
16851686
Preprocessor::getErrorMessages(&errorlogger, s);
16861687
}
16871688

0 commit comments

Comments
 (0)