diff --git a/TUNING.md b/TUNING.md index 4643e7d506a..ba1f7f49738 100644 --- a/TUNING.md +++ b/TUNING.md @@ -46,7 +46,7 @@ In our case Clang is mostly faster than GCC. See https://trac.cppcheck.net/ticke ### Use More Advanced Optimizations -By default we enforce the `-O2` optimization level. Even when using the `Release` build type in CMake which defaults to `-O3`. It might be possible that building with `-O3` might yield a perfomance increase. +By default we enforce the `-O2` optimization level. Even when using the `Release` build type in CMake which defaults to `-O3`. It might be possible that building with `-O3` might yield a performance increase. There are also no additional code generation flags provided so the resulting binary can run on any system. You might be able to tune this and apply more optimization which is tailored to the system you will be running the binary on. diff --git a/addons/cppcheckdata.py b/addons/cppcheckdata.py index dbe36d56a57..06028e2005c 100755 --- a/addons/cppcheckdata.py +++ b/addons/cppcheckdata.py @@ -274,7 +274,7 @@ class Token: astParent ast parent astOperand1 ast operand1 astOperand2 ast operand2 - orriginalName orriginal name of the token + orriginalName original name of the token valueType type information: container/.. file file name linenr line number @@ -1003,7 +1003,7 @@ def isMatch(self, file, line, message, errorId): and (self.symbolName is None or fnmatch(message, '*'+self.symbolName+'*')) and fnmatch(errorId, self.errorId)): return True - # Other Suppression (Globaly set via suppression file or cli command) + # Other Suppression (Globally set via suppression file or cli command) if ((self.fileName is None or fnmatch(file, self.fileName)) and (self.suppressionType is None) and (self.symbolName is None or fnmatch(message, '*'+self.symbolName+'*')) diff --git a/addons/test/misra/crash10.c b/addons/test/misra/crash10.c index 455d86e57ec..65e3a14ac96 100644 --- a/addons/test/misra/crash10.c +++ b/addons/test/misra/crash10.c @@ -2,7 +2,7 @@ extern uint32_t end; -//#define KEEP // if uncomment this then wont crash +//#define KEEP // if uncomment this then won't crash KEEP static const int32_t ptr_to_end = &end; diff --git a/clang-tidy.md b/clang-tidy.md index aae6918e372..d28aac8f59a 100644 --- a/clang-tidy.md +++ b/clang-tidy.md @@ -187,7 +187,7 @@ We are currently using our own `naming.json` to enforce naming schemes. Also dis `portability-simd-intrinsics`
-We are not using SIMD instructions and it suggests to use `std::experiemental::` features which might not be commonly available. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132. +We are not using SIMD instructions and it suggests to use `std::experimental::` features which might not be commonly available. Also disabled for performance reasons - see https://github.com/llvm/llvm-project/issues/57527#issuecomment-1237935132. `modernize-macro-to-enum`
diff --git a/cli/filelister.cpp b/cli/filelister.cpp index 24acc186818..65a77ea6306 100644 --- a/cli/filelister.cpp +++ b/cli/filelister.cpp @@ -172,7 +172,7 @@ std::string FileLister::addFiles(std::list &files, const std::s std::string err = addFiles2(filesSorted, path, extra, recursive, ignored, debug); - // files need to be sorted as the filesystems dosn't provide a stable order + // files need to be sorted as the filesystems doesn't provide a stable order filesSorted.sort([](const FileWithDetails& a, const FileWithDetails& b) { return a.path() < b.path(); }); @@ -293,7 +293,7 @@ std::string FileLister::addFiles(std::list &files, const std::s std::string err = addFiles2(filesSorted, corrected_path, extra, recursive, ignored, debug); - // files need to be sorted as the filesystems dosn't provide a stable order + // files need to be sorted as the filesystems doesn't provide a stable order filesSorted.sort([](const FileWithDetails& a, const FileWithDetails& b) { return a.path() < b.path(); }); diff --git a/cli/processexecutor.cpp b/cli/processexecutor.cpp index 7b750fdc26b..7f3a15e68c0 100644 --- a/cli/processexecutor.cpp +++ b/cli/processexecutor.cpp @@ -449,7 +449,7 @@ unsigned int ProcessExecutor::check() } } - // TODO: wee need to get the timing information from the subprocess + // TODO: we need to get the timing information from the subprocess if (mTimerResults && (mSettings.showtime == ShowTime::SUMMARY || mSettings.showtime == ShowTime::TOP5_SUMMARY)) mTimerResults->showResults(mSettings.showtime); diff --git a/cmake/options.cmake b/cmake/options.cmake index 07c6f8d771d..854985906f7 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -140,7 +140,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) string(LENGTH "${FILESDIR}" _filesdir_len) # override FILESDIR if it is set or empty if(FILESDIR OR ${_filesdir_len} EQUAL 0) -# TODO: verify that it is an abolute path? +# TODO: verify that it is an absolute path? set(FILESDIR_DEF ${FILESDIR}) else() set(FILESDIR_DEF ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME} CACHE STRING "Cppcheck files directory") diff --git a/cppcheckpremium-suppressions b/cppcheckpremium-suppressions index 6d3f16782bc..1b26fa55cc1 100644 --- a/cppcheckpremium-suppressions +++ b/cppcheckpremium-suppressions @@ -196,7 +196,7 @@ premium-misra-cpp-2023-12.3.1 # TODO ensure overrides match premium-misra-cpp-2023-13.3.2 -# TODO use the same parameter names in overriden methods. +# TODO use the same parameter names in overridden methods. premium-misra-cpp-2023-13.3.3 # we sometimes use both public/private data members by intention diff --git a/externals/simplecpp/simplecpp.h b/externals/simplecpp/simplecpp.h index 54f6a90c053..d499b132b69 100644 --- a/externals/simplecpp/simplecpp.h +++ b/externals/simplecpp/simplecpp.h @@ -83,7 +83,7 @@ namespace simplecpp { , mSize(strlen(data)) {} - // only provide when std::span is not available so using untyped initilization won't use View + // only provide when std::span is not available so using untyped initialization won't use View #if !defined(__cpp_lib_span) View(const char* data, std::size_t size) : mData(data) diff --git a/gui/main.cpp b/gui/main.cpp index 830cb29a72d..efdb2a33c72 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -124,7 +124,7 @@ static void ShowUsage() static void ShowVersion() { -// TODO: should only *not* show a dialog when we are on a commnd-line +// TODO: should only *not* show a dialog when we are on a command-line #if defined(_WIN32) AboutDialog *dlg = new AboutDialog(CppCheck::version(), CppCheck::extraVersion(), 0); dlg->exec(); diff --git a/lib/astutils.cpp b/lib/astutils.cpp index 2d53ef0b0c1..8e4910b40a0 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -2692,7 +2692,7 @@ bool isVariableChanged(const Token *tok, int indirect, const Settings &settings, if (isVariableChanged(tok2->astParent(), indirect + 1, settings, depth - 1)) return true; } else { - // If its already const then it cant be modified + // If its already const then it can't be modified if (vt && vt->isConst(indirect)) return false; } diff --git a/lib/checkclass.h b/lib/checkclass.h index 9a2d42442a9..1276b212518 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -125,7 +125,7 @@ class CPPCHECKLIB CheckClass : public Check { /** @brief Check that the override keyword is used when overriding virtual functions */ void checkOverride(); - /** @brief Check that the overriden function is not identical to the base function */ + /** @brief Check that the overridden function is not identical to the base function */ void checkUselessOverride(); /** @brief Check that large members are returned by reference from getter function */ diff --git a/lib/checkersreport.cpp b/lib/checkersreport.cpp index 59b3cf99495..efd856ea1f8 100644 --- a/lib/checkersreport.cpp +++ b/lib/checkersreport.cpp @@ -170,7 +170,7 @@ std::string CheckersReport::getReport(const std::string& criticalErrors) const // TODO: mention "information" and "debug" as source for indications of bailouts // TODO: still rephrase this - this message does not provides confidence in the results // TODO: document what a bailout is and why it is done - mention it in the upcoming security/tuning guide - // TODO: make bailouts a seperate group - need to differentiate between user bailouts (missing data like configuration/includes) and internal bailouts (e.g. limitations of ValueFlow) + // TODO: make bailouts a separate group - need to differentiate between user bailouts (missing data like configuration/includes) and internal bailouts (e.g. limitations of ValueFlow) fout << "Note: There might still have been non-critical bailouts which might lead to false negatives." << std::endl; } diff --git a/lib/cppcheck.h b/lib/cppcheck.h index 2aeee1a0beb..94f2b721037 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -208,7 +208,7 @@ class CPPCHECKLIB CppCheck { /** * @brief Check normal tokens * @param tokenizer tokenizer instance - * @param analyzerInformation the analyzer infomation + * @param analyzerInformation the analyzer information */ void checkNormalTokens(const Tokenizer &tokenizer, AnalyzerInformation* analyzerInformation, const std::string& currentConfig); diff --git a/lib/errorlogger.h b/lib/errorlogger.h index 8c86224aa0f..acc250da9b4 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -334,12 +334,12 @@ CPPCHECKLIB void substituteTemplateLocationStatic(std::string& templateLocation, /** Get a classification string from the given guideline and reporttype */ CPPCHECKLIB std::string getClassification(const std::string &guideline, ReportType reportType); -/** Get a guidline string froM the given error id, reporttype, mapping and severity */ +/** Get a guideline string froM the given error id, reporttype, mapping and severity */ CPPCHECKLIB std::string getGuideline(const std::string &errId, ReportType reportType, const std::map &guidelineMapping, Severity severity); -/** Get a map from cppcheck error ids to guidlines matching the given report type */ +/** Get a map from cppcheck error ids to guidelines matching the given report type */ CPPCHECKLIB std::map createGuidelineMapping(ReportType reportType); /// @} diff --git a/lib/mathlib.h b/lib/mathlib.h index d4cc344ee7a..9b6b304501c 100644 --- a/lib/mathlib.h +++ b/lib/mathlib.h @@ -75,7 +75,7 @@ class CPPCHECKLIB MathLib { } /** - * @throws InternalError thrown on invalid/unhandled calculation or divison by zero + * @throws InternalError thrown on invalid/unhandled calculation or division by zero */ static value calc(char op, const value &v1, const value &v2); int compare(const value &v) const; @@ -138,7 +138,7 @@ class CPPCHECKLIB MathLib { static std::string subtract(const std::string & first, const std::string & second); static std::string multiply(const std::string & first, const std::string & second); /** - * @throws InternalError thrown on overflow or divison by zero + * @throws InternalError thrown on overflow or division by zero */ static std::string divide(const std::string & first, const std::string & second); /** diff --git a/lib/path.cpp b/lib/path.cpp index 4f18192c7c0..0e6e5e8ae9c 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -387,7 +387,7 @@ std::string Path::getAbsoluteFilePath(const std::string& filePath) if (absolute) absolute_path = absolute; free(absolute); - // only throw on realpath() fialure to resolve a path when the given one was non-existent + // only throw on realpath() failure to resolve a path when the given one was non-existent if (!spath.empty() && absolute_path.empty() && !exists(spath)) throw std::runtime_error("path '" + filePath + "' does not exist"); #else diff --git a/lib/pathmatch.cpp b/lib/pathmatch.cpp index 90844befa82..87420828f17 100644 --- a/lib/pathmatch.cpp +++ b/lib/pathmatch.cpp @@ -145,7 +145,7 @@ bool PathMatch::match(const std::string &pattern, const std::string &path, const continue; } - /* No more path seperators to try from */ + /* No more path separators to try from */ return false; } } diff --git a/lib/pathmatch.h b/lib/pathmatch.h index b196528245c..33d9a64ec90 100644 --- a/lib/pathmatch.h +++ b/lib/pathmatch.h @@ -324,7 +324,7 @@ class PathMatch::PathIterator { return c == '/' || (syntax == Syntax::windows && c == '\\'); } - /* Syntax helper, check if a chracter is a drive letter */ + /* Syntax helper, check if a character is a drive letter */ static bool isdrive(char c) { return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'); diff --git a/lib/programmemory.cpp b/lib/programmemory.cpp index 750fd6653e0..889826380db 100644 --- a/lib/programmemory.cpp +++ b/lib/programmemory.cpp @@ -194,7 +194,7 @@ void ProgramMemory::erase_if(const std::function& pred if (mValues->empty()) return; - // TODO: how to delay until we actuallly modify? + // TODO: how to delay until we actually modify? copyOnWrite(); for (auto it = mValues->begin(); it != mValues->end();) { diff --git a/lib/settings.h b/lib/settings.h index 24fa2e93907..0afb0a1f567 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -477,7 +477,7 @@ class CPPCHECKLIB WARN_UNUSED Settings { /** @brief the maximum iterations to execute */ std::size_t maxIterations = 4; - /** @brief maximum numer if-branches */ + /** @brief maximum number if-branches */ int maxIfCount = -1; /** @brief maximum number of sets of arguments to pass to subfuncions */ diff --git a/lib/utils.h b/lib/utils.h index abe1477a2a8..da1981190c3 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -403,10 +403,10 @@ static inline T* empty_if_null(T* p) } /** - * Split string by given sperator. + * Split string by given separator. * @param str The string to split - * @param sep The seperator - * @return The list of seperate strings (including empty ones). The whole input string if no seperator found. + * @param sep The separator + * @return The list of separate strings (including empty ones). The whole input string if no separator found. */ CPPCHECKLIB std::vector splitString(const std::string& str, char sep); diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index bf732566fff..0a2a7da146a 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -504,7 +504,7 @@ static std::vector evaluateType(const Token* start, const Token* e return {}; result.insert(result.end(), inner.begin(), inner.end()); } else { - // We cant evaluate the decltype so bail + // We can't evaluate the decltype so bail return {}; } tok = tok->linkAt(1); diff --git a/man/checkers/cstyleCast.md b/man/checkers/cstyleCast.md index 52da49adad2..f05a192ced8 100644 --- a/man/checkers/cstyleCast.md +++ b/man/checkers/cstyleCast.md @@ -31,7 +31,7 @@ The motivation of this checker is to modernize c++ code. You can use C++ casts such as `static_cast` to fix these warnings. -The `dynamic_cast` should rarelly be used to fix these warnings because dangerousTypeCast is +The `dynamic_cast` should rarely be used to fix these warnings because dangerousTypeCast is reported when that can be a good idea. Before: diff --git a/man/checkers/truncLongCast.md b/man/checkers/truncLongCast.md index 7157a5b6627..f6ecd6ea77c 100644 --- a/man/checkers/truncLongCast.md +++ b/man/checkers/truncLongCast.md @@ -8,7 +8,7 @@ ## Description This checker warns when a calculation has type 'int' and it could potentially overflow that and the result is implicitly or explicitly converted to a larger -integer type after the loss of information has already occured. +integer type after the loss of information has already occurred. ## Motivation diff --git a/test/cfg/qt.cpp b/test/cfg/qt.cpp index d508eeef487..060ffc5a218 100644 --- a/test/cfg/qt.cpp +++ b/test/cfg/qt.cpp @@ -33,7 +33,7 @@ #include #include -// TODO: this is actually avilable via Core5Compat but I could not get it to work with pkg-config +// TODO: this is actually available via Core5Compat but I could not get it to work with pkg-config #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #include #endif diff --git a/test/testpath.cpp b/test/testpath.cpp index 2d937950646..44dea302762 100644 --- a/test/testpath.cpp +++ b/test/testpath.cpp @@ -315,7 +315,7 @@ class TestPath : public TestFixture { ASSERT_EQUALS(Standards::Language::CPP, Path::identify("/mnt/c/foo/index.cpp", false)); ASSERT_EQUALS(Standards::Language::CPP, Path::identify("/mnt/c/foo/index.Cpp", false)); - // TODO: check for case-insenstive filesystem instead + // TODO: check for case-insensitive filesystem instead // In unix .C is considered C++ #if !defined(_WIN32) && !(defined(__APPLE__) && defined(__MACH__)) ASSERT_EQUALS(Standards::Language::CPP, Path::identify("index.C", false)); diff --git a/test/testpathmatch.cpp b/test/testpathmatch.cpp index 31cc5e687b6..7e721502a11 100644 --- a/test/testpathmatch.cpp +++ b/test/testpathmatch.cpp @@ -296,7 +296,7 @@ class TestPathMatch : public TestFixture { ASSERT_EQUALS("", PathIterator(nullptr, "", unix).read()); ASSERT_EQUALS("", PathIterator(nullptr, nullptr, unix).read()); ASSERT_EQUALS("c:", PathIterator("C:", nullptr, windows).read()); - /* C: without slash is a bit ambigous. It should probably not be considered a root because it's + /* C: without slash is a bit ambiguous. It should probably not be considered a root because it's * not fully qualified (it designates the current directory on the C drive), * so this test could be considered to be unspecified behavior. */ ASSERT_EQUALS("c:", PathIterator("C:", "../..", windows).read()); diff --git a/test/testsimplifytypedef.cpp b/test/testsimplifytypedef.cpp index 12ee24ee5e1..e8dead73143 100644 --- a/test/testsimplifytypedef.cpp +++ b/test/testsimplifytypedef.cpp @@ -4507,7 +4507,7 @@ class TestSimplifyTypedef : public TestFixture { // Search for the simplified short token and check its original Name, start from front to get the variable in the struct token = Token::findsimplematch(tokenizer.list.front(), "short", tokenizer.list.back()); ASSERT_EQUALS("int16_t", token->originalName()); - // Search for the simplified * token -> function pointer gets "(*" tokens infront of it + // Search for the simplified * token -> function pointer gets "(*" tokens in front of it token = Token::findsimplematch(endOfTypeDef, "*", tokenizer.list.back()); ASSERT_EQUALS("rFunctionPointer_fp", token->originalName()); }