Fix override warnings. (#1234)

This commit is contained in:
IOBYTE 2018-05-15 10:37:40 -04:00 committed by Daniel Marjamäki
parent 6bd4bdb0f9
commit ce50df8047
93 changed files with 204 additions and 204 deletions

View File

@ -69,17 +69,17 @@ public:
*
* @param outmsg Progress message e.g. "Checking main.cpp..."
*/
virtual void reportOut(const std::string &outmsg);
virtual void reportOut(const std::string &outmsg) override;
/** xml output of errors */
virtual void reportErr(const ErrorLogger::ErrorMessage &msg);
virtual void reportErr(const ErrorLogger::ErrorMessage &msg) override;
void reportProgress(const std::string &filename, const char stage[], const std::size_t value);
void reportProgress(const std::string &filename, const char stage[], const std::size_t value) override;
/**
* Output information messages.
*/
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg);
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg) override;
/**
* Information about how many files have been checked

View File

@ -49,9 +49,9 @@ public:
virtual ~ThreadExecutor();
unsigned int check();
virtual void reportOut(const std::string &outmsg);
virtual void reportErr(const ErrorLogger::ErrorMessage &msg);
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg);
virtual void reportOut(const std::string &outmsg) override;
virtual void reportErr(const ErrorLogger::ErrorMessage &msg) override;
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg) override;
/**
* @brief Add content to a file, to be used in unit testing.

View File

@ -42,23 +42,23 @@ public:
* @brief Create the report (file).
* @return true if succeeded, false if file could not be created.
*/
virtual bool create();
virtual bool create() override;
/**
* @brief Write report header.
*/
virtual void writeHeader();
virtual void writeHeader() override;
/**
* @brief Write report footer.
*/
virtual void writeFooter();
virtual void writeFooter() override;
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void writeError(const ErrorItem &error);
virtual void writeError(const ErrorItem &error) override;
private:

View File

@ -38,23 +38,23 @@ public:
* @brief Create the report (file).
* @return true if succeeded, false if file could not be created.
*/
virtual bool create();
virtual bool create() override;
/**
* @brief Write report header.
*/
virtual void writeHeader();
virtual void writeHeader() override;
/**
* @brief Write report footer.
*/
virtual void writeFooter();
virtual void writeFooter() override;
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void writeError(const ErrorItem &error);
virtual void writeError(const ErrorItem &error) override;
/**
* @brief Returns the formatted report.

View File

@ -31,8 +31,8 @@ private slots:
private:
// Empty implementations of ErrorLogger methods.
// We don't care about the output in the benchmark tests.
void reportOut(const std::string & outmsg) {
void reportOut(const std::string & outmsg) override {
}
void reportErr(const ErrorLogger::ErrorMessage &msg) {
void reportErr(const ErrorLogger::ErrorMessage &msg) override {
}
};

View File

@ -72,8 +72,8 @@ public:
/**
* ErrorLogger methods
*/
void reportOut(const std::string &outmsg);
void reportErr(const ErrorLogger::ErrorMessage &msg);
void reportOut(const std::string &outmsg) override;
void reportErr(const ErrorLogger::ErrorMessage &msg) override;
public slots:

View File

@ -42,23 +42,23 @@ public:
* @brief Create the report (file).
* @return true if succeeded, false if file could not be created.
*/
virtual bool create();
virtual bool create() override;
/**
* @brief Write report header.
*/
virtual void writeHeader();
virtual void writeHeader() override;
/**
* @brief Write report footer.
*/
virtual void writeFooter();
virtual void writeFooter() override;
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void writeError(const ErrorItem &error);
virtual void writeError(const ErrorItem &error) override;
private:

View File

