Skip to content

Commit 3185783

Browse files
committed
CheckUnusedFunctions: added dedicated getErrorMessages()
1 parent cae6719 commit 3185783

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
@@ -1677,6 +1677,7 @@ void CppCheck::getErrorMessages(ErrorLogger &errorlogger)
16771677
for (std::list<Check *>::const_iterator it = Check::instances().cbegin(); it != Check::instances().cend(); ++it)
16781678
(*it)->getErrorMessages(&errorlogger, &s);
16791679

1680+
CheckUnusedFunctions::getErrorMessages(&errorlogger);
16801681
Preprocessor::getErrorMessages(&errorlogger, s);
16811682
}
16821683

0 commit comments

Comments
 (0)