From 4844cc83336c43c049516da8dec08c830336a611 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 28 Jan 2022 13:32:54 +0100 Subject: [PATCH 1/2] removed OVERRIDE and FINAL defines and use the keywords directly --- cli/cppcheckexecutor.h | 12 +-- cli/threadexecutor.h | 10 +-- lib/check64bit.h | 6 +- lib/checkassert.h | 6 +- lib/checkautovariables.h | 6 +- lib/checkbool.h | 6 +- lib/checkboost.h | 6 +- lib/checkbufferoverrun.h | 14 ++-- lib/checkclass.h | 14 ++-- lib/checkcondition.h | 6 +- lib/checkexceptionsafety.h | 6 +- lib/checkfunctions.h | 6 +- lib/checkinternal.h | 6 +- lib/checkio.h | 6 +- lib/checkleakautovar.h | 6 +- lib/checkmemoryleak.h | 24 +++--- lib/checknullpointer.h | 14 ++-- lib/checkother.h | 6 +- lib/checkpostfixoperator.h | 6 +- lib/checksizeof.h | 6 +- lib/checkstl.h | 6 +- lib/checkstring.h | 6 +- lib/checktype.h | 6 +- lib/checkuninitvar.h | 14 ++-- lib/checkunusedfunctions.h | 10 +-- lib/checkunusedvar.h | 6 +- lib/checkvaarg.h | 6 +- lib/config.h | 11 --- lib/cppcheck.h | 12 +-- lib/ctu.h | 2 +- lib/exprengine.cpp | 8 +- lib/exprengine.h | 46 +++++------ lib/timer.h | 2 +- lib/valueflow.cpp | 134 +++++++++++++++---------------- oss-fuzz/main.cpp | 8 +- test/test64bit.cpp | 2 +- test/testassert.cpp | 2 +- test/testastutils.cpp | 2 +- test/testautovariables.cpp | 2 +- test/testbool.cpp | 2 +- test/testboost.cpp | 2 +- test/testbufferoverrun.cpp | 2 +- test/testbughuntingchecks.cpp | 2 +- test/testcharvar.cpp | 2 +- test/testclangimport.cpp | 2 +- test/testclass.cpp | 2 +- test/testcmdlineparser.cpp | 2 +- test/testcondition.cpp | 2 +- test/testconstructors.cpp | 2 +- test/testcppcheck.cpp | 8 +- test/testerrorlogger.cpp | 2 +- test/testexceptionsafety.cpp | 2 +- test/testexprengine.cpp | 2 +- test/testfilelister.cpp | 2 +- test/testfunctions.cpp | 2 +- test/testgarbage.cpp | 2 +- test/testimportproject.cpp | 4 +- test/testincompletestatement.cpp | 2 +- test/testinternal.cpp | 2 +- test/testio.cpp | 2 +- test/testleakautovar.cpp | 8 +- test/testlibrary.cpp | 2 +- test/testmathlib.cpp | 2 +- test/testmemleak.cpp | 10 +-- test/testnullpointer.cpp | 2 +- test/testoptions.cpp | 2 +- test/testother.cpp | 2 +- test/testpath.cpp | 2 +- test/testpathmatch.cpp | 2 +- test/testplatform.cpp | 2 +- test/testpostfixoperator.cpp | 2 +- test/testpreprocessor.cpp | 2 +- test/testsimplifytemplate.cpp | 2 +- test/testsimplifytokens.cpp | 2 +- test/testsimplifytypedef.cpp | 2 +- test/testsimplifyusing.cpp | 2 +- test/testsizeof.cpp | 2 +- test/teststl.cpp | 2 +- test/teststring.cpp | 2 +- test/testsuite.h | 8 +- test/testsummaries.cpp | 2 +- test/testsuppressions.cpp | 2 +- test/testsymboldatabase.cpp | 2 +- test/testthreadexecutor.cpp | 2 +- test/testtimer.cpp | 2 +- test/testtoken.cpp | 2 +- test/testtokenize.cpp | 2 +- test/testtokenlist.cpp | 2 +- test/testtokenrange.cpp | 2 +- test/testtype.cpp | 2 +- test/testuninitvar.cpp | 2 +- test/testunusedfunctions.cpp | 2 +- test/testunusedprivfunc.cpp | 2 +- test/testunusedvar.cpp | 2 +- test/testutils.cpp | 2 +- test/testutils.h | 4 +- test/testvaarg.cpp | 2 +- test/testvalueflow.cpp | 2 +- test/testvarid.cpp | 2 +- 99 files changed, 298 insertions(+), 309 deletions(-) diff --git a/cli/cppcheckexecutor.h b/cli/cppcheckexecutor.h index ad36893cdb4..dbfd8aa102e 100644 --- a/cli/cppcheckexecutor.h +++ b/cli/cppcheckexecutor.h @@ -54,7 +54,7 @@ class CppCheckExecutor : public ErrorLogger { /** * Destructor */ - ~CppCheckExecutor() OVERRIDE; + ~CppCheckExecutor() override; /** * Starts the checking. @@ -75,19 +75,19 @@ class CppCheckExecutor : public ErrorLogger { * * @param outmsg Progress message e.g. "Checking main.cpp..." */ - void reportOut(const std::string &outmsg, Color c = Color::Reset) OVERRIDE; + void reportOut(const std::string &outmsg, Color c = Color::Reset) override; /** xml output of errors */ - void reportErr(const ErrorMessage &msg) OVERRIDE; + void reportErr(const ErrorMessage &msg) override; - void reportProgress(const std::string &filename, const char stage[], const std::size_t value) OVERRIDE; + void reportProgress(const std::string &filename, const char stage[], const std::size_t value) override; /** * Output information messages. */ - void reportInfo(const ErrorMessage &msg) OVERRIDE; + void reportInfo(const ErrorMessage &msg) override; - void bughuntingReport(const std::string &str) OVERRIDE; + void bughuntingReport(const std::string &str) override; /** * Information about how many files have been checked diff --git a/cli/threadexecutor.h b/cli/threadexecutor.h index a5ddeb572ad..5a15a53a17a 100644 --- a/cli/threadexecutor.h +++ b/cli/threadexecutor.h @@ -51,14 +51,14 @@ class ThreadExecutor : public ErrorLogger { public: ThreadExecutor(const std::map &files, Settings &settings, ErrorLogger &errorLogger); ThreadExecutor(const ThreadExecutor &) = delete; - ~ThreadExecutor() OVERRIDE; + ~ThreadExecutor() override; void operator=(const ThreadExecutor &) = delete; unsigned int check(); - void reportOut(const std::string &outmsg, Color c) OVERRIDE; - void reportErr(const ErrorMessage &msg) OVERRIDE; - void reportInfo(const ErrorMessage &msg) OVERRIDE; - void bughuntingReport(const std::string &str) OVERRIDE; + void reportOut(const std::string &outmsg, Color c) override; + void reportErr(const ErrorMessage &msg) override; + void reportInfo(const ErrorMessage &msg) override; + void bughuntingReport(const std::string &str) override; /** * @brief Add content to a file, to be used in unit testing. diff --git a/lib/check64bit.h b/lib/check64bit.h index 65a31daef6d..17309df93a4 100644 --- a/lib/check64bit.h +++ b/lib/check64bit.h @@ -50,7 +50,7 @@ class CPPCHECKLIB Check64BitPortability : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { Check64BitPortability check64BitPortability(tokenizer, settings, errorLogger); check64BitPortability.pointerassignment(); } @@ -65,7 +65,7 @@ class CPPCHECKLIB Check64BitPortability : public Check { void returnIntegerError(const Token *tok); void returnPointerError(const Token *tok); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { Check64BitPortability c(nullptr, settings, errorLogger); c.assignmentAddressToIntegerError(nullptr); c.assignmentIntegerToAddressError(nullptr); @@ -77,7 +77,7 @@ class CPPCHECKLIB Check64BitPortability : public Check { return "64-bit portability"; } - std::string classInfo() const OVERRIDE { + 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"; diff --git a/lib/checkassert.h b/lib/checkassert.h index dd63437261e..970bf920acb 100644 --- a/lib/checkassert.h +++ b/lib/checkassert.h @@ -48,7 +48,7 @@ class CPPCHECKLIB CheckAssert : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** run checks, the token list is not simplified */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckAssert checkAssert(tokenizer, settings, errorLogger); checkAssert.assertWithSideEffects(); } @@ -63,7 +63,7 @@ class CPPCHECKLIB CheckAssert : public Check { 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 OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckAssert c(nullptr, settings, errorLogger); c.sideEffectInAssertError(nullptr, "function"); c.assignmentInAssertError(nullptr, "var"); @@ -73,7 +73,7 @@ class CPPCHECKLIB CheckAssert : public Check { return "Assert"; } - std::string classInfo() const OVERRIDE { + 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"; } }; diff --git a/lib/checkautovariables.h b/lib/checkautovariables.h index 0b8547d4c66..fd0870c3ff0 100644 --- a/lib/checkautovariables.h +++ b/lib/checkautovariables.h @@ -53,7 +53,7 @@ class CPPCHECKLIB CheckAutoVariables : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckAutoVariables checkAutoVariables(tokenizer, settings, errorLogger); checkAutoVariables.assignFunctionArg(); checkAutoVariables.checkVarLifetime(); @@ -93,7 +93,7 @@ class CPPCHECKLIB CheckAutoVariables : public Check { void errorUselessAssignmentArg(const Token *tok); void errorUselessAssignmentPtrArg(const Token *tok); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { ErrorPath errorPath; CheckAutoVariables c(nullptr,settings,errorLogger); c.errorAutoVariableAssignment(nullptr, false); @@ -117,7 +117,7 @@ class CPPCHECKLIB CheckAutoVariables : public Check { return "Auto Variables"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/checkbool.h b/lib/checkbool.h index cc6b5c9cc82..60c3d3e8bc9 100644 --- a/lib/checkbool.h +++ b/lib/checkbool.h @@ -48,7 +48,7 @@ class CPPCHECKLIB CheckBool : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckBool checkBool(tokenizer, settings, errorLogger); // Checks @@ -109,7 +109,7 @@ class CPPCHECKLIB CheckBool : public Check { void pointerArithBoolError(const Token *tok); void returnValueBoolError(const Token *tok); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckBool c(nullptr, settings, errorLogger); c.assignBoolToPointerError(nullptr); @@ -129,7 +129,7 @@ class CPPCHECKLIB CheckBool : public Check { return "Boolean"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/checkboost.h b/lib/checkboost.h index 28b2968429b..91b809d2fb9 100644 --- a/lib/checkboost.h +++ b/lib/checkboost.h @@ -47,7 +47,7 @@ class CPPCHECKLIB CheckBoost : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { if (!tokenizer->isCPP()) return; @@ -61,7 +61,7 @@ class CPPCHECKLIB CheckBoost : public Check { private: void boostForeachError(const Token *tok); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckBoost c(nullptr, settings, errorLogger); c.boostForeachError(nullptr); } @@ -70,7 +70,7 @@ class CPPCHECKLIB CheckBoost : public Check { return "Boost usage"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Check for invalid usage of Boost:\n" "- container modification during BOOST_FOREACH\n"; } diff --git a/lib/checkbufferoverrun.h b/lib/checkbufferoverrun.h index 9497d21c73a..ada90cb0dbb 100644 --- a/lib/checkbufferoverrun.h +++ b/lib/checkbufferoverrun.h @@ -67,7 +67,7 @@ class CPPCHECKLIB CheckBufferOverrun : public Check { CheckBufferOverrun(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckBufferOverrun checkBufferOverrun(tokenizer, settings, errorLogger); checkBufferOverrun.arrayIndex(); checkBufferOverrun.pointerArithmetic(); @@ -78,7 +78,7 @@ class CPPCHECKLIB CheckBufferOverrun : public Check { checkBufferOverrun.argumentSize(); } - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckBufferOverrun c(nullptr, settings, errorLogger); c.arrayIndexError(nullptr, std::vector(), std::vector()); c.pointerArithmeticError(nullptr, nullptr, nullptr); @@ -90,10 +90,10 @@ class CPPCHECKLIB CheckBufferOverrun : public Check { } /** @brief Parse current TU and extract file info */ - Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const OVERRIDE; + Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const override; /** @brief Analyse all file infos for all TU */ - bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) OVERRIDE; + bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) override; private: @@ -137,14 +137,14 @@ class CPPCHECKLIB CheckBufferOverrun : public Check { std::list unsafePointerArith; /** Convert MyFileInfo data into xml string */ - std::string toString() const OVERRIDE; + std::string toString() const override; }; static bool isCtuUnsafeBufferUsage(const Check *check, const Token *argtok, MathLib::bigint *offset, int type); static bool isCtuUnsafeArrayIndex(const Check *check, const Token *argtok, MathLib::bigint *offset); static bool isCtuUnsafePointerArith(const Check *check, const Token *argtok, MathLib::bigint *offset); - Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const OVERRIDE; + Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const override; static bool analyseWholeProgram1(const std::map> &callsMap, const CTU::FileInfo::UnsafeUsage &unsafeUsage, int type, ErrorLogger &errorLogger); @@ -152,7 +152,7 @@ class CPPCHECKLIB CheckBufferOverrun : public Check { return "Bounds checking"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Out of bounds checking:\n" "- Array index out of bounds\n" "- Pointer arithmetic overflow\n" diff --git a/lib/checkclass.h b/lib/checkclass.h index 19fddfcca63..6309f2566b5 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -60,7 +60,7 @@ class CPPCHECKLIB CheckClass : public Check { 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) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { if (tokenizer->isC()) return; @@ -177,16 +177,16 @@ class CPPCHECKLIB CheckClass : public Check { std::vector classDefinitions; /** Convert MyFileInfo data into xml string */ - std::string toString() const OVERRIDE; + std::string toString() const override; }; /** @brief Parse current TU and extract file info */ - Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const OVERRIDE; + Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const override; - Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const OVERRIDE; + Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const override; /** @brief Analyse all file infos for all TU */ - bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) OVERRIDE; + bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) override; private: const SymbolDatabase *mSymbolDatabase; @@ -228,7 +228,7 @@ class CPPCHECKLIB CheckClass : public Check { void unsafeClassRefMemberError(const Token *tok, const std::string &varname); void checkDuplInheritedMembersRecursive(const Type* typeCurrent, const Type* typeBase); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckClass c(nullptr, settings, errorLogger); c.noConstructorError(nullptr, "classname", false); c.noExplicitConstructorError(nullptr, "classname", false); @@ -273,7 +273,7 @@ class CPPCHECKLIB CheckClass : public Check { return "Class"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/checkcondition.h b/lib/checkcondition.h index c3a68a69341..978f7bea136 100644 --- a/lib/checkcondition.h +++ b/lib/checkcondition.h @@ -57,7 +57,7 @@ class CPPCHECKLIB CheckCondition : public Check { CheckCondition(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckCondition checkCondition(tokenizer, settings, errorLogger); checkCondition.multiCondition(); checkCondition.clarifyCondition(); // not simplified because ifAssign @@ -173,7 +173,7 @@ class CPPCHECKLIB CheckCondition : public Check { void checkCompareValueOutOfTypeRange(); void compareValueOutOfTypeRangeError(const Token *comparison, const std::string &type, long long value, bool result); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckCondition c(nullptr, settings, errorLogger); ErrorPath errorPath; @@ -203,7 +203,7 @@ class CPPCHECKLIB CheckCondition : public Check { return "Condition"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/checkexceptionsafety.h b/lib/checkexceptionsafety.h index 9e4843a28cc..3e5b2b75023 100644 --- a/lib/checkexceptionsafety.h +++ b/lib/checkexceptionsafety.h @@ -59,7 +59,7 @@ class CPPCHECKLIB CheckExceptionSafety : public Check { CheckExceptionSafety(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { if (tokenizer->isC()) return; @@ -107,7 +107,7 @@ class CPPCHECKLIB CheckExceptionSafety : public Check { void rethrowNoCurrentExceptionError(const Token *tok); /** Generate all possible errors (for --errorlist) */ - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckExceptionSafety c(nullptr, settings, errorLogger); c.destructorsError(nullptr, "Class"); c.deallocThrowError(nullptr, "p"); @@ -124,7 +124,7 @@ class CPPCHECKLIB CheckExceptionSafety : public Check { } /** wiki formatted description of the class (for --doc) */ - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Checking exception safety\n" "- Throwing exceptions in destructors\n" "- Throwing exception during invalid state\n" diff --git a/lib/checkfunctions.h b/lib/checkfunctions.h index 29edbc62e70..0b36d2dee19 100644 --- a/lib/checkfunctions.h +++ b/lib/checkfunctions.h @@ -59,7 +59,7 @@ class CPPCHECKLIB CheckFunctions : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckFunctions checkFunctions(tokenizer, settings, errorLogger); checkFunctions.checkIgnoredReturnValue(); @@ -124,7 +124,7 @@ class CPPCHECKLIB CheckFunctions : public Check { void missingReturnError(const Token *tok); void copyElisionError(const Token *tok); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckFunctions c(nullptr, settings, errorLogger); for (std::map::const_iterator i = settings->library.functionwarn.cbegin(); i != settings->library.functionwarn.cend(); ++i) { @@ -148,7 +148,7 @@ class CPPCHECKLIB CheckFunctions : public Check { return "Check function usage"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Check function usage:\n" "- missing 'return' in non-void function\n" "- return value of certain functions not used\n" diff --git a/lib/checkinternal.h b/lib/checkinternal.h index da3959592a7..56fe06c14c2 100644 --- a/lib/checkinternal.h +++ b/lib/checkinternal.h @@ -42,7 +42,7 @@ class CPPCHECKLIB CheckInternal : public Check { CheckInternal(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { if (!settings->checks.isEnabled(Checks::internalCheck)) return; @@ -92,7 +92,7 @@ class CPPCHECKLIB CheckInternal : public Check { 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 OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckInternal c(nullptr, settings, errorLogger); c.multiComparePatternError(nullptr, ";|%type%", "Match"); c.simplePatternError(nullptr, "class {", "Match"); @@ -109,7 +109,7 @@ class CPPCHECKLIB CheckInternal : public Check { return "cppcheck internal API usage"; } - std::string classInfo() const OVERRIDE { + 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 ""; diff --git a/lib/checkio.h b/lib/checkio.h index caa6761adc4..8c567e04eeb 100644 --- a/lib/checkio.h +++ b/lib/checkio.h @@ -50,7 +50,7 @@ class CPPCHECKLIB CheckIO : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks on the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckIO checkIO(tokenizer, settings, errorLogger); checkIO.checkWrongPrintfScanfArguments(); @@ -134,7 +134,7 @@ class CPPCHECKLIB CheckIO : public Check { static void argumentType(std::ostream & os, const ArgumentInfo * argInfo); static Severity::SeverityType getSeverity(const ArgumentInfo *argInfo); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckIO c(nullptr, settings, errorLogger); c.coutCerrMisusageError(nullptr, "cout"); @@ -166,7 +166,7 @@ class CPPCHECKLIB CheckIO : public Check { return "IO using format string"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/checkleakautovar.h b/lib/checkleakautovar.h index 50a2e0e080d..5bfce67b8b2 100644 --- a/lib/checkleakautovar.h +++ b/lib/checkleakautovar.h @@ -115,7 +115,7 @@ class CPPCHECKLIB CheckLeakAutoVar : public Check { CheckLeakAutoVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckLeakAutoVar checkLeakAutoVar(tokenizer, settings, errorLogger); checkLeakAutoVar.check(); } @@ -162,7 +162,7 @@ class CPPCHECKLIB CheckLeakAutoVar : public Check { /** 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 OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckLeakAutoVar c(nullptr, settings, errorLogger); c.deallocReturnError(nullptr, nullptr, "p"); c.configurationInfo(nullptr, "f"); // user configuration is needed to complete analysis @@ -173,7 +173,7 @@ class CPPCHECKLIB CheckLeakAutoVar : public Check { return "Leaks (auto variables)"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Detect when a auto variable is allocated but not deallocated or deallocated twice.\n"; } }; diff --git a/lib/checkmemoryleak.h b/lib/checkmemoryleak.h index ca32ac70561..5fcba2e163c 100644 --- a/lib/checkmemoryleak.h +++ b/lib/checkmemoryleak.h @@ -175,7 +175,7 @@ class CPPCHECKLIB CheckMemoryLeakInFunction : private Check, public CheckMemoryL CheckMemoryLeakInFunction(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckMemoryLeakInFunction checkMemoryLeak(tokenizer, settings, errorLogger); checkMemoryLeak.checkReallocUsage(); } @@ -190,7 +190,7 @@ class CPPCHECKLIB CheckMemoryLeakInFunction : private Check, public CheckMemoryL private: /** Report all possible errors (for the --errorlist) */ - void getErrorMessages(ErrorLogger *e, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *e, const Settings *settings) const override { CheckMemoryLeakInFunction c(nullptr, settings, e); c.memleakError(nullptr, "varname"); @@ -216,7 +216,7 @@ class CPPCHECKLIB CheckMemoryLeakInFunction : private Check, public CheckMemoryL * Get class information (--doc) * @return Wiki formatted information about this class */ - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Is there any allocated memory when a function goes out of scope\n"; } }; @@ -234,7 +234,7 @@ class CPPCHECKLIB CheckMemoryLeakInClass : private Check, private CheckMemoryLea CheckMemoryLeakInClass(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) {} - void runChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) OVERRIDE { + void runChecks(const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) override { if (!tokenizr->isCPP()) return; @@ -253,7 +253,7 @@ class CPPCHECKLIB CheckMemoryLeakInClass : private Check, private CheckMemoryLea void unsafeClassError(const Token *tok, const std::string &classname, const std::string &varname); - void getErrorMessages(ErrorLogger *e, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *e, const Settings *settings) const override { CheckMemoryLeakInClass c(nullptr, settings, e); c.publicAllocationError(nullptr, "varname"); c.unsafeClassError(nullptr, "class", "class::varname"); @@ -263,7 +263,7 @@ class CPPCHECKLIB CheckMemoryLeakInClass : private Check, private CheckMemoryLea return "Memory leaks (class variables)"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "If the constructor allocate memory then the destructor must deallocate it.\n"; } }; @@ -279,7 +279,7 @@ class CPPCHECKLIB CheckMemoryLeakStructMember : private Check, private CheckMemo CheckMemoryLeakStructMember(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckMemoryLeakStructMember checkMemoryLeak(tokenizer, settings, errorLogger); checkMemoryLeak.check(); } @@ -293,13 +293,13 @@ class CPPCHECKLIB CheckMemoryLeakStructMember : private Check, private CheckMemo void checkStructVariable(const Variable * const variable); - void getErrorMessages(ErrorLogger * /*errorLogger*/, const Settings * /*settings*/) const OVERRIDE {} + void getErrorMessages(ErrorLogger * /*errorLogger*/, const Settings * /*settings*/) const override {} static std::string myName() { return "Memory leaks (struct members)"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Don't forget to deallocate struct members\n"; } }; @@ -315,7 +315,7 @@ class CPPCHECKLIB CheckMemoryLeakNoVar : private Check, private CheckMemoryLeak CheckMemoryLeakNoVar(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger), CheckMemoryLeak(tokenizer, errorLogger, settings) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckMemoryLeakNoVar checkMemoryLeak(tokenizer, settings, errorLogger); checkMemoryLeak.check(); } @@ -346,7 +346,7 @@ class CPPCHECKLIB CheckMemoryLeakNoVar : private Check, private CheckMemoryLeak 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 OVERRIDE { + void getErrorMessages(ErrorLogger *e, const Settings *settings) const override { CheckMemoryLeakNoVar c(nullptr, settings, e); c.functionCallLeak(nullptr, "funcName", "funcName"); @@ -358,7 +358,7 @@ class CPPCHECKLIB CheckMemoryLeakNoVar : private Check, private CheckMemoryLeak return "Memory leaks (address not taken)"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Not taking the address to allocated memory\n"; } }; diff --git a/lib/checknullpointer.h b/lib/checknullpointer.h index c477ad1560c..638eeb22d95 100644 --- a/lib/checknullpointer.h +++ b/lib/checknullpointer.h @@ -56,7 +56,7 @@ class CPPCHECKLIB CheckNullPointer : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckNullPointer checkNullPointer(tokenizer, settings, errorLogger); checkNullPointer.nullPointer(); checkNullPointer.arithmetic(); @@ -106,20 +106,20 @@ class CPPCHECKLIB CheckNullPointer : public Check { std::list unsafeUsage; /** Convert MyFileInfo data into xml string */ - std::string toString() const OVERRIDE; + std::string toString() const override; }; /** @brief Parse current TU and extract file info */ - Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const OVERRIDE; + Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const override; - Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const OVERRIDE; + Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const override; /** @brief Analyse all file infos for all TU */ - bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) OVERRIDE; + bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) override; private: /** Get error messages. Used by --errorlist */ - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckNullPointer c(nullptr, settings, errorLogger); c.nullPointerError(nullptr, "pointer", nullptr, false); c.pointerArithmeticError(nullptr, nullptr, false); @@ -132,7 +132,7 @@ class CPPCHECKLIB CheckNullPointer : public Check { } /** class info in WIKI format. Used by --doc */ - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Null pointers\n" "- null pointer dereferencing\n" "- undefined null pointer arithmetic\n"; diff --git a/lib/checkother.h b/lib/checkother.h index 915f2254f90..dedea87ace5 100644 --- a/lib/checkother.h +++ b/lib/checkother.h @@ -57,7 +57,7 @@ class CPPCHECKLIB CheckOther : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckOther checkOther(tokenizer, settings, errorLogger); // Checks @@ -289,7 +289,7 @@ class CPPCHECKLIB CheckOther : public Check { void comparePointersError(const Token *tok, const ValueFlow::Value *v1, const ValueFlow::Value *v2); void checkModuloOfOneError(const Token *tok); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckOther c(nullptr, settings, errorLogger); ErrorPath errorPath; @@ -370,7 +370,7 @@ class CPPCHECKLIB CheckOther : public Check { return "Other"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Other checks\n" // error diff --git a/lib/checkpostfixoperator.h b/lib/checkpostfixoperator.h index f09f6b2e662..feb2197311c 100644 --- a/lib/checkpostfixoperator.h +++ b/lib/checkpostfixoperator.h @@ -48,7 +48,7 @@ class CPPCHECKLIB CheckPostfixOperator : public Check { CheckPostfixOperator(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { if (tokenizer->isC()) return; @@ -63,7 +63,7 @@ class CPPCHECKLIB CheckPostfixOperator : public Check { /** Report Error */ void postfixOperatorError(const Token *tok); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckPostfixOperator c(nullptr, settings, errorLogger); c.postfixOperatorError(nullptr); } @@ -72,7 +72,7 @@ class CPPCHECKLIB CheckPostfixOperator : public Check { return "Using postfix operators"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Warn if using postfix operators ++ or -- rather than prefix operator\n"; } }; diff --git a/lib/checksizeof.h b/lib/checksizeof.h index 510bdc8d2a8..99f1c4085c0 100644 --- a/lib/checksizeof.h +++ b/lib/checksizeof.h @@ -48,7 +48,7 @@ class CPPCHECKLIB CheckSizeof : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) OVERRIDE { + void runChecks(const Tokenizer* tokenizer, const Settings* settings, ErrorLogger* errorLogger) override { CheckSizeof checkSizeof(tokenizer, settings, errorLogger); // Checks @@ -101,7 +101,7 @@ class CPPCHECKLIB CheckSizeof : public Check { 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 OVERRIDE { + void getErrorMessages(ErrorLogger* errorLogger, const Settings* settings) const override { CheckSizeof c(nullptr, settings, errorLogger); c.sizeofForArrayParameterError(nullptr); @@ -122,7 +122,7 @@ class CPPCHECKLIB CheckSizeof : public Check { return "Sizeof"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/checkstl.h b/lib/checkstl.h index b06deebd593..7a855200805 100644 --- a/lib/checkstl.h +++ b/lib/checkstl.h @@ -53,7 +53,7 @@ class CPPCHECKLIB CheckStl : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** run checks, the token list is not simplified */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { if (!tokenizer->isCPP()) { return; } @@ -234,7 +234,7 @@ class CPPCHECKLIB CheckStl : public Check { void globalLockGuardError(const Token *tok); void localMutexError(const Token *tok); - void getErrorMessages(ErrorLogger* errorLogger, const Settings* settings) const OVERRIDE { + void getErrorMessages(ErrorLogger* errorLogger, const Settings* settings) const override { ErrorPath errorPath; CheckStl c(nullptr, settings, errorLogger); c.outOfBoundsError(nullptr, "container", nullptr, "x", nullptr); @@ -279,7 +279,7 @@ class CPPCHECKLIB CheckStl : public Check { return "STL usage"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/checkstring.h b/lib/checkstring.h index 30c89a15c8e..fd7d6de2c43 100644 --- a/lib/checkstring.h +++ b/lib/checkstring.h @@ -48,7 +48,7 @@ class CPPCHECKLIB CheckString : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckString checkString(tokenizer, settings, errorLogger); // Checks @@ -94,7 +94,7 @@ class CPPCHECKLIB CheckString : public Check { 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 OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckString c(nullptr, settings, errorLogger); c.stringLiteralWriteError(nullptr, nullptr); @@ -114,7 +114,7 @@ class CPPCHECKLIB CheckString : public Check { return "String"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/checktype.h b/lib/checktype.h index adba7b465f4..8104fd0acd0 100644 --- a/lib/checktype.h +++ b/lib/checktype.h @@ -51,7 +51,7 @@ class CPPCHECKLIB CheckType : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + 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(); @@ -88,7 +88,7 @@ class CPPCHECKLIB CheckType : public Check { void longCastReturnError(const Token *tok); void floatToIntegerOverflowError(const Token *tok, const ValueFlow::Value &value); - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + 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)); @@ -106,7 +106,7 @@ class CPPCHECKLIB CheckType : public Check { return "Type"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/checkuninitvar.h b/lib/checkuninitvar.h index 5523788e21c..0ab878774fd 100644 --- a/lib/checkuninitvar.h +++ b/lib/checkuninitvar.h @@ -70,7 +70,7 @@ class CPPCHECKLIB CheckUninitVar : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckUninitVar checkUninitVar(tokenizer, settings, errorLogger); checkUninitVar.check(); checkUninitVar.valueFlowUninit(); @@ -104,16 +104,16 @@ class CPPCHECKLIB CheckUninitVar : public Check { std::list unsafeUsage; /** Convert MyFileInfo data into xml string */ - std::string toString() const OVERRIDE; + std::string toString() const override; }; /** @brief Parse current TU and extract file info */ - Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const OVERRIDE; + Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const override; - Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const OVERRIDE; + Check::FileInfo * loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement) const override; /** @brief Analyse all file infos for all TU */ - bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) OVERRIDE; + bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) override; void uninitvarError(const Token* tok, const ValueFlow::Value& v); void uninitstringError(const Token *tok, const std::string &varname, bool strncpy_); @@ -135,7 +135,7 @@ class CPPCHECKLIB CheckUninitVar : public Check { Check::FileInfo *getFileInfo() const; bool isUnsafeFunction(const Scope *scope, int argnr, const Token **tok) const; - void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckUninitVar c(nullptr, settings, errorLogger); ValueFlow::Value v{}; @@ -151,7 +151,7 @@ class CPPCHECKLIB CheckUninitVar : public Check { return "Uninitialized variables"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Uninitialized variables\n" "- using uninitialized local variables\n" "- using allocated data before it has been initialized\n"; diff --git a/lib/checkunusedfunctions.h b/lib/checkunusedfunctions.h index da626e7c210..6606f276c8e 100644 --- a/lib/checkunusedfunctions.h +++ b/lib/checkunusedfunctions.h @@ -66,10 +66,10 @@ class CPPCHECKLIB CheckUnusedFunctions : public Check { 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 OVERRIDE; + Check::FileInfo *getFileInfo(const Tokenizer *tokenizer, const Settings *settings) const override; /** @brief Analyse all file infos for all TU */ - bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) OVERRIDE; + bool analyseWholeProgram(const CTU::FileInfo *ctu, const std::list &fileInfo, const Settings& settings, ErrorLogger &errorLogger) override; static CheckUnusedFunctions instance; @@ -80,11 +80,11 @@ class CPPCHECKLIB CheckUnusedFunctions : public Check { private: - void getErrorMessages(ErrorLogger *errorLogger, const Settings * /*settings*/) const OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings * /*settings*/) const override { CheckUnusedFunctions::unusedFunctionError(errorLogger, emptyString, 0, "funcName"); } - void runChecks(const Tokenizer * /*tokenizer*/, const Settings * /*settings*/, ErrorLogger * /*errorLogger*/) OVERRIDE {} + void runChecks(const Tokenizer * /*tokenizer*/, const Settings * /*settings*/, ErrorLogger * /*errorLogger*/) override {} /** * Dummy implementation, just to provide error for --errorlist @@ -97,7 +97,7 @@ class CPPCHECKLIB CheckUnusedFunctions : public Check { return "Unused functions"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "Check for functions that are never called\n"; } diff --git a/lib/checkunusedvar.h b/lib/checkunusedvar.h index 37022fe3845..0547c556299 100644 --- a/lib/checkunusedvar.h +++ b/lib/checkunusedvar.h @@ -54,7 +54,7 @@ class CPPCHECKLIB CheckUnusedVar : public Check { : Check(myName(), tokenizer, settings, errorLogger) {} /** @brief Run checks against the normal token list */ - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckUnusedVar checkUnusedVar(tokenizer, settings, errorLogger); // Coding style checks @@ -83,7 +83,7 @@ class CPPCHECKLIB CheckUnusedVar : public Check { 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 OVERRIDE { + void getErrorMessages(ErrorLogger *errorLogger, const Settings *settings) const override { CheckUnusedVar c(nullptr, settings, errorLogger); // style/warning @@ -98,7 +98,7 @@ class CPPCHECKLIB CheckUnusedVar : public Check { return "UnusedVar"; } - std::string classInfo() const OVERRIDE { + std::string classInfo() const override { return "UnusedVar checks\n" // style diff --git a/lib/checkvaarg.h b/lib/checkvaarg.h index b8bcd78d10f..b346f480115 100644 --- a/lib/checkvaarg.h +++ b/lib/checkvaarg.h @@ -46,7 +46,7 @@ class CPPCHECKLIB CheckVaarg : public Check { CheckVaarg(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) : Check(myName(), tokenizer, settings, errorLogger) {} - void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) OVERRIDE { + void runChecks(const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) override { CheckVaarg check(tokenizer, settings, errorLogger); check.va_start_argument(); check.va_list_usage(); @@ -62,7 +62,7 @@ class CPPCHECKLIB CheckVaarg : public Check { 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 OVERRIDE { + 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"); @@ -75,7 +75,7 @@ class CPPCHECKLIB CheckVaarg : public Check { return "Vaarg"; } - std::string classInfo() const OVERRIDE { + 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" diff --git a/lib/config.h b/lib/config.h index f93be0a6588..84feb57299b 100644 --- a/lib/config.h +++ b/lib/config.h @@ -37,17 +37,6 @@ # include #endif -// C++11 override -#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ >= 5)) \ - || (defined(__clang__) && (defined (__cplusplus)) && (__cplusplus >= 201103L)) \ - || defined(__CPPCHECK__) -# define OVERRIDE override -# define FINAL final -#else -# define OVERRIDE -# define FINAL -#endif - // C++11 noexcept #if (defined(__GNUC__) && (__GNUC__ >= 5)) \ || (defined(__clang__) && (defined (__cplusplus)) && (__cplusplus >= 201103L)) \ diff --git a/lib/cppcheck.h b/lib/cppcheck.h index 9ee1a2010a5..2b017364550 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -60,7 +60,7 @@ class CPPCHECKLIB CppCheck : ErrorLogger { /** * @brief Destructor. */ - ~CppCheck() OVERRIDE; + ~CppCheck() override; /** * @brief This starts the actual checking. Note that you must call @@ -197,26 +197,26 @@ class CPPCHECKLIB CppCheck : ErrorLogger { * "[filepath:line number] Message", e.g. * "[main.cpp:4] Uninitialized member variable" */ - void reportErr(const ErrorMessage &msg) OVERRIDE; + void reportErr(const ErrorMessage &msg) override; /** * @brief Information about progress is directed here. * * @param outmsg Message to show, e.g. "Checking main.cpp..." */ - void reportOut(const std::string &outmsg, Color c = Color::Reset) OVERRIDE; + void reportOut(const std::string &outmsg, Color c = Color::Reset) override; - void bughuntingReport(const std::string &str) OVERRIDE; + void bughuntingReport(const std::string &str) override; std::list mErrorList; Settings mSettings; - void reportProgress(const std::string &filename, const char stage[], const std::size_t value) OVERRIDE; + void reportProgress(const std::string &filename, const char stage[], const std::size_t value) override; /** * Output information messages. */ - void reportInfo(const ErrorMessage &msg) OVERRIDE; + void reportInfo(const ErrorMessage &msg) override; ErrorLogger &mErrorLogger; diff --git a/lib/ctu.h b/lib/ctu.h index e2d2b4b8ccd..0ac9e27e6ee 100644 --- a/lib/ctu.h +++ b/lib/ctu.h @@ -54,7 +54,7 @@ namespace CTU { public: enum class InvalidValueType { null, uninit, bufferOverflow }; - std::string toString() const OVERRIDE; + std::string toString() const override; struct Location { Location() = default; diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index d831d2054d9..b8f15a2d569 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -419,10 +419,10 @@ namespace { int recursion; std::time_t startTime; - bool isC() const OVERRIDE { + bool isC() const override { return tokenizer->isC(); } - bool isCPP() const OVERRIDE { + bool isCPP() const override { return tokenizer->isCPP(); } @@ -492,7 +492,7 @@ namespace { } } - std::string getNewSymbolName() FINAL { + std::string getNewSymbolName() final { return "$" + std::to_string(++(*symbolValueIndex)); } @@ -651,7 +651,7 @@ namespace { CWE cwe, bool inconclusive, bool incomplete, - const std::string &functionName) OVERRIDE { + const std::string &functionName) override { if (errorPath.empty()) mTrackExecution->addError(tok->linenr()); diff --git a/lib/exprengine.h b/lib/exprengine.h index 42adc3c3669..55a04ebd08b 100644 --- a/lib/exprengine.h +++ b/lib/exprengine.h @@ -131,12 +131,12 @@ namespace ExprEngine { class UninitValue : public Value { public: UninitValue() : Value("?", ValueType::UninitValue) {} - bool isEqual(const DataBase *dataBase, int value) const OVERRIDE { + bool isEqual(const DataBase *dataBase, int value) const override { (void)dataBase; (void)value; return true; } - bool isUninit(const DataBase *dataBase) const OVERRIDE; + bool isUninit(const DataBase *dataBase) const override; }; class IntRange : public Value { @@ -146,14 +146,14 @@ namespace ExprEngine { , minValue(minValue) , maxValue(maxValue) , loopScope(nullptr) {} - std::string getRange() const OVERRIDE { + std::string getRange() const override { if (minValue == maxValue) return str(minValue); return str(minValue) + ":" + str(maxValue); } - bool isEqual(const DataBase *dataBase, int value) const OVERRIDE; - bool isGreaterThan(const DataBase *dataBase, int value) const OVERRIDE; - bool isLessThan(const DataBase *dataBase, int value) const OVERRIDE; + bool isEqual(const DataBase *dataBase, int value) const override; + bool isGreaterThan(const DataBase *dataBase, int value) const override; + bool isLessThan(const DataBase *dataBase, int value) const override; int128_t minValue; int128_t maxValue; @@ -167,13 +167,13 @@ namespace ExprEngine { , minValue(minValue) , maxValue(maxValue) {} - std::string getRange() const OVERRIDE { + std::string getRange() const override { return std::to_string(minValue) + ":" + std::to_string(maxValue); } - bool isEqual(const DataBase *dataBase, int value) const OVERRIDE; - bool isGreaterThan(const DataBase *dataBase, int value) const OVERRIDE; - bool isLessThan(const DataBase *dataBase, int value) const OVERRIDE; + bool isEqual(const DataBase *dataBase, int value) const override; + bool isGreaterThan(const DataBase *dataBase, int value) const override; + bool isLessThan(const DataBase *dataBase, int value) const override; long double minValue; long double maxValue; @@ -185,7 +185,7 @@ namespace ExprEngine { ConditionalValue(const std::string &name, const Vector &values) : Value(name, ValueType::ConditionalValue), values(values) {} - std::string getSymbolicExpression() const OVERRIDE; + std::string getSymbolicExpression() const override; Vector values; }; @@ -199,8 +199,8 @@ namespace ExprEngine { ArrayValue(DataBase *data, const Variable *var); ArrayValue(const std::string &name, const ArrayValue &arrayValue); - std::string getRange() const OVERRIDE; - std::string getSymbolicExpression() const OVERRIDE; + std::string getRange() const override; + std::string getSymbolicExpression() const override; void assign(ValuePtr index, ValuePtr value); void clear(); @@ -222,7 +222,7 @@ namespace ExprEngine { public: StringLiteralValue(const std::string &name, const std::string &s) : Value(name, ValueType::StringLiteralValue), string(s) {} - std::string getRange() const OVERRIDE { + std::string getRange() const override { return "\"" + string + "\""; } @@ -236,9 +236,9 @@ namespace ExprEngine { public: explicit StructValue(const std::string &name) : Value(name, ValueType::StructValue) {} - std::string getSymbolicExpression() const OVERRIDE; + std::string getSymbolicExpression() const override; - std::string getRange() const OVERRIDE { + std::string getRange() const override { return getSymbolicExpression(); } @@ -265,7 +265,7 @@ namespace ExprEngine { , varId(varId) {} - std::string getRange() const OVERRIDE { + std::string getRange() const override { return "&@" + std::to_string(varId); } @@ -280,9 +280,9 @@ namespace ExprEngine { , op1(op1) , op2(op2) {} - bool isEqual(const DataBase *dataBase, int value) const OVERRIDE; - bool isGreaterThan(const DataBase *dataBase, int value) const OVERRIDE; - virtual bool isLessThan(const DataBase *dataBase, int value) const OVERRIDE; + bool isEqual(const DataBase *dataBase, int value) const override; + bool isGreaterThan(const DataBase *dataBase, int value) const override; + virtual bool isLessThan(const DataBase *dataBase, int value) const override; bool isTrue(const DataBase *dataBase) const; std::string getExpr(DataBase *dataBase) const; @@ -306,7 +306,7 @@ namespace ExprEngine { , bits(bits) , sign(sign) {} - std::string getSymbolicExpression() const OVERRIDE; + std::string getSymbolicExpression() const override; ExprEngine::ValuePtr inputValue; int bits; @@ -326,10 +326,10 @@ namespace ExprEngine { class BailoutValue : public Value { public: BailoutValue() : Value("bailout", ValueType::BailoutValue) {} - bool isEqual(const DataBase * /*dataBase*/, int /*value*/) const OVERRIDE { + bool isEqual(const DataBase * /*dataBase*/, int /*value*/) const override { return true; } - bool isUninit(const DataBase *dataBase) const OVERRIDE { + bool isUninit(const DataBase *dataBase) const override { (void)dataBase; return true; } diff --git a/lib/timer.h b/lib/timer.h index 831bfad0dd4..558edc7e2c7 100644 --- a/lib/timer.h +++ b/lib/timer.h @@ -59,7 +59,7 @@ class CPPCHECKLIB TimerResults : public TimerResultsIntf { TimerResults() {} void showResults(SHOWTIME_MODES mode) const; - void addResults(const std::string& str, std::clock_t clocks) OVERRIDE; + void addResults(const std::string& str, std::clock_t clocks) override; private: std::map mResults; diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 3ed6d553592..2d8e16c585c 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -2351,7 +2351,7 @@ struct ValueFlowAnalyzer : Analyzer { return Action::None; } - virtual Action analyze(const Token* tok, Direction d) const OVERRIDE { + virtual Action analyze(const Token* tok, Direction d) const override { if (invalid()) return Action::Invalid; // Follow references @@ -2379,7 +2379,7 @@ struct ValueFlowAnalyzer : Analyzer { return Action::None; } - virtual std::vector evaluate(Evaluate e, const Token* tok, const Token* ctx = nullptr) const OVERRIDE + virtual std::vector evaluate(Evaluate e, const Token* tok, const Token* ctx = nullptr) const override { if (e == Evaluate::Integral) { if (tok->hasKnownIntValue()) @@ -2416,7 +2416,7 @@ struct ValueFlowAnalyzer : Analyzer { } } - virtual void assume(const Token* tok, bool state, unsigned int flags) OVERRIDE { + virtual void assume(const Token* tok, bool state, unsigned int flags) override { // Update program state pms.removeModifiedVars(tok); pms.addState(tok, getProgramState()); @@ -2458,7 +2458,7 @@ struct ValueFlowAnalyzer : Analyzer { assert(false && "Internal update unimplemented."); } - virtual void update(Token* tok, Action a, Direction d) OVERRIDE { + virtual void update(Token* tok, Action a, Direction d) override { ValueFlow::Value* value = getValue(tok); if (!value) return; @@ -2484,7 +2484,7 @@ struct ValueFlowAnalyzer : Analyzer { setTokenValue(tok, *value, getSettings()); } - virtual ValuePtr reanalyze(Token*, const std::string&) const OVERRIDE { + virtual ValuePtr reanalyze(Token*, const std::string&) const override { return {}; } }; @@ -2508,18 +2508,18 @@ struct SingleValueFlowAnalyzer : ValueFlowAnalyzer { return aliases; } - virtual const ValueFlow::Value* getValue(const Token*) const OVERRIDE { + virtual const ValueFlow::Value* getValue(const Token*) const override { return &value; } - virtual ValueFlow::Value* getValue(const Token*) OVERRIDE { + virtual ValueFlow::Value* getValue(const Token*) override { return &value; } - virtual void makeConditional() OVERRIDE { + virtual void makeConditional() override { value.conditional = true; } - virtual bool useSymbolicValues() const OVERRIDE + virtual bool useSymbolicValues() const override { if (value.isUninitValue()) return false; @@ -2528,11 +2528,11 @@ struct SingleValueFlowAnalyzer : ValueFlowAnalyzer { return true; } - virtual void addErrorPath(const Token* tok, const std::string& s) OVERRIDE { + virtual void addErrorPath(const Token* tok, const std::string& s) override { value.errorPath.emplace_back(tok, s); } - virtual bool isAlias(const Token* tok, bool& inconclusive) const OVERRIDE { + virtual bool isAlias(const Token* tok, bool& inconclusive) const override { if (value.isLifetimeValue()) return false; for (const auto& m: { @@ -2550,7 +2550,7 @@ struct SingleValueFlowAnalyzer : ValueFlowAnalyzer { return false; } - virtual bool isGlobal() const OVERRIDE { + virtual bool isGlobal() const override { for (const auto&p:getVars()) { const Variable* var = p.second; if (!var->isLocal() && !var->isArgument() && !var->isConst()) @@ -2559,20 +2559,20 @@ struct SingleValueFlowAnalyzer : ValueFlowAnalyzer { return false; } - virtual bool lowerToPossible() OVERRIDE { + virtual bool lowerToPossible() override { if (value.isImpossible()) return false; value.changeKnownToPossible(); return true; } - virtual bool lowerToInconclusive() OVERRIDE { + virtual bool lowerToInconclusive() override { if (value.isImpossible()) return false; value.setInconclusive(); return true; } - virtual bool isConditional() const OVERRIDE { + virtual bool isConditional() const override { if (value.conditional) return true; if (value.condition) @@ -2580,7 +2580,7 @@ struct SingleValueFlowAnalyzer : ValueFlowAnalyzer { return false; } - virtual bool stopOnCondition(const Token* condTok) const OVERRIDE + virtual bool stopOnCondition(const Token* condTok) const override { if (value.isNonValue()) return false; @@ -2594,7 +2594,7 @@ struct SingleValueFlowAnalyzer : ValueFlowAnalyzer { return cs.isUnknownDependent(); } - virtual bool updateScope(const Token* endBlock, bool) const OVERRIDE { + virtual bool updateScope(const Token* endBlock, bool) const override { const Scope* scope = endBlock->scope(); if (!scope) return false; @@ -2617,7 +2617,7 @@ struct SingleValueFlowAnalyzer : ValueFlowAnalyzer { return false; } - virtual ValuePtr reanalyze(Token* tok, const std::string& msg) const OVERRIDE { + virtual ValuePtr reanalyze(Token* tok, const std::string& msg) const override { ValueFlow::Value newValue = value; newValue.errorPath.emplace_back(tok, msg); return makeAnalyzer(tok, newValue, tokenlist); @@ -2687,29 +2687,29 @@ struct ExpressionAnalyzer : SingleValueFlowAnalyzer { }); } - virtual bool invalid() const OVERRIDE { + virtual bool invalid() const override { return unknown; } - virtual ProgramState getProgramState() const OVERRIDE { + virtual ProgramState getProgramState() const override { ProgramState ps; ps[expr] = value; return ps; } - virtual bool match(const Token* tok) const OVERRIDE { + virtual bool match(const Token* tok) const override { return tok->exprId() == expr->exprId(); } - virtual bool dependsOnThis() const OVERRIDE { + virtual bool dependsOnThis() const override { return dependOnThis; } - virtual bool isGlobal() const OVERRIDE { + virtual bool isGlobal() const override { return !local; } - virtual bool isVariable() const OVERRIDE { + virtual bool isVariable() const override { return expr->varId() > 0; } }; @@ -2723,7 +2723,7 @@ struct OppositeExpressionAnalyzer : ExpressionAnalyzer { : ExpressionAnalyzer(e, val, t), isNot(pIsNot) {} - virtual bool match(const Token* tok) const OVERRIDE { + virtual bool match(const Token* tok) const override { return isOppositeCond(isNot, isCPP(), expr, tok, getSettings()->library, true, true); } }; @@ -2740,28 +2740,28 @@ struct SubExpressionAnalyzer : ExpressionAnalyzer { virtual bool submatch(const Token* tok, bool exact = true) const = 0; - virtual bool isAlias(const Token* tok, bool& inconclusive) const OVERRIDE + virtual bool isAlias(const Token* tok, bool& inconclusive) const override { if (tok->exprId() == expr->exprId() && tok->astParent() && submatch(tok->astParent(), false)) return false; return ExpressionAnalyzer::isAlias(tok, inconclusive); } - virtual bool match(const Token* tok) const OVERRIDE + virtual bool match(const Token* tok) const override { return tok->astOperand1() && tok->astOperand1()->exprId() == expr->exprId() && submatch(tok); } - virtual bool internalMatch(const Token* tok) const OVERRIDE + virtual bool internalMatch(const Token* tok) const override { return tok->exprId() == expr->exprId() && !(astIsLHS(tok) && submatch(tok->astParent(), false)); } - virtual void internalUpdate(Token* tok, const ValueFlow::Value& v, Direction) OVERRIDE + virtual void internalUpdate(Token* tok, const ValueFlow::Value& v, Direction) override { partialReads->push_back(std::make_pair(tok, v)); } // No reanalysis for subexression - virtual ValuePtr reanalyze(Token*, const std::string&) const OVERRIDE { + virtual ValuePtr reanalyze(Token*, const std::string&) const override { return {}; } }; @@ -2774,7 +2774,7 @@ struct MemberExpressionAnalyzer : SubExpressionAnalyzer { : SubExpressionAnalyzer(e, val, t), varname(std::move(varname)) {} - virtual bool submatch(const Token* tok, bool exact) const OVERRIDE + virtual bool submatch(const Token* tok, bool exact) const override { if (!Token::Match(tok, ". %var%")) return false; @@ -4789,11 +4789,11 @@ struct SymbolicInferModel : InferModel { explicit SymbolicInferModel(const Token* tok) : expr(tok) { assert(expr->exprId() != 0); } - virtual bool match(const ValueFlow::Value& value) const OVERRIDE + virtual bool match(const ValueFlow::Value& value) const override { return value.isSymbolicValue() && value.tokvalue && value.tokvalue->exprId() == expr->exprId(); } - virtual ValueFlow::Value yield(MathLib::bigint value) const OVERRIDE + virtual ValueFlow::Value yield(MathLib::bigint value) const override { ValueFlow::Value result(value); result.valueType = ValueFlow::Value::ValueType::SYMBOLIC; @@ -5711,7 +5711,7 @@ struct SimpleConditionHandler : ConditionHandler { const Token* exprTok, const std::list& values, TokenList* tokenlist, - const Settings* settings) const OVERRIDE { + const Settings* settings) const override { return valueFlowForward(start->next(), stop, exprTok, values, tokenlist, settings); } @@ -5719,7 +5719,7 @@ struct SimpleConditionHandler : ConditionHandler { const Token* exprTok, const std::list& values, TokenList* tokenlist, - const Settings* settings) const OVERRIDE { + const Settings* settings) const override { return valueFlowForward(top, exprTok, values, tokenlist, settings); } @@ -5728,11 +5728,11 @@ struct SimpleConditionHandler : ConditionHandler { const Token* exprTok, const std::list& values, TokenList* tokenlist, - const Settings* settings) const OVERRIDE { + const Settings* settings) const override { return valueFlowReverse(start, endToken, exprTok, values, tokenlist, settings); } - virtual std::vector parse(const Token* tok, const Settings*) const OVERRIDE { + virtual std::vector parse(const Token* tok, const Settings*) const override { Condition cond; ValueFlow::Value true_value; ValueFlow::Value false_value; @@ -5770,10 +5770,10 @@ struct SimpleConditionHandler : ConditionHandler { }; struct IntegralInferModel : InferModel { - virtual bool match(const ValueFlow::Value& value) const OVERRIDE { + virtual bool match(const ValueFlow::Value& value) const override { return value.isIntValue(); } - virtual ValueFlow::Value yield(MathLib::bigint value) const OVERRIDE + virtual ValueFlow::Value yield(MathLib::bigint value) const override { ValueFlow::Value result(value); result.valueType = ValueFlow::Value::ValueType::INT; @@ -5812,10 +5812,10 @@ ValueFlow::Value inferCondition(std::string op, MathLib::bigint val, const Token struct IteratorInferModel : InferModel { virtual ValueFlow::Value::ValueType getType() const = 0; - virtual bool match(const ValueFlow::Value& value) const OVERRIDE { + virtual bool match(const ValueFlow::Value& value) const override { return value.valueType == getType(); } - virtual ValueFlow::Value yield(MathLib::bigint value) const OVERRIDE + virtual ValueFlow::Value yield(MathLib::bigint value) const override { ValueFlow::Value result(value); result.valueType = getType(); @@ -5825,13 +5825,13 @@ struct IteratorInferModel : InferModel { }; struct EndIteratorInferModel : IteratorInferModel { - virtual ValueFlow::Value::ValueType getType() const OVERRIDE { + virtual ValueFlow::Value::ValueType getType() const override { return ValueFlow::Value::ValueType::ITERATOR_END; } }; struct StartIteratorInferModel : IteratorInferModel { - virtual ValueFlow::Value::ValueType getType() const OVERRIDE { + virtual ValueFlow::Value::ValueType getType() const override { return ValueFlow::Value::ValueType::ITERATOR_END; } }; @@ -5877,7 +5877,7 @@ static void valueFlowInferCondition(TokenList* tokenlist, } struct SymbolicConditionHandler : SimpleConditionHandler { - virtual std::vector parse(const Token* tok, const Settings*) const OVERRIDE + virtual std::vector parse(const Token* tok, const Settings*) const override { if (!Token::Match(tok, "%comp%")) return {}; @@ -6184,7 +6184,7 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { return vars; } - virtual const ValueFlow::Value* getValue(const Token* tok) const OVERRIDE { + virtual const ValueFlow::Value* getValue(const Token* tok) const override { if (tok->varId() == 0) return nullptr; auto it = values.find(tok->varId()); @@ -6192,7 +6192,7 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { return nullptr; return &it->second; } - virtual ValueFlow::Value* getValue(const Token* tok) OVERRIDE { + virtual ValueFlow::Value* getValue(const Token* tok) override { if (tok->varId() == 0) return nullptr; auto it = values.find(tok->varId()); @@ -6201,19 +6201,19 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { return &it->second; } - virtual void makeConditional() OVERRIDE { + virtual void makeConditional() override { for (auto&& p:values) { p.second.conditional = true; } } - virtual void addErrorPath(const Token* tok, const std::string& s) OVERRIDE { + virtual void addErrorPath(const Token* tok, const std::string& s) override { for (auto&& p:values) { p.second.errorPath.emplace_back(tok, "Assuming condition is " + s); } } - virtual bool isAlias(const Token* tok, bool& inconclusive) const OVERRIDE { + virtual bool isAlias(const Token* tok, bool& inconclusive) const override { const auto range = SelectValueFromVarIdMapRange(&values); for (const auto& p:getVars()) { @@ -6227,11 +6227,11 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { return false; } - virtual bool isGlobal() const OVERRIDE { + virtual bool isGlobal() const override { return false; } - virtual bool lowerToPossible() OVERRIDE { + virtual bool lowerToPossible() override { for (auto&& p:values) { if (p.second.isImpossible()) return false; @@ -6239,7 +6239,7 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { } return true; } - virtual bool lowerToInconclusive() OVERRIDE { + virtual bool lowerToInconclusive() override { for (auto&& p:values) { if (p.second.isImpossible()) return false; @@ -6248,7 +6248,7 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { return true; } - virtual bool isConditional() const OVERRIDE { + virtual bool isConditional() const override { for (auto&& p:values) { if (p.second.conditional) return true; @@ -6258,11 +6258,11 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { return false; } - virtual bool stopOnCondition(const Token*) const OVERRIDE { + virtual bool stopOnCondition(const Token*) const override { return isConditional(); } - virtual bool updateScope(const Token* endBlock, bool) const OVERRIDE { + virtual bool updateScope(const Token* endBlock, bool) const override { const Scope* scope = endBlock->scope(); if (!scope) return false; @@ -6296,11 +6296,11 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { return false; } - virtual bool match(const Token* tok) const OVERRIDE { + virtual bool match(const Token* tok) const override { return values.count(tok->varId()) > 0; } - virtual ProgramState getProgramState() const OVERRIDE { + virtual ProgramState getProgramState() const override { ProgramState ps; for (const auto& p : values) { const Variable* var = vars.at(p.first); @@ -6309,7 +6309,7 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { return ps; } - virtual void forkScope(const Token* endBlock) OVERRIDE { + virtual void forkScope(const Token* endBlock) override { ProgramMemory pm{getProgramState()}; const Scope* scope = endBlock->scope(); const Token* condTok = getCondTokFromEnd(endBlock); @@ -6981,11 +6981,11 @@ struct ContainerExpressionAnalyzer : ExpressionAnalyzer { : ExpressionAnalyzer(expr, val, t) {} - virtual bool match(const Token* tok) const OVERRIDE { + virtual bool match(const Token* tok) const override { return tok->exprId() == expr->exprId() || (astIsIterator(tok) && isAliasOf(tok, expr->exprId())); } - virtual Action isWritable(const Token* tok, Direction d) const OVERRIDE { + virtual Action isWritable(const Token* tok, Direction d) const override { if (astIsIterator(tok)) return Action::None; if (d == Direction::Reverse) @@ -7021,7 +7021,7 @@ struct ContainerExpressionAnalyzer : ExpressionAnalyzer { return Action::None; } - virtual void writeValue(ValueFlow::Value* val, const Token* tok, Direction d) const OVERRIDE { + virtual void writeValue(ValueFlow::Value* val, const Token* tok, Direction d) const override { if (d == Direction::Reverse) return; if (!val) @@ -7056,7 +7056,7 @@ struct ContainerExpressionAnalyzer : ExpressionAnalyzer { } } - virtual Action isModified(const Token* tok) const OVERRIDE { + virtual Action isModified(const Token* tok) const override { Action read = Action::Read; // An iterator won't change the container size if (astIsIterator(tok)) @@ -7281,7 +7281,7 @@ static std::list getIteratorValues(std::list } struct IteratorConditionHandler : SimpleConditionHandler { - virtual std::vector parse(const Token* tok, const Settings*) const OVERRIDE { + virtual std::vector parse(const Token* tok, const Settings*) const override { Condition cond; ValueFlow::Value true_value; @@ -7493,7 +7493,7 @@ struct ContainerConditionHandler : ConditionHandler { const Token* exprTok, const std::list& values, TokenList* tokenlist, - const Settings*) const OVERRIDE { + const Settings*) const override { Analyzer::Result result{}; for (const ValueFlow::Value& value : values) result.update(valueFlowContainerForward(start->next(), stop, exprTok, value, tokenlist)); @@ -7504,7 +7504,7 @@ struct ContainerConditionHandler : ConditionHandler { const Token* exprTok, const std::list& values, TokenList* tokenlist, - const Settings*) const OVERRIDE { + const Settings*) const override { Analyzer::Result result{}; for (const ValueFlow::Value& value : values) result.update(valueFlowContainerForwardRecursive(top, exprTok, value, tokenlist)); @@ -7516,11 +7516,11 @@ struct ContainerConditionHandler : ConditionHandler { const Token* exprTok, const std::list& values, TokenList* tokenlist, - const Settings* settings) const OVERRIDE { + const Settings* settings) const override { return valueFlowContainerReverse(start, endTok, exprTok, values, tokenlist, settings); } - virtual std::vector parse(const Token* tok, const Settings* settings) const OVERRIDE + virtual std::vector parse(const Token* tok, const Settings* settings) const override { Condition cond; ValueFlow::Value true_value; diff --git a/oss-fuzz/main.cpp b/oss-fuzz/main.cpp index 27c35e3672b..97b17bf06cf 100644 --- a/oss-fuzz/main.cpp +++ b/oss-fuzz/main.cpp @@ -37,20 +37,20 @@ class CppcheckExecutor : public ErrorLogger { cppcheck.check("test.cpp", code); } - void reportOut(const std::string &outmsg, Color) OVERRIDE { + void reportOut(const std::string &outmsg, Color) override { (void)outmsg; } - void reportErr(const ErrorMessage &msg) OVERRIDE { + void reportErr(const ErrorMessage &msg) override { (void)msg; } void reportProgress(const std::string& filename, const char stage[], - const std::size_t value) OVERRIDE { + const std::size_t value) override { (void)filename; (void)stage; (void)value; } - void bughuntingReport(const std::string &str) OVERRIDE { + void bughuntingReport(const std::string &str) override { (void)str; } }; diff --git a/test/test64bit.cpp b/test/test64bit.cpp index 9ea1bfcade7..c72dfce8b9f 100644 --- a/test/test64bit.cpp +++ b/test/test64bit.cpp @@ -33,7 +33,7 @@ class Test64BitPortability : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::portability); TEST_CASE(novardecl); diff --git a/test/testassert.cpp b/test/testassert.cpp index 966e5459c96..3b64c6ed06d 100644 --- a/test/testassert.cpp +++ b/test/testassert.cpp @@ -49,7 +49,7 @@ class TestAssert : public TestFixture { checkAssert.runChecks(&tokenizer, &settings, this); } - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::warning); TEST_CASE(assignmentInAssert); diff --git a/test/testastutils.cpp b/test/testastutils.cpp index 67b9e26e850..51f711404d2 100644 --- a/test/testastutils.cpp +++ b/test/testastutils.cpp @@ -35,7 +35,7 @@ class TestAstUtils : public TestFixture { private: - void run() OVERRIDE { + void run() override { TEST_CASE(findLambdaEndTokenTest); TEST_CASE(findLambdaStartTokenTest); TEST_CASE(isNullOperandTest); diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index 5122e147bce..a9760099888 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -49,7 +49,7 @@ class TestAutoVariables : public TestFixture { checkAutoVariables.runChecks(&tokenizer, &settings, this); } - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::warning); settings.severity.enable(Severity::style); LOAD_LIB_2(settings.library, "std.cfg"); diff --git a/test/testbool.cpp b/test/testbool.cpp index 85332451aab..c290e7e554a 100644 --- a/test/testbool.cpp +++ b/test/testbool.cpp @@ -33,7 +33,7 @@ class TestBool : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::style); settings.severity.enable(Severity::warning); settings.certainty.enable(Certainty::inconclusive); diff --git a/test/testboost.cpp b/test/testboost.cpp index b91b4701a4e..d7fddc571ce 100644 --- a/test/testboost.cpp +++ b/test/testboost.cpp @@ -33,7 +33,7 @@ class TestBoost : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::style); settings.severity.enable(Severity::performance); diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index df16e4c4ab3..0b5003c1ad9 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -116,7 +116,7 @@ class TestBufferOverrun : public TestFixture { checkBufferOverrun.runChecks(&tokenizer, settings, this); } - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings0.library, "std.cfg"); settings0.severity.enable(Severity::warning); diff --git a/test/testbughuntingchecks.cpp b/test/testbughuntingchecks.cpp index ed124e96a9a..02b55705cab 100644 --- a/test/testbughuntingchecks.cpp +++ b/test/testbughuntingchecks.cpp @@ -36,7 +36,7 @@ class TestBughuntingChecks : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { #ifdef USE_Z3 settings.certainty.setEnabled(Certainty::inconclusive, true); LOAD_LIB_2(settings.library, "std.cfg"); diff --git a/test/testcharvar.cpp b/test/testcharvar.cpp index b7cc81f09f6..41db49c01f3 100644 --- a/test/testcharvar.cpp +++ b/test/testcharvar.cpp @@ -34,7 +34,7 @@ class TestCharVar : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.platform(Settings::Unspecified); settings.severity.enable(Severity::warning); settings.severity.enable(Severity::portability); diff --git a/test/testclangimport.cpp b/test/testclangimport.cpp index 74d47792ac3..c66cccd155a 100644 --- a/test/testclangimport.cpp +++ b/test/testclangimport.cpp @@ -38,7 +38,7 @@ class TestClangImport : public TestFixture { private: - void run() OVERRIDE { + void run() override { TEST_CASE(breakStmt); TEST_CASE(callExpr); TEST_CASE(caseStmt1); diff --git a/test/testclass.cpp b/test/testclass.cpp index e5c8fe0e36f..951bdcce251 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -41,7 +41,7 @@ class TestClass : public TestFixture { Settings settings0; Settings settings1; - void run() OVERRIDE { + void run() override { settings0.severity.enable(Severity::style); settings1.severity.enable(Severity::warning); diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index ae2c06e7c2e..e6236a6bdde 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -42,7 +42,7 @@ class TestCmdlineParser : public TestFixture { Settings settings; CmdLineParser defParser; - void run() OVERRIDE { + void run() override { TEST_CASE(nooptions); TEST_CASE(helpshort); TEST_CASE(helplong); diff --git a/test/testcondition.cpp b/test/testcondition.cpp index 1650dee47b0..a10410bec0b 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -44,7 +44,7 @@ class TestCondition : public TestFixture { Settings settings0; Settings settings1; - void run() OVERRIDE { + void run() override { // known platform.. settings0.platform(cppcheck::Platform::PlatformType::Native); settings1.platform(cppcheck::Platform::PlatformType::Native); diff --git a/test/testconstructors.cpp b/test/testconstructors.cpp index 59c2da53b17..945778bee9e 100644 --- a/test/testconstructors.cpp +++ b/test/testconstructors.cpp @@ -68,7 +68,7 @@ class TestConstructors : public TestFixture { checkClass.constructors(); } - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::style); settings.severity.enable(Severity::warning); diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index 3ebb1262ca7..b608265d1ce 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -39,15 +39,15 @@ class TestCppcheck : public TestFixture { public: std::list id; - void reportOut(const std::string & /*outmsg*/, Color = Color::Reset) OVERRIDE {} - void bughuntingReport(const std::string & /*str*/) OVERRIDE {} + void reportOut(const std::string & /*outmsg*/, Color = Color::Reset) override {} + void bughuntingReport(const std::string & /*str*/) override {} - void reportErr(const ErrorMessage &msg) OVERRIDE { + void reportErr(const ErrorMessage &msg) override { id.push_back(msg.id); } }; - void run() OVERRIDE { + void run() override { TEST_CASE(instancesSorted); TEST_CASE(classInfoFormat); TEST_CASE(getErrorMessages); diff --git a/test/testerrorlogger.cpp b/test/testerrorlogger.cpp index 60401c59351..7376614ea8f 100644 --- a/test/testerrorlogger.cpp +++ b/test/testerrorlogger.cpp @@ -38,7 +38,7 @@ class TestErrorLogger : public TestFixture { const ErrorMessage::FileLocation fooCpp5; const ErrorMessage::FileLocation barCpp8; - void run() OVERRIDE { + void run() override { TEST_CASE(PatternSearchReplace); TEST_CASE(FileLocationDefaults); TEST_CASE(FileLocationSetFile); diff --git a/test/testexceptionsafety.cpp b/test/testexceptionsafety.cpp index 1e9509d24c5..2065ecefe52 100644 --- a/test/testexceptionsafety.cpp +++ b/test/testexceptionsafety.cpp @@ -33,7 +33,7 @@ class TestExceptionSafety : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.fill(); TEST_CASE(destructors); diff --git a/test/testexprengine.cpp b/test/testexprengine.cpp index 6f41cec3457..d17566a816f 100644 --- a/test/testexprengine.cpp +++ b/test/testexprengine.cpp @@ -37,7 +37,7 @@ class TestExprEngine : public TestFixture { TestExprEngine() : TestFixture("TestExprEngine") {} private: - void run() OVERRIDE { + void run() override { #ifdef USE_Z3 TEST_CASE(annotation1); TEST_CASE(annotation2); diff --git a/test/testfilelister.cpp b/test/testfilelister.cpp index 11e0b86e9d3..23563d238bd 100644 --- a/test/testfilelister.cpp +++ b/test/testfilelister.cpp @@ -34,7 +34,7 @@ class TestFileLister : public TestFixture { : TestFixture("TestFileLister") {} private: - void run() OVERRIDE { + void run() override { // bail out if the tests are not executed from the base folder { std::ifstream fin("test/testfilelister.cpp"); diff --git a/test/testfunctions.cpp b/test/testfunctions.cpp index 651859b8d2c..e25ed0fbceb 100644 --- a/test/testfunctions.cpp +++ b/test/testfunctions.cpp @@ -38,7 +38,7 @@ class TestFunctions : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::style); settings.severity.enable(Severity::warning); settings.severity.enable(Severity::performance); diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index c20900bc80a..6f7892b2c82 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -37,7 +37,7 @@ class TestGarbage : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.debugwarnings = true; settings.severity.fill(); settings.certainty.fill(); diff --git a/test/testimportproject.cpp b/test/testimportproject.cpp index 828028c9238..8fa95cdf386 100644 --- a/test/testimportproject.cpp +++ b/test/testimportproject.cpp @@ -33,7 +33,7 @@ class TestImporter : public ImportProject { using ImportProject::importCompileCommands; using ImportProject::importCppcheckGuiProject; - bool sourceFileExists(const std::string & /*file*/) OVERRIDE { + bool sourceFileExists(const std::string & /*file*/) override { return true; } }; @@ -45,7 +45,7 @@ class TestImportProject : public TestFixture { private: - void run() OVERRIDE { + void run() override { TEST_CASE(setDefines); TEST_CASE(setIncludePaths1); TEST_CASE(setIncludePaths2); diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index bf571b659d0..dbac981596e 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -64,7 +64,7 @@ class TestIncompleteStatement : public TestFixture { checkOther.checkIncompleteStatement(); } - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::warning); TEST_CASE(test1); diff --git a/test/testinternal.cpp b/test/testinternal.cpp index 1b1d8b22781..7fd2238b8b0 100644 --- a/test/testinternal.cpp +++ b/test/testinternal.cpp @@ -30,7 +30,7 @@ class TestInternal : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.addEnabled("internal"); TEST_CASE(simplePatternInTokenMatch); diff --git a/test/testio.cpp b/test/testio.cpp index a6099bc24f3..68bfaf68db7 100644 --- a/test/testio.cpp +++ b/test/testio.cpp @@ -35,7 +35,7 @@ class TestIO : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings.library, "std.cfg"); LOAD_LIB_2(settings.library, "windows.cfg"); LOAD_LIB_2(settings.library, "qt.cfg"); diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index fe9f40fcb96..aa7ceee64b3 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -45,7 +45,7 @@ class TestLeakAutoVar : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { int id = 0; while (!Library::ismemory(++id)); settings.library.setalloc("malloc", id, -1); @@ -2312,7 +2312,7 @@ class TestLeakAutoVarRecursiveCountLimit : public TestFixture { c.runChecks(&tokenizer, &settings, this); } - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings.library, "std.cfg"); TEST_CASE(recursiveCountLimit); // #5872 #6157 #9097 @@ -2363,7 +2363,7 @@ class TestLeakAutoVarStrcpy : public TestFixture { checkLeak.runChecks(&tokenizer, &settings, this); } - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings.library, "std.cfg"); TEST_CASE(returnedValue); // #9298 @@ -2411,7 +2411,7 @@ class TestLeakAutoVarWindows : public TestFixture { checkLeak.runChecks(&tokenizer, &settings, this); } - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings.library, "windows.cfg"); TEST_CASE(heapDoubleFree); diff --git a/test/testlibrary.cpp b/test/testlibrary.cpp index b12c65ad576..647d0f10629 100644 --- a/test/testlibrary.cpp +++ b/test/testlibrary.cpp @@ -43,7 +43,7 @@ class TestLibrary : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { TEST_CASE(isCompliantValidationExpression); TEST_CASE(empty); TEST_CASE(function); diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index 4171a6a7a67..cd1b6279b68 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -33,7 +33,7 @@ class TestMathLib : public TestFixture { private: - void run() OVERRIDE { + void run() override { TEST_CASE(isint); TEST_CASE(isbin); TEST_CASE(isdec); diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index fdfb9861fac..18710b1d852 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -42,7 +42,7 @@ class TestMemleak : private TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { TEST_CASE(testFunctionReturnType); TEST_CASE(open); } @@ -149,7 +149,7 @@ class TestMemleakInFunction : public TestFixture { } - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings1.library, "std.cfg"); LOAD_LIB_2(settings1.library, "posix.cfg"); LOAD_LIB_2(settings2.library, "std.cfg"); @@ -491,7 +491,7 @@ class TestMemleakInClass : public TestFixture { (checkMemoryLeak.check)(); } - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::warning); settings.severity.enable(Severity::style); @@ -1679,7 +1679,7 @@ class TestMemleakStructMember : public TestFixture { (checkMemoryLeakStructMember.check)(); } - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings.library, "std.cfg"); LOAD_LIB_2(settings.library, "posix.cfg"); @@ -2184,7 +2184,7 @@ class TestMemleakNoVar : public TestFixture { (checkMemoryLeakNoVar.check)(); } - void run() OVERRIDE { + void run() override { settings.certainty.setEnabled(Certainty::inconclusive, true); settings.libraries.emplace_back("posix"); settings.severity.enable(Severity::warning); diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 494a842637a..56c021de802 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -44,7 +44,7 @@ class TestNullPointer : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings.library, "std.cfg"); settings.severity.enable(Severity::warning); diff --git a/test/testoptions.cpp b/test/testoptions.cpp index 3d316838c99..613bf4903ab 100644 --- a/test/testoptions.cpp +++ b/test/testoptions.cpp @@ -29,7 +29,7 @@ class TestOptions : public TestFixture { private: - void run() OVERRIDE { + void run() override { TEST_CASE(which_test); TEST_CASE(which_test_method); TEST_CASE(no_test_method); diff --git a/test/testother.cpp b/test/testother.cpp index dcc39cb5f51..c8af1295e80 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -46,7 +46,7 @@ class TestOther : public TestFixture { private: Settings _settings; - void run() OVERRIDE { + void run() override { LOAD_LIB_2(_settings.library, "std.cfg"); diff --git a/test/testpath.cpp b/test/testpath.cpp index d45df7d3745..40e1340b6fe 100644 --- a/test/testpath.cpp +++ b/test/testpath.cpp @@ -29,7 +29,7 @@ class TestPath : public TestFixture { private: - void run() OVERRIDE { + void run() override { TEST_CASE(removeQuotationMarks); TEST_CASE(acceptFile); TEST_CASE(getCurrentPath); diff --git a/test/testpathmatch.cpp b/test/testpathmatch.cpp index 5bacce30375..eefc8a680e5 100644 --- a/test/testpathmatch.cpp +++ b/test/testpathmatch.cpp @@ -39,7 +39,7 @@ class TestPathMatch : public TestFixture { const PathMatch fooCppMatcher; const PathMatch srcFooCppMatcher; - void run() OVERRIDE { + void run() override { TEST_CASE(emptymaskemptyfile); TEST_CASE(emptymaskpath1); TEST_CASE(emptymaskpath2); diff --git a/test/testplatform.cpp b/test/testplatform.cpp index 06bb7454a15..20a8360b7ea 100644 --- a/test/testplatform.cpp +++ b/test/testplatform.cpp @@ -28,7 +28,7 @@ class TestPlatform : public TestFixture { TestPlatform() : TestFixture("TestPlatform") {} private: - void run() OVERRIDE { + void run() override { TEST_CASE(empty); TEST_CASE(valid_config_native_1); TEST_CASE(valid_config_native_2); diff --git a/test/testpostfixoperator.cpp b/test/testpostfixoperator.cpp index 5b8fa914623..efff945bdb3 100644 --- a/test/testpostfixoperator.cpp +++ b/test/testpostfixoperator.cpp @@ -48,7 +48,7 @@ class TestPostfixOperator : public TestFixture { checkPostfixOperator.postfixOperator(); } - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::performance); TEST_CASE(testsimple); diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 35ae51fba84..670efc06702 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -75,7 +75,7 @@ class TestPreprocessor : public TestFixture { Settings settings0; Preprocessor preprocessor0; - void run() OVERRIDE { + void run() override { // The bug that started the whole work with the new preprocessor TEST_CASE(Bug2190219); diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index 50d550e5e82..e4294d5aa1d 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -40,7 +40,7 @@ class TestSimplifyTemplate : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::portability); // If there are unused templates, keep those diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index ac129c49fa7..04bb9f25722 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -40,7 +40,7 @@ class TestSimplifyTokens : public TestFixture { Settings settings_std; Settings settings_windows; - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings_std.library, "std.cfg"); LOAD_LIB_2(settings_windows.library, "windows.cfg"); settings0.severity.enable(Severity::portability); diff --git a/test/testsimplifytypedef.cpp b/test/testsimplifytypedef.cpp index adcb9f7277b..53a1a8a6af6 100644 --- a/test/testsimplifytypedef.cpp +++ b/test/testsimplifytypedef.cpp @@ -45,7 +45,7 @@ class TestSimplifyTypedef : public TestFixture { Settings settings1; Settings settings2; - void run() OVERRIDE { + void run() override { settings0.severity.enable(Severity::style); settings2.severity.enable(Severity::style); diff --git a/test/testsimplifyusing.cpp b/test/testsimplifyusing.cpp index f96b2fd57a8..83d92b6772c 100644 --- a/test/testsimplifyusing.cpp +++ b/test/testsimplifyusing.cpp @@ -39,7 +39,7 @@ class TestSimplifyUsing : public TestFixture { Settings settings1; Settings settings2; - void run() OVERRIDE { + void run() override { settings0.severity.enable(Severity::style); settings2.severity.enable(Severity::style); diff --git a/test/testsizeof.cpp b/test/testsizeof.cpp index 41afaf46335..4b89486e217 100644 --- a/test/testsizeof.cpp +++ b/test/testsizeof.cpp @@ -38,7 +38,7 @@ class TestSizeof : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::warning); settings.severity.enable(Severity::portability); settings.certainty.enable(Certainty::inconclusive); diff --git a/test/teststl.cpp b/test/teststl.cpp index 66687cf3d86..028804e6a99 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -36,7 +36,7 @@ class TestStl : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::warning); settings.severity.enable(Severity::style); settings.severity.enable(Severity::performance); diff --git a/test/teststring.cpp b/test/teststring.cpp index 3ac3559cad9..44ea0a1467a 100644 --- a/test/teststring.cpp +++ b/test/teststring.cpp @@ -34,7 +34,7 @@ class TestString : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::warning); settings.severity.enable(Severity::style); diff --git a/test/testsuite.h b/test/testsuite.h index 2e2512f7e1a..a2f5e706751 100644 --- a/test/testsuite.h +++ b/test/testsuite.h @@ -104,15 +104,15 @@ class TestFixture : public ErrorLogger { void processOptions(const options& args); public: - void bughuntingReport(const std::string & /*str*/) OVERRIDE {} - void reportOut(const std::string &outmsg, Color c = Color::Reset) OVERRIDE; - void reportErr(const ErrorMessage &msg) OVERRIDE; + void bughuntingReport(const std::string & /*str*/) override {} + void reportOut(const std::string &outmsg, Color c = Color::Reset) override; + void reportErr(const ErrorMessage &msg) override; void run(const std::string &str); static void printHelp(); const std::string classname; explicit TestFixture(const char * const _name); - ~TestFixture() OVERRIDE {} + ~TestFixture() override {} static std::size_t runTests(const options& args); }; diff --git a/test/testsummaries.cpp b/test/testsummaries.cpp index 5d9bb14530a..c3230a8bfa9 100644 --- a/test/testsummaries.cpp +++ b/test/testsummaries.cpp @@ -32,7 +32,7 @@ class TestSummaries : public TestFixture { TestSummaries() : TestFixture("TestSummaries") {} private: - void run() OVERRIDE { + void run() override { TEST_CASE(createSummaries1); TEST_CASE(createSummariesGlobal); diff --git a/test/testsuppressions.cpp b/test/testsuppressions.cpp index f144e2a8fa2..4ee92a71e8a 100644 --- a/test/testsuppressions.cpp +++ b/test/testsuppressions.cpp @@ -41,7 +41,7 @@ class TestSuppressions : public TestFixture { private: - void run() OVERRIDE { + void run() override { TEST_CASE(suppressionsBadId1); TEST_CASE(suppressionsDosFormat); // Ticket #1836 TEST_CASE(suppressionsFileNameWithColon); // Ticket #1919 - filename includes colon diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 32790edb68b..6859a0f3f44 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -117,7 +117,7 @@ class TestSymbolDatabase : public TestFixture { return nullptr; } - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings1.library, "std.cfg"); settings2.platform(Settings::Unspecified); diff --git a/test/testthreadexecutor.cpp b/test/testthreadexecutor.cpp index 928d7603c70..a1ba87c0b90 100644 --- a/test/testthreadexecutor.cpp +++ b/test/testthreadexecutor.cpp @@ -61,7 +61,7 @@ class TestThreadExecutor : public TestFixture { ASSERT_EQUALS(result, executor.check()); } - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings.library, "std.cfg"); TEST_CASE(deadlock_with_many_errors); diff --git a/test/testtimer.cpp b/test/testtimer.cpp index 66f37d4d104..97c58ce78a2 100644 --- a/test/testtimer.cpp +++ b/test/testtimer.cpp @@ -29,7 +29,7 @@ class TestTimer : public TestFixture { private: - void run() OVERRIDE { + void run() override { TEST_CASE(result); } diff --git a/test/testtoken.cpp b/test/testtoken.cpp index 6398b7627df..67255114ac1 100644 --- a/test/testtoken.cpp +++ b/test/testtoken.cpp @@ -45,7 +45,7 @@ class TestToken : public TestFixture { std::vector extendedOps; std::vector assignmentOps; - void run() OVERRIDE { + void run() override { arithmeticalOps = { "+", "-", "*", "/", "%", "<<", ">>" }; logicalOps = { "&&", "||", "!" }; comparisonOps = { "==", "!=", "<", "<=", ">", ">=" }; diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index a341a8a829d..d5d8aa1b93a 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -48,7 +48,7 @@ class TestTokenizer : public TestFixture { Settings settings2; Settings settings_windows; - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings_windows.library, "windows.cfg"); // If there are unused templates, keep those diff --git a/test/testtokenlist.cpp b/test/testtokenlist.cpp index da1ee52611d..515caaf8ddd 100644 --- a/test/testtokenlist.cpp +++ b/test/testtokenlist.cpp @@ -32,7 +32,7 @@ class TestTokenList : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { TEST_CASE(testaddtoken1); TEST_CASE(testaddtoken2); TEST_CASE(inc); diff --git a/test/testtokenrange.cpp b/test/testtokenrange.cpp index 1542faeb69a..0cd6955ba00 100644 --- a/test/testtokenrange.cpp +++ b/test/testtokenrange.cpp @@ -37,7 +37,7 @@ class TestTokenRange : public TestFixture { TestTokenRange() : TestFixture("TestTokenRange") {} private: - void run() OVERRIDE { + void run() override { TEST_CASE(enumerationToEnd); TEST_CASE(untilHelperToEnd); TEST_CASE(untilHelperPartWay); diff --git a/test/testtype.cpp b/test/testtype.cpp index 37428581148..8e8581a62a0 100644 --- a/test/testtype.cpp +++ b/test/testtype.cpp @@ -35,7 +35,7 @@ class TestType : public TestFixture { private: - void run() OVERRIDE { + void run() override { TEST_CASE(checkTooBigShift_Unix32); TEST_CASE(checkIntegerOverflow); TEST_CASE(signConversion); diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index 4fa3cdf1ddd..3f23e4cb06c 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -38,7 +38,7 @@ class TestUninitVar : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { LOAD_LIB_2(settings.library, "std.cfg"); TEST_CASE(uninitvar1); diff --git a/test/testunusedfunctions.cpp b/test/testunusedfunctions.cpp index c4fc00c14b3..70d4c7c3560 100644 --- a/test/testunusedfunctions.cpp +++ b/test/testunusedfunctions.cpp @@ -34,7 +34,7 @@ class TestUnusedFunctions : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::style); TEST_CASE(incondition); diff --git a/test/testunusedprivfunc.cpp b/test/testunusedprivfunc.cpp index 26ea6c7fb63..97aeb40fad1 100644 --- a/test/testunusedprivfunc.cpp +++ b/test/testunusedprivfunc.cpp @@ -39,7 +39,7 @@ class TestUnusedPrivateFunction : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::style); TEST_CASE(test1); diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index 6cd8edcb70a..9cccd96ef04 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -35,7 +35,7 @@ class TestUnusedVar : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::style); settings.severity.enable(Severity::information); settings.checkLibrary = true; diff --git a/test/testutils.cpp b/test/testutils.cpp index d8bfe445fa3..fb1f545a5e8 100644 --- a/test/testutils.cpp +++ b/test/testutils.cpp @@ -27,7 +27,7 @@ class TestUtils : public TestFixture { TestUtils() : TestFixture("TestUtils") {} private: - void run() OVERRIDE { + void run() override { TEST_CASE(isValidGlobPattern); TEST_CASE(matchglob); } diff --git a/test/testutils.h b/test/testutils.h index 63f65eed0df..85c3629659d 100644 --- a/test/testutils.h +++ b/test/testutils.h @@ -58,10 +58,10 @@ class SimpleSuppressor : public ErrorLogger { public: SimpleSuppressor(Settings &settings, ErrorLogger *next) : settings(settings), next(next) {} - void reportOut(const std::string &outmsg, Color = Color::Reset) OVERRIDE { + void reportOut(const std::string &outmsg, Color = Color::Reset) override { next->reportOut(outmsg); } - void reportErr(const ErrorMessage &msg) OVERRIDE { + void reportErr(const ErrorMessage &msg) override { if (!msg.callStack.empty() && !settings.nomsg.isSuppressed(msg.toSuppressionsErrorMessage())) next->reportErr(msg); } diff --git a/test/testvaarg.cpp b/test/testvaarg.cpp index cc0ac9c11f0..f82ff8a317e 100644 --- a/test/testvaarg.cpp +++ b/test/testvaarg.cpp @@ -48,7 +48,7 @@ class TestVaarg : public TestFixture { checkVaarg.runChecks(&tokenizer, &settings, this); } - void run() OVERRIDE { + void run() override { settings.severity.enable(Severity::warning); TEST_CASE(wrongParameterTo_va_start); diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index 38a27ad7ef7..32bae6b14d4 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -50,7 +50,7 @@ class TestValueFlow : public TestFixture { private: Settings settings; - void run() OVERRIDE { + void run() override { // strcpy, abort cfg const char cfg[] = "\n" "\n" diff --git a/test/testvarid.cpp b/test/testvarid.cpp index 773a5296187..e462c80a841 100644 --- a/test/testvarid.cpp +++ b/test/testvarid.cpp @@ -36,7 +36,7 @@ class TestVarID : public TestFixture { TestVarID() : TestFixture("TestVarID") {} private: - void run() OVERRIDE { + void run() override { TEST_CASE(varid1); TEST_CASE(varid2); TEST_CASE(varid3); From 0a71abddaee83cf3ddad2ecd469add76055b1728 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 28 Jan 2022 13:48:30 +0100 Subject: [PATCH 2/2] cleaned up includes based on include-what-you-use --- cli/cppcheckexecutor.h | 1 - cli/threadexecutor.h | 1 - test/test64bit.cpp | 1 - test/testassert.cpp | 1 - test/testastutils.cpp | 1 - test/testautovariables.cpp | 1 - test/testbool.cpp | 1 - test/testboost.cpp | 1 - test/testbufferoverrun.cpp | 1 - test/testbughuntingchecks.cpp | 1 - test/testcharvar.cpp | 1 - test/testclangimport.cpp | 1 - test/testclass.cpp | 1 - test/testcmdlineparser.cpp | 1 - test/testcondition.cpp | 1 - test/testconstructors.cpp | 1 - test/testcppcheck.cpp | 1 - test/testexceptionsafety.cpp | 1 - test/testexprengine.cpp | 1 - test/testfilelister.cpp | 1 - test/testfunctions.cpp | 1 - test/testgarbage.cpp | 1 - test/testimportproject.cpp | 1 - test/testincompletestatement.cpp | 1 - test/testleakautovar.cpp | 1 - test/testlibrary.cpp | 1 - test/testmathlib.cpp | 1 - test/testmemleak.cpp | 1 - test/testnullpointer.cpp | 1 - test/testoptions.cpp | 1 - test/testother.cpp | 1 - test/testpath.cpp | 1 - test/testpathmatch.cpp | 1 - test/testplatform.cpp | 1 - test/testpostfixoperator.cpp | 1 - test/testpreprocessor.cpp | 1 - test/testsimplifytemplate.cpp | 1 - test/testsimplifytokens.cpp | 1 - test/testsimplifytypedef.cpp | 1 - test/testsimplifyusing.cpp | 1 - test/testsizeof.cpp | 1 - test/teststl.cpp | 1 - test/teststring.cpp | 1 - test/testsummaries.cpp | 1 - test/testsymboldatabase.cpp | 1 - test/testthreadexecutor.cpp | 1 - test/testtimer.cpp | 1 - test/testtoken.cpp | 1 - test/testtokenlist.cpp | 1 - test/testtokenrange.cpp | 1 - test/testtype.cpp | 1 - test/testuninitvar.cpp | 1 - test/testunusedfunctions.cpp | 1 - test/testunusedprivfunc.cpp | 1 - test/testunusedvar.cpp | 1 - test/testutils.h | 1 - test/testvaarg.cpp | 1 - test/testvalueflow.cpp | 1 - test/testvarid.cpp | 1 - 59 files changed, 59 deletions(-) diff --git a/cli/cppcheckexecutor.h b/cli/cppcheckexecutor.h index dbfd8aa102e..73e01d6f1e9 100644 --- a/cli/cppcheckexecutor.h +++ b/cli/cppcheckexecutor.h @@ -20,7 +20,6 @@ #define CPPCHECKEXECUTOR_H #include "color.h" -#include "config.h" #include "errorlogger.h" #include diff --git a/cli/threadexecutor.h b/cli/threadexecutor.h index 5a15a53a17a..6409501863a 100644 --- a/cli/threadexecutor.h +++ b/cli/threadexecutor.h @@ -20,7 +20,6 @@ #define THREADEXECUTOR_H #include "color.h" -#include "config.h" #include "errorlogger.h" #include diff --git a/test/test64bit.cpp b/test/test64bit.cpp index c72dfce8b9f..21c77231af4 100644 --- a/test/test64bit.cpp +++ b/test/test64bit.cpp @@ -18,7 +18,6 @@ #include "check64bit.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testassert.cpp b/test/testassert.cpp index 3b64c6ed06d..0a326b19777 100644 --- a/test/testassert.cpp +++ b/test/testassert.cpp @@ -18,7 +18,6 @@ #include "checkassert.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testastutils.cpp b/test/testastutils.cpp index 51f711404d2..0f756415215 100644 --- a/test/testastutils.cpp +++ b/test/testastutils.cpp @@ -18,7 +18,6 @@ #include "astutils.h" -#include "config.h" #include "library.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testautovariables.cpp b/test/testautovariables.cpp index a9760099888..20b33545714 100644 --- a/test/testautovariables.cpp +++ b/test/testautovariables.cpp @@ -18,7 +18,6 @@ #include "checkautovariables.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testbool.cpp b/test/testbool.cpp index c290e7e554a..009d0d0ebee 100644 --- a/test/testbool.cpp +++ b/test/testbool.cpp @@ -18,7 +18,6 @@ #include "checkbool.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testboost.cpp b/test/testboost.cpp index d7fddc571ce..14672c60ec4 100644 --- a/test/testboost.cpp +++ b/test/testboost.cpp @@ -18,7 +18,6 @@ #include "checkboost.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index 0b5003c1ad9..d14dce83539 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -19,7 +19,6 @@ #include "check.h" #include "checkbufferoverrun.h" -#include "config.h" #include "ctu.h" #include "errortypes.h" #include "standards.h" diff --git a/test/testbughuntingchecks.cpp b/test/testbughuntingchecks.cpp index 02b55705cab..3df321dbaae 100644 --- a/test/testbughuntingchecks.cpp +++ b/test/testbughuntingchecks.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "errortypes.h" #include "exprengine.h" #include "library.h" diff --git a/test/testcharvar.cpp b/test/testcharvar.cpp index 41db49c01f3..2b7910e338c 100644 --- a/test/testcharvar.cpp +++ b/test/testcharvar.cpp @@ -18,7 +18,6 @@ #include "checkother.h" -#include "config.h" #include "errortypes.h" #include "platform.h" #include "settings.h" diff --git a/test/testclangimport.cpp b/test/testclangimport.cpp index c66cccd155a..78222c3b74d 100644 --- a/test/testclangimport.cpp +++ b/test/testclangimport.cpp @@ -15,7 +15,6 @@ // along with this program. If not, see . #include "clangimport.h" -#include "config.h" #include "platform.h" #include "settings.h" #include "symboldatabase.h" diff --git a/test/testclass.cpp b/test/testclass.cpp index 951bdcce251..4b7beff609e 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -18,7 +18,6 @@ #include "check.h" #include "checkclass.h" -#include "config.h" #include "errortypes.h" #include "library.h" #include "settings.h" diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index e6236a6bdde..8708750951b 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -17,7 +17,6 @@ */ #include "cmdlineparser.h" -#include "config.h" #include "errortypes.h" #include "platform.h" #include "redirect.h" diff --git a/test/testcondition.cpp b/test/testcondition.cpp index a10410bec0b..e62bc3242b7 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -17,7 +17,6 @@ */ #include "checkcondition.h" -#include "config.h" #include "errortypes.h" #include "library.h" #include "platform.h" diff --git a/test/testconstructors.cpp b/test/testconstructors.cpp index 945778bee9e..bb0671ba3fc 100644 --- a/test/testconstructors.cpp +++ b/test/testconstructors.cpp @@ -18,7 +18,6 @@ #include "checkclass.h" -#include "config.h" #include "errortypes.h" #include "standards.h" #include "settings.h" diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index b608265d1ce..2b4a1a1a3fd 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -18,7 +18,6 @@ #include "check.h" #include "color.h" -#include "config.h" #include "cppcheck.h" #include "errorlogger.h" #include "testsuite.h" diff --git a/test/testexceptionsafety.cpp b/test/testexceptionsafety.cpp index 2065ecefe52..e27bd08dedb 100644 --- a/test/testexceptionsafety.cpp +++ b/test/testexceptionsafety.cpp @@ -18,7 +18,6 @@ #include "checkexceptionsafety.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testexprengine.cpp b/test/testexprengine.cpp index d17566a816f..f104021e37a 100644 --- a/test/testexprengine.cpp +++ b/test/testexprengine.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "exprengine.h" #include "library.h" #include "platform.h" diff --git a/test/testfilelister.cpp b/test/testfilelister.cpp index 23563d238bd..4ea91cabad9 100644 --- a/test/testfilelister.cpp +++ b/test/testfilelister.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "filelister.h" #include "pathmatch.h" #include "testsuite.h" diff --git a/test/testfunctions.cpp b/test/testfunctions.cpp index e25ed0fbceb..7c3ef63d877 100644 --- a/test/testfunctions.cpp +++ b/test/testfunctions.cpp @@ -17,7 +17,6 @@ */ #include "checkfunctions.h" -#include "config.h" #include "errortypes.h" #include "library.h" #include "settings.h" diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 6f7892b2c82..1bd5f73cfb6 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -17,7 +17,6 @@ */ #include "check.h" -#include "config.h" #include "errortypes.h" #include "mathlib.h" #include "settings.h" diff --git a/test/testimportproject.cpp b/test/testimportproject.cpp index 8fa95cdf386..8046f296af3 100644 --- a/test/testimportproject.cpp +++ b/test/testimportproject.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "importproject.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index dbac981596e..f5035888817 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -17,7 +17,6 @@ */ #include "checkother.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testleakautovar.cpp b/test/testleakautovar.cpp index aa7ceee64b3..77aec7a5a0d 100644 --- a/test/testleakautovar.cpp +++ b/test/testleakautovar.cpp @@ -18,7 +18,6 @@ #include "checkleakautovar.h" -#include "config.h" #include "errortypes.h" #include "library.h" #include "settings.h" diff --git a/test/testlibrary.cpp b/test/testlibrary.cpp index 647d0f10629..32c34ecbd40 100644 --- a/test/testlibrary.cpp +++ b/test/testlibrary.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "errortypes.h" #include "library.h" #include "settings.h" diff --git a/test/testmathlib.cpp b/test/testmathlib.cpp index cd1b6279b68..3167e4a5f2c 100644 --- a/test/testmathlib.cpp +++ b/test/testmathlib.cpp @@ -17,7 +17,6 @@ */ -#include "config.h" #include "mathlib.h" #include "testsuite.h" diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 18710b1d852..dc31e0179df 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -17,7 +17,6 @@ */ #include "checkmemoryleak.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "symboldatabase.h" diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 56c021de802..5d93cfe6cc8 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -18,7 +18,6 @@ #include "check.h" #include "checknullpointer.h" -#include "config.h" #include "ctu.h" #include "errortypes.h" #include "library.h" diff --git a/test/testoptions.cpp b/test/testoptions.cpp index 613bf4903ab..8d445c77934 100644 --- a/test/testoptions.cpp +++ b/test/testoptions.cpp @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#include "config.h" #include "options.h" #include "testsuite.h" diff --git a/test/testother.cpp b/test/testother.cpp index c8af1295e80..18f96310222 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -17,7 +17,6 @@ */ #include "checkother.h" -#include "config.h" #include "errortypes.h" #include "library.h" #include "platform.h" diff --git a/test/testpath.cpp b/test/testpath.cpp index 40e1340b6fe..c746695efe5 100644 --- a/test/testpath.cpp +++ b/test/testpath.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "path.h" #include "testsuite.h" diff --git a/test/testpathmatch.cpp b/test/testpathmatch.cpp index eefc8a680e5..7b6ec0fef44 100644 --- a/test/testpathmatch.cpp +++ b/test/testpathmatch.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "pathmatch.h" #include "testsuite.h" diff --git a/test/testplatform.cpp b/test/testplatform.cpp index 20a8360b7ea..f1f11b35e2b 100644 --- a/test/testplatform.cpp +++ b/test/testplatform.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "platform.h" #include "testsuite.h" diff --git a/test/testpostfixoperator.cpp b/test/testpostfixoperator.cpp index efff945bdb3..f3b9086aa41 100644 --- a/test/testpostfixoperator.cpp +++ b/test/testpostfixoperator.cpp @@ -18,7 +18,6 @@ #include "checkpostfixoperator.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 670efc06702..776de5f0609 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -20,7 +20,6 @@ // The preprocessor that Cppcheck uses is a bit special. Instead of generating // the code for a known configuration, it generates the code for each configuration. -#include "config.h" #include "errortypes.h" #include "platform.h" #include "preprocessor.h" diff --git a/test/testsimplifytemplate.cpp b/test/testsimplifytemplate.cpp index e4294d5aa1d..f3e9eb75d48 100644 --- a/test/testsimplifytemplate.cpp +++ b/test/testsimplifytemplate.cpp @@ -17,7 +17,6 @@ */ -#include "config.h" #include "errortypes.h" #include "platform.h" #include "settings.h" diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 04bb9f25722..05d927752cc 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "errortypes.h" #include "platform.h" #include "settings.h" diff --git a/test/testsimplifytypedef.cpp b/test/testsimplifytypedef.cpp index 53a1a8a6af6..ce288ccd276 100644 --- a/test/testsimplifytypedef.cpp +++ b/test/testsimplifytypedef.cpp @@ -17,7 +17,6 @@ */ -#include "config.h" #include "errortypes.h" #include "platform.h" #include "settings.h" diff --git a/test/testsimplifyusing.cpp b/test/testsimplifyusing.cpp index 83d92b6772c..272bde01239 100644 --- a/test/testsimplifyusing.cpp +++ b/test/testsimplifyusing.cpp @@ -17,7 +17,6 @@ */ -#include "config.h" #include "errortypes.h" #include "platform.h" #include "settings.h" diff --git a/test/testsizeof.cpp b/test/testsizeof.cpp index 4b89486e217..a4aa81c89a8 100644 --- a/test/testsizeof.cpp +++ b/test/testsizeof.cpp @@ -17,7 +17,6 @@ */ #include "checksizeof.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/teststl.cpp b/test/teststl.cpp index 028804e6a99..f17efce9394 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -17,7 +17,6 @@ */ #include "checkstl.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "standards.h" diff --git a/test/teststring.cpp b/test/teststring.cpp index 44ea0a1467a..9323b0b0bca 100644 --- a/test/teststring.cpp +++ b/test/teststring.cpp @@ -18,7 +18,6 @@ #include "checkstring.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testsummaries.cpp b/test/testsummaries.cpp index c3230a8bfa9..5f9d5cf391d 100644 --- a/test/testsummaries.cpp +++ b/test/testsummaries.cpp @@ -17,7 +17,6 @@ */ -#include "config.h" #include "settings.h" #include "summaries.h" #include "testsuite.h" diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 6859a0f3f44..6e808ebacac 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "library.h" #include "platform.h" #include "settings.h" diff --git a/test/testthreadexecutor.cpp b/test/testthreadexecutor.cpp index a1ba87c0b90..d4cccf147d7 100644 --- a/test/testthreadexecutor.cpp +++ b/test/testthreadexecutor.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "settings.h" #include "testsuite.h" #include "threadexecutor.h" diff --git a/test/testtimer.cpp b/test/testtimer.cpp index 97c58ce78a2..0eff88bb0ed 100644 --- a/test/testtimer.cpp +++ b/test/testtimer.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "testsuite.h" #include "timer.h" diff --git a/test/testtoken.cpp b/test/testtoken.cpp index 67255114ac1..59afa2b8b43 100644 --- a/test/testtoken.cpp +++ b/test/testtoken.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "settings.h" #include "testsuite.h" #include "testutils.h" diff --git a/test/testtokenlist.cpp b/test/testtokenlist.cpp index 515caaf8ddd..836b086e507 100644 --- a/test/testtokenlist.cpp +++ b/test/testtokenlist.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "settings.h" #include "testsuite.h" #include "token.h" diff --git a/test/testtokenrange.cpp b/test/testtokenrange.cpp index 0cd6955ba00..30f07f3971a 100644 --- a/test/testtokenrange.cpp +++ b/test/testtokenrange.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "settings.h" #include "testsuite.h" #include "token.h" diff --git a/test/testtype.cpp b/test/testtype.cpp index 8e8581a62a0..fc0143ab7e6 100644 --- a/test/testtype.cpp +++ b/test/testtype.cpp @@ -17,7 +17,6 @@ */ #include "checktype.h" -#include "config.h" #include "errortypes.h" #include "platform.h" #include "settings.h" diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index 3f23e4cb06c..68a2acec2cc 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -18,7 +18,6 @@ #include "check.h" #include "checkuninitvar.h" -#include "config.h" #include "ctu.h" #include "errortypes.h" #include "library.h" diff --git a/test/testunusedfunctions.cpp b/test/testunusedfunctions.cpp index 70d4c7c3560..590ce2b0e15 100644 --- a/test/testunusedfunctions.cpp +++ b/test/testunusedfunctions.cpp @@ -17,7 +17,6 @@ */ #include "checkunusedfunctions.h" -#include "config.h" #include "errortypes.h" #include "platform.h" #include "settings.h" diff --git a/test/testunusedprivfunc.cpp b/test/testunusedprivfunc.cpp index 97aeb40fad1..34f022a1b47 100644 --- a/test/testunusedprivfunc.cpp +++ b/test/testunusedprivfunc.cpp @@ -17,7 +17,6 @@ */ #include "checkclass.h" -#include "config.h" #include "errortypes.h" #include "platform.h" #include "settings.h" diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index 9cccd96ef04..2b7cf4e0bdd 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -17,7 +17,6 @@ */ #include "checkunusedvar.h" -#include "config.h" #include "errortypes.h" #include "preprocessor.h" #include "settings.h" diff --git a/test/testutils.h b/test/testutils.h index 85c3629659d..dda423f6319 100644 --- a/test/testutils.h +++ b/test/testutils.h @@ -20,7 +20,6 @@ #define TestUtilsH #include "color.h" -#include "config.h" #include "errorlogger.h" #include "settings.h" #include "suppressions.h" diff --git a/test/testvaarg.cpp b/test/testvaarg.cpp index f82ff8a317e..63511d345b1 100644 --- a/test/testvaarg.cpp +++ b/test/testvaarg.cpp @@ -18,7 +18,6 @@ #include "checkvaarg.h" -#include "config.h" #include "errortypes.h" #include "settings.h" #include "testsuite.h" diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index 32bae6b14d4..39edf704684 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "library.h" #include "mathlib.h" #include "platform.h" diff --git a/test/testvarid.cpp b/test/testvarid.cpp index e462c80a841..1c43e960637 100644 --- a/test/testvarid.cpp +++ b/test/testvarid.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "config.h" #include "mathlib.h" #include "platform.h" #include "settings.h"