@ -43,33 +43,33 @@ public:
* @brief Create the report (file).
* @return true if succeeded, false if file could not be created.
*/
virtual bool create();
virtual bool create() override;
/**
* @brief Open existing report file.
*/
bool open();
virtual bool open() override;
/**
* @brief Write report header.
*/
virtual void writeHeader();
virtual void writeHeader() override;
/**
* @brief Write report footer.
*/
virtual void writeFooter();
virtual void writeFooter() override;
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void writeError(const ErrorItem &error);
virtual void writeError(const ErrorItem &error) override;
/**
* @brief Read contents of the report file.
*/
virtual QList<ErrorItem> read();
virtual QList<ErrorItem> read() override;
protected:
/**

View File

@ -52,13 +52,13 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
Check64BitPortability check64BitPortability(tokenizer, settings, errorLogger);
check64BitPortability.pointerassignment();
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
(void)tokenizer;
(void)settings;
(void)errorLogger;
@ -74,7 +74,7 @@ private:
void returnIntegerError(const Token *tok);
void returnPointerError(const Token *tok);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
Check64BitPortability c(nullptr, settings, errorLogger);
c.assignmentAddressToIntegerError(nullptr);
c.assignmentIntegerToAddressError(nullptr);
@ -86,7 +86,7 @@ private:
return "64-bit portability";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Check if there is 64-bit portability issues:\n"
"- assign address to/from int/long\n"
"- casting address from/to integer when returning from function\n";

View File

@ -49,7 +49,7 @@ public:
: Check(myName(), tokenizer, settings, errorLogger) {
}
virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckAssert check(tokenizer, settings, errorLogger);
check.assertWithSideEffects();
}
@ -64,7 +64,7 @@ private:
void sideEffectInAssertError(const Token *tok, const std::string& functionName);
void assignmentInAssertError(const Token *tok, const std::string &varname);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckAssert c(nullptr, settings, errorLogger);
c.sideEffectInAssertError(nullptr, "function");
c.assignmentInAssertError(nullptr, "var");
@ -74,7 +74,7 @@ private:
return "Assert";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Warn if there are side effects in assert statements (since this cause different behaviour in debug/release builds).\n";
}
};

View File

@ -49,13 +49,13 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckAutoVariables checkAutoVariables(tokenizer, settings, errorLogger);
checkAutoVariables.assignFunctionArg();
checkAutoVariables.returnReference();
}
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckAutoVariables checkAutoVariables(tokenizer, settings, errorLogger);
checkAutoVariables.autoVariables();
checkAutoVariables.returnPointerToLocalArray();
@ -94,7 +94,7 @@ private:
void errorUselessAssignmentArg(const Token *tok);
void errorUselessAssignmentPtrArg(const Token *tok);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckAutoVariables c(nullptr,settings,errorLogger);
c.errorAutoVariableAssignment(nullptr, false);
c.errorReturnAddressToAutoVariable(nullptr);
@ -112,7 +112,7 @@ private:
return "Auto Variables";
}
std::string classInfo() const {
std::string classInfo() const override {
return "A pointer to a variable is only valid as long as the variable is in scope.\n"
"Check:\n"
"- returning a pointer to auto or temporary variable\n"

View File

@ -50,7 +50,7 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckBool checkBool(tokenizer, settings, errorLogger);
// Checks
@ -61,7 +61,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckBool checkBool(tokenizer, settings, errorLogger);
// Checks
@ -113,7 +113,7 @@ private:
void comparisonOfBoolExpressionWithIntError(const Token *tok, bool n0o1);
void pointerArithBoolError(const Token *tok);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckBool c(nullptr, settings, errorLogger);
c.assignBoolToPointerError(nullptr);
@ -131,7 +131,7 @@ private:
return "Boolean";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Boolean type checks\n"
"- using increment on boolean\n"
"- comparison of a boolean expression with an integer other than 0 or 1\n"

View File

@ -49,7 +49,7 @@ public:
}
/** Simplified checks. The token list is simplified. */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
if (!tokenizer->isCPP())
return;
@ -64,7 +64,7 @@ public:
private:
void boostForeachError(const Token *tok);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckBoost c(nullptr, settings, errorLogger);
c.boostForeachError(nullptr);
}
@ -73,7 +73,7 @@ private:
return "Boost usage";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Check for invalid usage of Boost:\n"
"- container modification during BOOST_FOREACH\n";
}

View File

