diff --git a/.clang-tidy b/.clang-tidy index 561eb87644f5f01a5242820c9bf0c351c6e432b8..b914e66b2dbd60a60b3c86493b0f09439fe15064 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -9,6 +9,7 @@ Checks: > -cert-err58-cpp, -clang-diagnostic-empty-translation-unit, -readability-braces-around-statements, + -readability-function-cognitive-complexity, -readability-implicit-bool-conversion, -readability-isolate-declaration, -readability-magic-numbers, diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 566199a5833532227224f7e1bf07bf56d0c4da87..081acca5c0089580f5716b85ae5932b407ea04f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: "flowdalic/debian-testing-dev:1.8" +image: "flowdalic/debian-testing-dev:1.10" before_script: - | diff --git a/apps/fsearch/fsearch.cpp b/apps/fsearch/fsearch.cpp index 238d26ec1b0b5668aa6891239399203e078a0e4a..09f479d1baf43222ad10a933e4ed99dcd9db069b 100644 --- a/apps/fsearch/fsearch.cpp +++ b/apps/fsearch/fsearch.cpp @@ -32,7 +32,7 @@ void search(const std::string& path) { } std::array<char, EMPER_RIPGREP_BUFSIZE> buf; - size_t bytes_searched = 0; + off_t bytes_searched = 0; ssize_t bytes_read = emper::io::readFileAndWait(fd, buf.data(), buf.size(), bytes_searched); while (bytes_read > 0) { @@ -41,7 +41,7 @@ void search(const std::string& path) { return; } - bytes_searched += static_cast<size_t>(bytes_read); + bytes_searched += bytes_read; bytes_read = emper::io::readFileAndWait(fd, buf.data(), buf.size(), -1); } diff --git a/emper/Context.hpp b/emper/Context.hpp index 9f1a9436d4171de854fb8794b8b28c598ef680c2..b1f7db6d6aedd280131fa6da192d95596dd808e7 100644 --- a/emper/Context.hpp +++ b/emper/Context.hpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright © 2020 Florian Schmaus +// Copyright © 2020-2021 Florian Schmaus #pragma once #include <cassert> // for assert @@ -82,6 +82,7 @@ class ALIGN_TO_CACHE_LINE Context : Logger<LogSubsystem::C> { // cppcheck-suppress noExplicitConstructor selfInitialization Context(func_t mainFunction) // Align the Top-of-Stack (tos) to 16 byte. + // NOLINTNEXTLINE(performance-no-int-to-ptr) : tos((void*)((uintptr_t)(context + CONTEXT_SIZE) & (~0xf))), mainFunction(std::move(std::move(mainFunction))) { // valgrindStackId = VALGRIND_STACK_REGISTER(context, context + CONTEXT_SI); diff --git a/emper/io/IoContext.cpp b/emper/io/IoContext.cpp index cc377625889291f666e280ae0c26e6cdfd70d6ea..bc5300f8b6cd81bc4c5ac4c8bb3079070eb8a9b2 100644 --- a/emper/io/IoContext.cpp +++ b/emper/io/IoContext.cpp @@ -188,7 +188,7 @@ auto IoContext::reapCompletions(ContinuationBuffer &continuationFibers) -> unsig unsigned reReapCount = 0; uint32_t maxRaceFreeCompleterAttempts = 1; - using Completion = std::pair<uint32_t, void *>; + using Completion = std::pair<int32_t, void *>; // vector to store seen cqes to make the critical section // where cq_lock is held as small as possible std::array<Completion, CQE_BATCH_COUNT> reapedCompletions; diff --git a/emper/lib/DebugUtil.cpp b/emper/lib/DebugUtil.cpp index 9b0d19e19180f097ddb05f66c499b87a2223d8ef..85bd93a354f16a9b28ce976df7e474a1e2f1e5e2 100644 --- a/emper/lib/DebugUtil.cpp +++ b/emper/lib/DebugUtil.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright © 2020 Florian Schmaus +// Copyright © 2020-2021 Florian Schmaus #include "DebugUtil.hpp" #include <execinfo.h> @@ -14,7 +14,7 @@ static void handler(int sig) { // NOLINTNEXTLINE(modernize-avoid-c-arrays) void* array[backtrace_size]; - size_t size = backtrace(array, backtrace_size); + int size = backtrace(array, backtrace_size); fprintf(stderr, "Error: signal %d:\n", sig); backtrace_symbols_fd(array, size, STDERR_FILENO);