diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 70dd37cdc1c3..10e6c74245ce 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -624,7 +624,7 @@ int CppCheckExecutor::executeCommand(std::string exe, std::vector a #else const int res = pclose(p); #endif - if (res == -1) { // error occured + if (res == -1) { // error occurred // TODO: how to provide to caller? //const int err = errno; //std::cout << "pclose() errno " << std::to_string(err) << std::endl; diff --git a/cmake/clang_tidy.cmake b/cmake/clang_tidy.cmake index 679c14cdb1b4..996fe064a07d 100644 --- a/cmake/clang_tidy.cmake +++ b/cmake/clang_tidy.cmake @@ -1,5 +1,5 @@ if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS) - # clang-tidy and clang need to have the same version when precompiled headers are beign used + # clang-tidy and clang need to have the same version when precompiled headers are being used if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") string(REGEX MATCHALL "[0-9]+" _clang_ver_parts "${CMAKE_CXX_COMPILER_VERSION}") LIST(GET _clang_ver_parts 0 _clang_major) diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake index 38df5d106dd9..2a5352017594 100644 --- a/cmake/compileroptions.cmake +++ b/cmake/compileroptions.cmake @@ -187,7 +187,7 @@ if (MSVC) # Linker - General add_link_options($<$:/INCREMENTAL>) # Enable Incremental Linking - Yes - add_link_options(/NOLOGO) # SUppress Startup Banner - Yes + add_link_options(/NOLOGO) # Suppress Startup Banner - Yes # Ignore Import Library - Yes # Linker - Debugging diff --git a/externals/simplecpp/simplecpp.cpp b/externals/simplecpp/simplecpp.cpp index 804583396fcc..e84703d5c541 100755 --- a/externals/simplecpp/simplecpp.cpp +++ b/externals/simplecpp/simplecpp.cpp @@ -79,13 +79,13 @@ static bool isOct(const std::string &s) return s.size()>1 && (s[0]=='0') && (s[1] >= '0') && (s[1] < '8'); } -// TODO: added an undercore since this conflicts with a function of the same name in utils.h from Cppcheck source when building Cppcheck with MSBuild +// TODO: added an underscore since this conflicts with a function of the same name in utils.h from Cppcheck source when building Cppcheck with MSBuild static bool isStringLiteral_(const std::string &s) { return s.size() > 1 && (s[0]=='\"') && (*s.rbegin()=='\"'); } -// TODO: added an undercore since this conflicts with a function of the same name in utils.h from Cppcheck source when building Cppcheck with MSBuild +// TODO: added an underscore since this conflicts with a function of the same name in utils.h from Cppcheck source when building Cppcheck with MSBuild static bool isCharLiteral_(const std::string &s) { // char literal patterns can include 'a', '\t', '\000', '\xff', 'abcd', and maybe '' diff --git a/gui/codeeditor.cpp b/gui/codeeditor.cpp index ec7d79d4664b..2a195565df6f 100644 --- a/gui/codeeditor.cpp +++ b/gui/codeeditor.cpp @@ -152,7 +152,7 @@ Highlighter::Highlighter(QTextDocument *parent, mQuotationFormat.setForeground(mWidgetStyle->quoteColor); mQuotationFormat.setFontWeight(mWidgetStyle->quoteWeight); // We use lazy `*?` instead greed `*` quantifier to find the real end of the c-string. - // We use negative lookbehind assertion `(?getSymbolDatabase(); for (const Scope * scope : symbolDatabase->functionScopes) { for (const Token* tok = scope->bodyStart->next(); tok != scope->bodyEnd; tok = tok->next()) { diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index e07ffbe866c3..84c90786ce5e 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -1513,7 +1513,7 @@ void CheckStl::if_find() for (int j = 0; j < container->type_templateArgNo; j++) tok2 = tok2->nextTemplateArgument(); - container = mSettings->library.detectContainer(tok2); // innner container + container = mSettings->library.detectContainer(tok2); // inner container } else container = nullptr; } diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 6dbedeafc61b..967409981345 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -2833,7 +2833,7 @@ bool Function::argsMatch(const Scope *scope, const Token *first, const Token *se else if (openParen == 1 && second->str() == ")" && first->str() != ")") break; - // ckeck for type * x == type x[] + // check for type * x == type x[] else if (Token::Match(first->next(), "* %name%| ,|)|=") && Token::Match(second->next(), "%name%| [ ] ,|)")) { do { diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index b4c822defe39..b18db08c9051 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -876,7 +876,7 @@ void TemplateSimplifier::getTemplateInstantiations() size_t match = 0; size_t argMatch = 0; for (size_t i = 0; i < declarationParams.size(); ++i) { - // fixme: only type deducton from literals is supported + // fixme: only type deduction from literals is supported const bool isArgLiteral = Token::Match(instantiationArgs[i], "%num%|%str%|%char%|%bool% ,|)"); if (isArgLiteral && Token::Match(declarationParams[i], "const| %type% &| %name%| ,|)")) { match++; diff --git a/lib/token.h b/lib/token.h index 346364b40195..ea748914f3a7 100644 --- a/lib/token.h +++ b/lib/token.h @@ -1317,7 +1317,7 @@ class CPPCHECKLIB Token { fIsAttributeUsed = (1ULL << 14), // __attribute__((used)) fIsAttributePacked = (1ULL << 15), // __attribute__((packed)) fIsAttributeExport = (1ULL << 16), // __attribute__((__visibility__("default"))), __declspec(dllexport) - fIsAttributeMaybeUnused = (1ULL << 17), // [[maybe_unsed]] + fIsAttributeMaybeUnused = (1ULL << 17), // [[maybe_unused]] fIsAttributeNodiscard = (1ULL << 18), // __attribute__ ((warn_unused_result)), [[nodiscard]] fIsControlFlowKeyword = (1ULL << 19), // if/switch/while/... fIsOperatorKeyword = (1ULL << 20), // operator=, etc diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 9fa3ec3c57a8..f0a7f4801a87 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -3299,7 +3299,7 @@ struct SubExpressionAnalyzer : ExpressionAnalyzer { partialReads->emplace_back(tok, v); } - // No reanalysis for subexression + // No reanalysis for subexpression ValuePtr reanalyze(Token* /*tok*/, const std::string& /*msg*/) const override { return {}; } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 93d8b513dcf9..79c267628f85 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -36,7 +36,7 @@ if (BUILD_TESTS) target_link_libraries(testrunner cppcheck-core) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # $ is used in dinit() dessignated initialization helper + # $ is used in dinit() designated initialization helper target_compile_options_safe(testrunner -Wno-dollar-in-identifier-extension) endif() diff --git a/test/testimportproject.cpp b/test/testimportproject.cpp index 9e5709437411..48d3cdd813e5 100644 --- a/test/testimportproject.cpp +++ b/test/testimportproject.cpp @@ -52,8 +52,8 @@ class TestImportProject : public TestFixture { TEST_CASE(importCompileCommands2); // #8563, #9567 TEST_CASE(importCompileCommands3); // check with existing trailing / in directory TEST_CASE(importCompileCommands4); // only accept certain file types - TEST_CASE(importCompileCommands5); // Windows/CMake/Ninja generated comile_commands.json - TEST_CASE(importCompileCommands6); // Windows/CMake/Ninja generated comile_commands.json with spaces + TEST_CASE(importCompileCommands5); // Windows/CMake/Ninja generated compile_commands.json + TEST_CASE(importCompileCommands6); // Windows/CMake/Ninja generated compile_commands.json with spaces TEST_CASE(importCompileCommands7); // linux: "/home/danielm/cppcheck 2" TEST_CASE(importCompileCommands8); // Windows: "C:\Users\danielm\cppcheck" TEST_CASE(importCompileCommands9); diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 645ef3f4ef13..b1757014e713 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -382,7 +382,7 @@ class TestNullPointer : public TestFixture { // Dereferencing a struct and then checking if it is null // This is checked by this function: - // CheckOther::nullPointerStructByDeRefAndChec + // CheckOther::nullPointerStructByDeRefAndCheck void structDerefAndCheck() { // extracttests.start: struct ABC { int a; int b; int x; };