@ -74,7 +74,7 @@ public:
, symbolDatabase(tokenizer?tokenizer->getSymbolDatabase():nullptr) {
}
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckBufferOverrun checkBufferOverrun(tokenizer, settings, errorLogger);
checkBufferOverrun.checkGlobalAndLocalVariable();
if (tokenizer && tokenizer->isMaxTime())
@ -86,7 +86,7 @@ public:
checkBufferOverrun.negativeArraySize();
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckBufferOverrun checkBufferOverrun(tokenizer, settings, errorLogger);
checkBufferOverrun.bufferOverrun();
checkBufferOverrun.checkStringArgument();
@ -223,7 +223,7 @@ public:
/* data for multifile checking */
class MyFileInfo : public Check::FileInfo {
public:
std::string toString() const;
std::string toString() const override;
struct ArrayUsage {
MathLib::bigint index;
@ -239,9 +239,9 @@ public:
};
/** @brief Parse current TU and extract file info */
Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const;
Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const override;
Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const;
Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const override;
/** @brief Analyse all file infos for all TU */
bool analyseWholeProgram(const std::list<Check::FileInfo*> &fileInfo, const Settings& settings, ErrorLogger &errorLogger);
@ -278,7 +278,7 @@ private:
void valueFlowCheckArrayIndex(const Token * const tok, const ArrayInfo &arrayInfo);
public:
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckBufferOverrun c(nullptr, settings, errorLogger);
const std::vector<MathLib::bigint> indexes(2, 1);
c.arrayIndexOutOfBoundsError(nullptr, ArrayInfo(0, "array", 1, 2), indexes);
@ -304,7 +304,7 @@ private:
return "Bounds checking";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Out of bounds checking:\n"
"- Array index out of bounds detection by value flow analysis\n"
"- Dangerous usage of strncat()\n"

View File

@ -53,7 +53,7 @@ public:
CheckClass(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger);
/** @brief Run checks on the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
if (tokenizer->isC())
return;
@ -65,7 +65,7 @@ public:
}
/** @brief Run checks on the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
if (tokenizer->isC())
return;
@ -198,7 +198,7 @@ private:
void unsafeClassDivZeroError(const Token *tok, const std::string &className, const std::string &methodName, const std::string &varName);
void overrideError(const Function *funcInBase, const Function *funcInDerived);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckClass c(nullptr, settings, errorLogger);
c.noConstructorError(nullptr, "classname", false);
c.noExplicitConstructorError(nullptr, "classname", false);
@ -239,7 +239,7 @@ private:
return "Class";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Check the code for each class.\n"
"- Missing constructors and copy constructors\n"
//"- Missing allocation of memory in copy constructor\n"

View File

@ -51,7 +51,7 @@ public:
: Check(myName(), tokenizer, settings, errorLogger) {
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckCondition checkCondition(tokenizer, settings, errorLogger);
checkCondition.multiCondition();
checkCondition.clarifyCondition(); // not simplified because ifAssign
@ -63,7 +63,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckCondition checkCondition(tokenizer, settings, errorLogger);
checkCondition.assignIf();
checkCondition.checkBadBitmaskCheck();
@ -149,7 +149,7 @@ private:
void invalidTestForOverflow(const Token* tok, bool result);
void pointerAdditionResultNotNullError(const Token *tok, const Token *calc);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckCondition c(nullptr, settings, errorLogger);
c.assignIfError(nullptr, nullptr, emptyString, false);
@ -173,7 +173,7 @@ private:
return "Condition";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Match conditions with assignments and other conditions:\n"
"- Mismatching assignment and comparison => comparison is always true/false\n"
"- Mismatching lhs and rhs in comparison => comparison is always true/false\n"

View File

@ -62,7 +62,7 @@ public:
}
/** Checks that uses the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
if (tokenizer->isC())
return;
@ -137,7 +137,7 @@ private:
}
/** Generate all possible errors (for --errorlist) */
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckExceptionSafety c(nullptr, settings, errorLogger);
c.destructorsError(nullptr, "Class");
c.deallocThrowError(nullptr, "p");
@ -153,7 +153,7 @@ private:
}
/** wiki formatted description of the class (for --doc) */
std::string classInfo() const {
std::string classInfo() const override {
return "Checking exception safety\n"
"- Throwing exceptions in destructors\n"
"- Throwing exception during invalid state\n"

View File

@ -58,7 +58,7 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckFunctions checkFunctions(tokenizer, settings, errorLogger);
// Checks
@ -69,7 +69,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckFunctions checkFunctions(tokenizer, settings, errorLogger);
checkFunctions.checkProhibitedFunctions();
@ -117,7 +117,7 @@ private:
void memsetFloatError(const Token *tok, const std::string &var_value);
void memsetValueOutOfRangeError(const Token *tok, const std::string &value);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckFunctions c(nullptr, settings, errorLogger);
for (std::map<std::string, Library::WarnInfo>::const_iterator i = settings->library.functionwarn.cbegin(); i != settings->library.functionwarn.cend(); ++i) {
@ -138,7 +138,7 @@ private:
return "Check function usage";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Check function usage:\n"
"- return value of certain functions not used\n"
"- invalid input values for functions\n"

View File

@ -44,7 +44,7 @@ public:
}
/** Simplified checks. The token list is simplified. */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
if (!settings->isEnabled(Settings::INTERNAL))
return;
@ -94,7 +94,7 @@ private:
void extraWhitespaceError(const Token *tok, const std::string &pattern, const std::string &funcname);
void checkRedundantTokCheckError(const Token *tok);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckInternal c(nullptr, settings, errorLogger);
c.multiComparePatternError(nullptr, ";|%type%", "Match");
c.simplePatternError(nullptr, "class {", "Match");
@ -111,7 +111,7 @@ private:
return "cppcheck internal API usage";
}
std::string classInfo() const {
std::string classInfo() const override {
// Don't include these checks on the WIKI where people can read what
// checks there are. These checks are not intended for users.
return "";

View File

@ -50,14 +50,14 @@ public:
}
/** @brief Run checks on the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckIO checkIO(tokenizer, settings, errorLogger);
checkIO.checkWrongPrintfScanfArguments();
}
/** @brief Run checks on the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckIO checkIO(tokenizer, settings, errorLogger);
checkIO.checkCoutCerrMisusage();
@ -139,7 +139,7 @@ private:
static void argumentType(std::ostream & os, const ArgumentInfo * argInfo);
static Severity::SeverityType getSeverity(const ArgumentInfo *argInfo);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckIO c(nullptr, settings, errorLogger);
c.coutCerrMisusageError(nullptr, "cout");
@ -169,7 +169,7 @@ private:
return "IO using format string";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Check format string input/output operations.\n"
"- Bad usage of the function 'sprintf' (overlapping data)\n"
"- Missing or wrong width specifiers in 'scanf' format string\n"

View File

@ -104,7 +104,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckLeakAutoVar checkLeakAutoVar(tokenizer, settings, errorLogger);
checkLeakAutoVar.check();
}
@ -140,7 +140,7 @@ private:
/** message: user configuration is needed to complete analysis */
void configurationInfo(const Token* tok, const std::string &functionName);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckLeakAutoVar c(nullptr, settings, errorLogger);
c.deallocReturnError(nullptr, "p");
c.configurationInfo(nullptr, "f"); // user configuration is needed to complete analysis
@ -151,7 +151,7 @@ private:
return "Leaks (auto variables)";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Detect when a auto variable is allocated but not deallocated or deallocated twice.\n";
}
};

View File

@ -195,7 +195,7 @@ public:
}
/** @brief run all simplified checks */
void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) {
void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) override {
CheckMemoryLeakInFunction checkMemoryLeak(tokenizr, settings, errLog);
checkMemoryLeak.checkReallocUsage();
checkMemoryLeak.check();
@ -288,7 +288,7 @@ public:
private:
/** Report all possible errors (for the --errorlist) */
void getErrorMessages(ErrorLogger *e, const Settings *settings) const {
void getErrorMessages(ErrorLogger *e, const Settings *settings) const override {
CheckMemoryLeakInFunction c(nullptr, settings, e);
c.memleakError(nullptr, "varname");
@ -314,7 +314,7 @@ private:
* Get class information (--doc)
* @return Wiki formatted information about this class
*/
std::string classInfo() const {
std::string classInfo() const override {
return "Is there any allocated memory when a function goes out of scope\n";
}
@ -336,7 +336,7 @@ public:
: Check(myName(), tokenizr, settings, errLog), CheckMemoryLeak(tokenizr, errLog, settings) {
}
void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) {
void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) override {
if (!tokenizr->isCPP())
return;
@ -355,7 +355,7 @@ private:
void unsafeClassError(const Token *tok, const std::string &classname, const std::string &varname);
void getErrorMessages(ErrorLogger *e, const Settings *settings) const {
void getErrorMessages(ErrorLogger *e, const Settings *settings) const override {
CheckMemoryLeakInClass c(nullptr, settings, e);
c.publicAllocationError(nullptr, "varname");
c.unsafeClassError(nullptr, "class", "class::varname");
@ -365,7 +365,7 @@ private:
return "Memory leaks (class variables)";
}
std::string classInfo() const {
std::string classInfo() const override {
return "If the constructor allocate memory then the destructor must deallocate it.\n";
}
};
@ -383,7 +383,7 @@ public:
: Check(myName(), tokenizr, settings, errLog), CheckMemoryLeak(tokenizr, errLog, settings) {
}
void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) {
void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) override {
CheckMemoryLeakStructMember checkMemoryLeak(tokenizr, settings, errLog);
checkMemoryLeak.check();
}
@ -397,14 +397,14 @@ private:
void checkStructVariable(const Variable * const variable);
void getErrorMessages(ErrorLogger * /*errorLogger*/, const Settings * /*settings*/) const {
void getErrorMessages(ErrorLogger * /*errorLogger*/, const Settings * /*settings*/) const override {
}
static std::string myName() {
return "Memory leaks (struct members)";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Don't forget to deallocate struct members\n";
}
};
@ -422,7 +422,7 @@ public:
: Check(myName(), tokenizr, settings, errLog), CheckMemoryLeak(tokenizr, errLog, settings) {
}
void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) {
void runSimplifiedChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) override {
CheckMemoryLeakNoVar checkMemoryLeak(tokenizr, settings, errLog);
checkMemoryLeak.check();
}
@ -446,7 +446,7 @@ private:
void returnValueNotUsedError(const Token* tok, const std::string &alloc);
void unsafeArgAllocError(const Token *tok, const std::string &funcName, const std::string &ptrType, const std::string &objType);
void getErrorMessages(ErrorLogger *e, const Settings *settings) const {
void getErrorMessages(ErrorLogger *e, const Settings *settings) const override {
CheckMemoryLeakNoVar c(nullptr, settings, e);
c.functionCallLeak(nullptr, "funcName", "funcName");
@ -458,7 +458,7 @@ private:
return "Memory leaks (address not taken)";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Not taking the address to allocated memory\n";
}
};

View File

@ -54,14 +54,14 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckNullPointer checkNullPointer(tokenizer, settings, errorLogger);
checkNullPointer.nullPointer();
checkNullPointer.arithmetic();
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckNullPointer checkNullPointer(tokenizer, settings, errorLogger);
checkNullPointer.nullConstantDereference();
}
@ -102,7 +102,7 @@ public:
private:
/** Get error messages. Used by --errorlist */
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckNullPointer c(nullptr, settings, errorLogger);
c.nullPointerError(nullptr, "pointer", nullptr, false);
c.arithmeticError(nullptr, nullptr);
@ -114,7 +114,7 @@ private:
}
/** class info in WIKI format. Used by --doc */
std::string classInfo() const {
std::string classInfo() const override {
return "Null pointers\n"
"- null pointer dereferencing\n"
"- undefined null pointer arithmetic\n";

View File

@ -54,7 +54,7 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckOther checkOther(tokenizer, settings, errorLogger);
// Checks
@ -84,7 +84,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckOther checkOther(tokenizer, settings, errorLogger);
// Checks
@ -264,7 +264,7 @@ private:
void funcArgNamesDifferent(const std::string & functionName, size_t index, const Token* declaration, const Token* definition);
void funcArgOrderDifferent(const std::string & functionName, const Token * declaration, const Token * definition, const std::vector<const Token*> & declarations, const std::vector<const Token*> & definitions);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckOther c(nullptr, settings, errorLogger);
// error
@ -329,7 +329,7 @@ private:
return "Other";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Other checks\n"
// error

View File

@ -50,14 +50,14 @@ public:
: Check(myName(), tokenizer, settings, errorLogger) {
}
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
if (tokenizer->isC())
return;
CheckPostfixOperator checkPostfixOperator(tokenizer, settings, errorLogger);
checkPostfixOperator.postfixOperator();
}
void runSimplifiedChecks(const Tokenizer * /*tokenizer*/, const Settings * /*settings*/, ErrorLogger * /*errorLogger*/) {
void runSimplifiedChecks(const Tokenizer * /*tokenizer*/, const Settings * /*settings*/, ErrorLogger * /*errorLogger*/) override {
}
/** Check postfix operators */
@ -67,7 +67,7 @@ private:
/** Report Error */
void postfixOperatorError(const Token *tok);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckPostfixOperator c(nullptr, settings, errorLogger);
c.postfixOperatorError(nullptr);
}
@ -76,7 +76,7 @@ private:
return "Using postfix operators";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Warn if using postfix operators ++ or -- rather than prefix operator\n";
}
};

View File

@ -50,7 +50,7 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) {
void runChecks(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) override {
CheckSizeof checkSizeof(tokenizer, settings, errorLogger);
// Checks
@ -65,7 +65,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer* /*tokenizer*/, const Settings* /*settings*/, ErrorLogger* /*errorLogger*/) {
void runSimplifiedChecks(const Tokenizer* /*tokenizer*/, const Settings* /*settings*/, ErrorLogger* /*errorLogger*/) override {
}
/** @brief %Check for 'sizeof sizeof ..' */
@ -107,7 +107,7 @@ private:
void sizeofDereferencedVoidPointerError(const Token *tok, const std::string &varname);
void arithOperationsOnVoidPointerError(const Token* tok, const std::string &varname, const std::string &vartype);
void getErrorMessages(ErrorLogger* errorLogger, const Settings* settings) const {
void getErrorMessages(ErrorLogger* errorLogger, const Settings* settings) const override {
CheckSizeof c(nullptr, settings, errorLogger);
c.sizeofForArrayParameterError(nullptr);
@ -128,7 +128,7 @@ private:
return "Sizeof";
}
std::string classInfo() const {
std::string classInfo() const override {
return "sizeof() usage checks\n"
"- sizeof for array given as function argument\n"
"- sizeof for numeric given as function argument\n"

View File

@ -54,7 +54,7 @@ public:
}
/** Simplified checks. The token list is simplified. */
void runSimplifiedChecks(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) {
void runSimplifiedChecks(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) override {
if (!tokenizer->isCPP()) {
return;
}
@ -205,7 +205,7 @@ private:
void readingEmptyStlContainerError(const Token* tok);
void getErrorMessages(ErrorLogger* errorLogger, const Settings* settings) const {
void getErrorMessages(ErrorLogger* errorLogger, const Settings* settings) const override {
CheckStl c(nullptr, settings, errorLogger);
c.invalidIteratorError(nullptr, "iterator");
c.iteratorsError(nullptr, "container1", "container2");
@ -241,7 +241,7 @@ private:
return "STL usage";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Check for invalid usage of STL:\n"
"- out of bounds errors\n"
"- misuse of iterators when iterating through a container\n"

View File

@ -50,7 +50,7 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckString checkString(tokenizer, settings, errorLogger);
// Checks
@ -61,7 +61,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckString checkString(tokenizer, settings, errorLogger);
// Checks
@ -103,7 +103,7 @@ private:
void suspiciousStringCompareError_char(const Token* tok, const std::string& var);
void overlappingStrcmpError(const Token* eq0, const Token *ne0);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckString c(nullptr, settings, errorLogger);
c.stringLiteralWriteError(nullptr, nullptr);
@ -122,7 +122,7 @@ private:
return "String";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Detect misusage of C-style strings:\n"
"- overlapping buffers passed to sprintf as source and destination\n"
"- incorrect length arguments for 'substr' and 'strncmp'\n"

View File

@ -49,7 +49,7 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
// These are not "simplified" because casts can't be ignored
CheckType checkType(tokenizer, settings, errorLogger);
checkType.checkTooBigBitwiseShift();
@ -60,7 +60,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
(void)tokenizer;
(void)settings;
(void)errorLogger;
@ -91,7 +91,7 @@ private:
void longCastReturnError(const Token *tok);
void floatToIntegerOverflowError(const Token *tok, const ValueFlow::Value &value);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckType c(nullptr, settings, errorLogger);
c.tooBigBitwiseShiftError(nullptr, 32, ValueFlow::Value(64));
c.tooBigSignedBitwiseShiftError(nullptr, 31, ValueFlow::Value(31));
@ -109,7 +109,7 @@ private:
return "Type";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Type checks\n"
"- bitwise shift by too many bits (only enabled when --platform is used)\n"
"- signed integer overflow (only enabled when --platform is used)\n"

View File

@ -60,7 +60,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckUninitVar checkUninitVar(tokenizer, settings, errorLogger);
checkUninitVar.check();
checkUninitVar.deadPointer();
@ -100,7 +100,7 @@ public:
void uninitStructMemberError(const Token *tok, const std::string &membername);
private:
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckUninitVar c(nullptr, settings, errorLogger);
// error
@ -115,7 +115,7 @@ private:
return "Uninitialized variables";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Uninitialized variables\n"
"- using uninitialized local variables\n"
"- using allocated data before it has been initialized\n"

View File

@ -64,7 +64,7 @@ public:
bool check(ErrorLogger * const errorLogger, const Settings& settings);
/** @brief Parse current TU and extract file info */
Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const;
Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const override;
/** @brief Analyse all file infos for all TU */
bool analyseWholeProgram(const std::list<Check::FileInfo*> &fileInfo, const Settings& settings, ErrorLogger &errorLogger);
@ -78,7 +78,7 @@ public:
private:
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckUnusedFunctions c(nullptr, settings, errorLogger);
c.unusedFunctionError(errorLogger, emptyString, 0, "funcName");
}
@ -93,14 +93,14 @@ private:
/**
* Dummy implementation, just to provide error for --errorlist
*/
void runSimplifiedChecks(const Tokenizer* /*tokenizer*/, const Settings* /*settings*/, ErrorLogger* /*errorLogger*/) {
void runSimplifiedChecks(const Tokenizer* /*tokenizer*/, const Settings* /*settings*/, ErrorLogger* /*errorLogger*/) override {
}
static std::string myName() {
return "Unused functions";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Check for functions that are never called\n";
}

View File

@ -53,7 +53,7 @@ public:
}
/** @brief Run checks against the normal token list */
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckUnusedVar checkUnusedVar(tokenizer, settings, errorLogger);
// Coding style checks
@ -62,7 +62,7 @@ public:
}
/** @brief Run checks against the simplified token list */
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
(void)tokenizer;
(void)settings;
(void)errorLogger;
@ -86,7 +86,7 @@ private:
void unreadVariableError(const Token *tok, const std::string &varname, bool modified);
void unassignedVariableError(const Token *tok, const std::string &varname);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckUnusedVar c(nullptr, settings, errorLogger);
// style/warning
@ -101,7 +101,7 @@ private:
return "UnusedVar";
}
std::string classInfo() const {
std::string classInfo() const override {
return "UnusedVar checks\n"
// style

View File

@ -48,7 +48,7 @@ public:
: Check(myName(), tokenizer, settings, errorLogger) {
}
virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) {
virtual void runSimplifiedChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override {
CheckVaarg check(tokenizer, settings, errorLogger);
check.va_start_argument();
check.va_list_usage();
@ -64,7 +64,7 @@ private:
void va_list_usedBeforeStartedError(const Token *tok, const std::string& varname);
void va_start_subsequentCallsError(const Token *tok, const std::string& varname);
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const {
void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override {
CheckVaarg c(nullptr, settings, errorLogger);
c.wrongParameterTo_va_start_error(nullptr, "arg1", "arg2");
c.referenceAs_va_start_error(nullptr, "arg1");
@ -77,7 +77,7 @@ private:
return "Vaarg";
}
std::string classInfo() const {
std::string classInfo() const override {
return "Check for misusage of variable argument lists:\n"
"- Wrong parameter passed to va_start()\n"
"- Reference passed to va_start()\n"

View File

@ -189,24 +189,24 @@ private:
* "[filepath:line number] Message", e.g.
* "[main.cpp:4] Uninitialized member variable"
*/
virtual void reportErr(const ErrorLogger::ErrorMessage &msg);
virtual void reportErr(const ErrorLogger::ErrorMessage &msg) override;
/**
* @brief Information about progress is directed here.
*
* @param outmsg Message to show, e.g. "Checking main.cpp..."
*/
virtual void reportOut(const std::string &outmsg);
virtual void reportOut(const std::string &outmsg) override;
std::list<std::string> _errorList;
Settings _settings;
void reportProgress(const std::string &filename, const char stage[], const std::size_t value);
void reportProgress(const std::string &filename, const char stage[], const std::size_t value) override;
/**
* Output information messages.
*/
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg);
virtual void reportInfo(const ErrorLogger::ErrorMessage &msg) override;
ErrorLogger &_errorLogger;

View File

@ -61,7 +61,7 @@ public:
}
void ShowResults(SHOWTIME_MODES mode) const;
virtual void AddResults(const std::string& str, std::clock_t clocks);
virtual void AddResults(const std::string& str, std::clock_t clocks) override;
private:
std::map<std::string, struct TimerResultsData> _results;

View File

@ -31,7 +31,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("portability");
TEST_CASE(novardecl);

View File

@ -44,7 +44,7 @@ private:
checkAssert.runSimplifiedChecks(&tokenizer, &settings, this);
}
void run() {
void run() override {
settings.addEnabled("warning");
TEST_CASE(assignmentInAssert);

View File

@ -32,7 +32,7 @@ public:
private:
void run() {
void run() override {
TEST_CASE(isReturnScope);
TEST_CASE(isVariableChanged);
TEST_CASE(isVariableChangedByFunctionCall);

View File

@ -55,7 +55,7 @@ private:
}
}
void run() {
void run() override {
settings.addEnabled("warning");
settings.addEnabled("style");
LOAD_LIB_2(settings.library, "std.cfg");

View File

@ -31,7 +31,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("style");
settings.addEnabled("warning");
settings.inconclusive = true;

View File

@ -31,7 +31,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("style");
settings.addEnabled("performance");

View File

@ -73,7 +73,7 @@ private:
checkBufferOverrun.runSimplifiedChecks(&tokenizer, &settings, this);
}
void run() {
void run() override {
settings0.addEnabled("warning");
settings0.addEnabled("style");
settings0.addEnabled("portability");

View File

@ -32,7 +32,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.platform(Settings::Unspecified);
settings.addEnabled("warning");
settings.addEnabled("portability");

View File

@ -34,7 +34,7 @@ private:
Settings settings0;
Settings settings1;
void run() {
void run() override {
settings0.addEnabled("style");
settings1.addEnabled("warning");

View File

@ -42,7 +42,7 @@ private:
Settings settings;
CmdLineParser defParser;
void run() {
void run() override {
TEST_CASE(nooptions);
TEST_CASE(helpshort);
TEST_CASE(helplong);

View File

@ -36,7 +36,7 @@ private:
Settings settings0;
Settings settings1;
void run() {
void run() override {
LOAD_LIB_2(settings0.library, "qt.cfg");
settings0.addEnabled("style");

View File

@ -48,7 +48,7 @@ private:
checkClass.constructors();
}
void run() {
void run() override {
settings.addEnabled("style");
settings.addEnabled("warning");

View File

@ -45,7 +45,7 @@ private:
}
};
void run() {
void run() override {
TEST_CASE(instancesSorted);
TEST_CASE(classInfoFormat);
TEST_CASE(getErrorMessages);

View File

@ -35,7 +35,7 @@ private:
const ErrorLogger::ErrorMessage::FileLocation fooCpp5;
const ErrorLogger::ErrorMessage::FileLocation barCpp8;
void run() {
void run() override {
TEST_CASE(PatternSearchReplace);
TEST_CASE(FileLocationDefaults);
TEST_CASE(FileLocationSetFile);

View File

@ -31,7 +31,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("all");
TEST_CASE(destructors);

View File

@ -37,7 +37,7 @@ public:
}
private:
void run() {
void run() override {
// bail out if the tests are not executed from the base folder
{
std::ifstream fin("test/testfilelister.cpp");

View File

@ -34,7 +34,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("style");
settings.addEnabled("warning");
settings.addEnabled("portability");

View File

@ -34,7 +34,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.debugwarnings = true;
settings.addEnabled("style");
settings.addEnabled("warning");

View File

@ -38,7 +38,7 @@ public:
private:
void run() {
void run() override {
TEST_CASE(setDefines);
TEST_CASE(setIncludePaths1);
TEST_CASE(setIncludePaths2);

View File

@ -59,7 +59,7 @@ private:
checkOther.checkIncompleteStatement();
}
void run() {
void run() override {
settings.addEnabled("warning");
TEST_CASE(test1);

View File

@ -31,7 +31,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("internal");
TEST_CASE(simplePatternInTokenMatch)

View File

@ -32,7 +32,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
LOAD_LIB_2(settings.library, "std.cfg");
LOAD_LIB_2(settings.library, "windows.cfg");
LOAD_LIB_2(settings.library, "qt.cfg");

View File

@ -32,7 +32,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
int id = 0;
while (!settings.library.ismemory(++id));
settings.library.setalloc("malloc", id, -1);
@ -1566,7 +1566,7 @@ private:
checkLeak.runSimplifiedChecks(&tokenizer, &settings, this);
}
void run() {
void run() override {
LOAD_LIB_2(settings.library, "windows.cfg");
TEST_CASE(heapDoubleFree);

View File

@ -39,7 +39,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
TEST_CASE(empty);
TEST_CASE(function);
TEST_CASE(function_match_scope);

View File

@ -30,7 +30,7 @@ public:
private:
void run() {
void run() override {
TEST_CASE(isint);
TEST_CASE(isbin);
TEST_CASE(isdec);

View File

@ -42,7 +42,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
TEST_CASE(testFunctionReturnType);
TEST_CASE(open);
}
@ -153,7 +153,7 @@ private:
}
void run() {
void run() override {
LOAD_LIB_2(settings1.library, "std.cfg");
LOAD_LIB_2(settings1.library, "posix.cfg");
LOAD_LIB_2(settings2.library, "std.cfg");
@ -4108,7 +4108,7 @@ private:
checkMemoryLeak.check();
}
void run() {
void run() override {
settings.addEnabled("warning");
settings.addEnabled("style");
@ -5282,7 +5282,7 @@ private:
checkMemoryLeakStructMember.check();
}
void run() {
void run() override {
LOAD_LIB_2(settings.library, "std.cfg");
LOAD_LIB_2(settings.library, "posix.cfg");
@ -5730,7 +5730,7 @@ private:
checkMemoryLeakNoVar.check();
}
void run() {
void run() override {
settings.inconclusive = true;
settings.standards.posix = true;
settings.addEnabled("warning");
@ -6065,7 +6065,7 @@ private:
checkMemoryLeak4.check();
}
void run() {
void run() override {
LOAD_LIB_2(settings.library, "gtk.cfg");
settings.addEnabled("all");
@ -6180,7 +6180,7 @@ private:
checkMemoryLeak.check();
}
void run() {
void run() override {
LOAD_LIB_2(settings.library, "windows.cfg");
TEST_CASE(openfileNoLeak);

View File

@ -38,7 +38,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
// Load std.cfg configuration
{
const char xmldata[] = "<?xml version=\"1.0\"?>\n"

View File

@ -26,7 +26,7 @@ public:
private:
void run() {
void run() override {
TEST_CASE(which_test);
TEST_CASE(which_test_method);
TEST_CASE(no_test_method);

View File

@ -38,7 +38,7 @@ public:
private:
Settings _settings;
void run() {
void run() override {
LOAD_LIB_2(_settings.library, "std.cfg");

View File

@ -29,7 +29,7 @@ public:
private:
void run() {
void run() override {
TEST_CASE(removeQuotationMarks);
TEST_CASE(acceptFile);
TEST_CASE(getCurrentPath);

View File

@ -39,7 +39,7 @@ private:
const PathMatch fooCppMatcher;
const PathMatch srcFooCppMatcher;
void run() {
void run() override {
TEST_CASE(emptymaskemptyfile);
TEST_CASE(emptymaskpath1);
TEST_CASE(emptymaskpath2);

View File

@ -28,7 +28,7 @@ public:
TestPlatform() : TestFixture("TestPlatform") { }
private:
void run() {
void run() override {
TEST_CASE(empty);
TEST_CASE(valid_config_native_1);
TEST_CASE(valid_config_native_2);

View File

@ -46,7 +46,7 @@ private:
checkPostfixOperator.postfixOperator();
}
void run() {
void run() override {
settings.addEnabled("performance");
TEST_CASE(testsimple);

View File

@ -68,7 +68,7 @@ private:
Settings settings0;
Preprocessor preprocessor0;
void run() {
void run() override {
// The bug that started the whole work with the new preprocessor
TEST_CASE(Bug2190219);

View File

@ -44,7 +44,7 @@ public:
private:
void run() {
void run() override {
TEST_CASE(runSamples);
TEST_CASE(runConsoleCodePageTranslationOnWindows);
}

View File

@ -36,7 +36,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("portability");
TEST_CASE(template1);

View File

@ -39,7 +39,7 @@ private:
Settings settings_std;
Settings settings_windows;
void run() {
void run() override {
LOAD_LIB_2(settings_std.library, "std.cfg");
LOAD_LIB_2(settings_windows.library, "windows.cfg");
settings0.addEnabled("portability");

View File

@ -38,7 +38,7 @@ private:
Settings settings1;
Settings settings2;
void run() {
void run() override {
settings0.addEnabled("style");
settings2.addEnabled("style");

View File

@ -33,7 +33,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("warning");
settings.addEnabled("portability");
settings.inconclusive = true;

View File

@ -34,7 +34,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("warning");
settings.addEnabled("style");
settings.addEnabled("performance");

View File

@ -31,7 +31,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("warning");
settings.addEnabled("style");

View File

@ -69,8 +69,8 @@ protected:
void processOptions(const options& args);
public:
virtual void reportOut(const std::string &outmsg);
virtual void reportErr(const ErrorLogger::ErrorMessage &msg);
virtual void reportOut(const std::string &outmsg) override;
virtual void reportErr(const ErrorLogger::ErrorMessage &msg) override;
void run(const std::string &str);
const std::string classname;

View File

@ -37,7 +37,7 @@ public:
private:
void run() {
void run() override {
TEST_CASE(suppressionsBadId1);
TEST_CASE(suppressionsDosFormat); // Ticket #1836
TEST_CASE(suppressionsFileNameWithColon); // Ticket #1919 - filename includes colon

View File

@ -110,7 +110,7 @@ private:
return 0;
}
void run() {
void run() override {
LOAD_LIB_2(settings1.library, "std.cfg");
settings2.platform(Settings::Unspecified);

View File

@ -61,7 +61,7 @@ private:
ASSERT_EQUALS(result, executor.check());
}
void run() {
void run() override {
LOAD_LIB_2(settings.library, "std.cfg");
TEST_CASE(deadlock_with_many_errors);

View File

@ -29,7 +29,7 @@ public:
private:
void run() {
void run() override {
TEST_CASE(result);
}

View File

@ -42,7 +42,7 @@ private:
std::vector<std::string> extendedOps;
std::vector<std::string> assignmentOps;
void run() {
void run() override {
arithmeticalOps = { "+", "-", "*", "/", "%", "<<", ">>" };
logicalOps = { "&&", "||", "!" };
comparisonOps = { "==", "!=", "<", "<=", ">", ">=" };

View File

@ -44,7 +44,7 @@ private:
Settings settings2;
Settings settings_windows;
void run() {
void run() override {
LOAD_LIB_2(settings_windows.library, "windows.cfg");
TEST_CASE(tokenize1);

View File

@ -32,7 +32,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
TEST_CASE(testaddtoken1);
TEST_CASE(testaddtoken2);
TEST_CASE(inc);

View File

@ -32,7 +32,7 @@ public:
private:
void run() {
void run() override {
TEST_CASE(checkTooBigShift_Unix32);
TEST_CASE(checkIntegerOverflow);
TEST_CASE(signConversion);

View File

@ -36,7 +36,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
LOAD_LIB_2(settings.library, "std.cfg");
TEST_CASE(uninitvar1);

View File

@ -33,7 +33,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("style");
TEST_CASE(incondition);

View File

@ -34,7 +34,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("style");
TEST_CASE(test1);

View File

@ -31,7 +31,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
settings.addEnabled("style");
TEST_CASE(emptyclass); // #5355 - False positive: Variable is not assigned a value.

View File

@ -50,10 +50,10 @@ public:
SimpleSuppressor(Settings &settings, ErrorLogger *next)
: _settings(settings), _next(next) {
}
virtual void reportOut(const std::string &outmsg) {
virtual void reportOut(const std::string &outmsg) override {
_next->reportOut(outmsg);
}
virtual void reportErr(const ErrorLogger::ErrorMessage &msg) {
virtual void reportErr(const ErrorLogger::ErrorMessage &msg) override {
if (!msg._callStack.empty() && !_settings.nomsg.isSuppressed(msg.toSuppressionsErrorMessage()))
_next->reportErr(msg);
}

View File

@ -44,7 +44,7 @@ private:
checkVaarg.runSimplifiedChecks(&tokenizer, &settings, this);
}
void run() {
void run() override {
settings.addEnabled("warning");
TEST_CASE(wrongParameterTo_va_start);

View File

@ -41,7 +41,7 @@ public:
private:
Settings settings;
void run() {
void run() override {
// strcpy, abort cfg
const char cfg[] = "<?xml version=\"1.0\"?>\n"
"<def>\n"

View File

@ -34,7 +34,7 @@ public:
}
private:
void run() {
void run() override {
TEST_CASE(varid1);
TEST_CASE(varid2);
TEST_CASE(varid3);