From fced2e498d047c86fa6b6c03d1c5bc6313f35a75 Mon Sep 17 00:00:00 2001 From: Ibrahim Kuru Date: Thu, 16 Feb 2023 16:23:00 +0100 Subject: [PATCH 01/36] iox-#692 Move tsan jobs into build-test.yml Signed-off-by: Ibrahim Kuru --- .github/workflows/build-test.yml | 13 ++++++ .github/workflows/lint_master.yml | 18 -------- tools/ci/build-test-ubuntu-with-sanitizers.sh | 42 +++++++++++++++---- 3 files changed, 47 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/lint_master.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 2075c11f18..0db0ff5fa1 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -119,6 +119,19 @@ jobs: - name: Run Address Sanitizer run: ./tools/ci/build-test-macos-with-sanitizers.sh asan + build-test-ubuntu-with-thread-sanitizer-clang-latest: + # prevent stuck jobs consuming runners for 3 hours + timeout-minutes: 180 + runs-on: ubuntu-latest + needs: pre-flight-check + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install iceoryx dependencies and clang-tidy + uses: ./.github/actions/install-iceoryx-deps-and-clang + - name: Run Thread Sanitizer + run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh clang tsan + # gcc 5.4 is compiler used in QNX 7.0 build-test-ubuntu-with-gcc5: # prevent stuck jobs consuming runners for 6 hours diff --git a/.github/workflows/lint_master.yml b/.github/workflows/lint_master.yml deleted file mode 100644 index 959d01df9c..0000000000 --- a/.github/workflows/lint_master.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Code Linting on master branch - -on: - push: - branches: [ master ] - -jobs: - build-test-ubuntu-with-thread-sanitizer-clang-latest: - # prevent stuck jobs consuming runners for 3 hours - timeout-minutes: 180 - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install iceoryx dependencies and clang-tidy - uses: ./.github/actions/install-iceoryx-deps-and-clang - - name: Run Thread Sanitizer - run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh clang tsan diff --git a/tools/ci/build-test-ubuntu-with-sanitizers.sh b/tools/ci/build-test-ubuntu-with-sanitizers.sh index 68f4ee59ec..1c0e2453f3 100755 --- a/tools/ci/build-test-ubuntu-with-sanitizers.sh +++ b/tools/ci/build-test-ubuntu-with-sanitizers.sh @@ -19,13 +19,35 @@ set -e -COMPILER=${1:-gcc} -SANITIZER=${2:-asan} +COMPILER=gcc +SANITIZER=asan +SKIP_TEST=false + +while (( "$#" )); do + case "$1" in + "gcc"|"clang") + COMPILER=$1 + shift 1 + ;; + "asan"|"tsan") + SANITIZER=$1 + shift 1 + ;; + "skip-tests") + SKIP_TEST=true + shift 1 + ;; + esac +done msg() { printf "\033[1;32m%s: %s\033[0m\n" ${FUNCNAME[1]} "$1" } +msg "COMPILER : $COMPILER " +msg "SANITIZER : $SANITIZER " +msg "SKIP_TEST : $SKIP_TEST " + WORKSPACE=$(git rev-parse --show-toplevel) cd "${WORKSPACE}" @@ -49,11 +71,15 @@ if [ "$COMPILER" == "clang" ]; then ./tools/iceoryx_build_test.sh clean build-strict build-shared build-all clang debug $SANITIZER test-add-user out-of-tree fi -msg "running all tests" -cd ./build -if [ "$SANITIZER" == "tsan" ]; then - ./tools/run_tests.sh all continue-on-error +if [ "$SKIP_TEST" == "true" ]; then + msg "tests are skipped" else - ./tools/run_tests.sh all + msg "running all tests" + cd ./build + if [ "$SANITIZER" == "tsan" ]; then + ./tools/run_tests.sh all continue-on-error + else + ./tools/run_tests.sh all + fi + cd - fi -cd - From 002c0834cc9ac4227b6bc2f2a11459899adbec75 Mon Sep 17 00:00:00 2001 From: Ibrahim Kuru Date: Fri, 17 Feb 2023 18:22:15 +0100 Subject: [PATCH 02/36] iox-#692 Update suppression file Signed-off-by: Ibrahim Kuru --- iceoryx_hoofs/cmake/IceoryxPlatform.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iceoryx_hoofs/cmake/IceoryxPlatform.cmake b/iceoryx_hoofs/cmake/IceoryxPlatform.cmake index 863dc8d001..27f9dd7ae0 100644 --- a/iceoryx_hoofs/cmake/IceoryxPlatform.cmake +++ b/iceoryx_hoofs/cmake/IceoryxPlatform.cmake @@ -61,9 +61,11 @@ function(iox_create_tsan_runtime_blacklist BLACKLIST_FILE_PATH) # called_from_lib suppresses all interceptors in a particular library if(NOT EXISTS ${BLACKLIST_FILE_PATH}) file(WRITE ${BLACKLIST_FILE_PATH} "# This file is auto-generated from iceoryx_hoofs/cmake/IceoryxPlatform.cmake\n") - file(APPEND ${BLACKLIST_FILE_PATH} "mutex:*\n") + file(APPEND ${BLACKLIST_FILE_PATH} "mutex:*MutexWithDeadlockDetectionsFailsWhenSameThreadTriesToUnlockItTwice*\n") + file(APPEND ${BLACKLIST_FILE_PATH} "mutex:*MutexWithDeadlockDetectionsFailsWhenAnotherThreadTriesToUnlock*\n") + file(APPEND ${BLACKLIST_FILE_PATH} "mutex:*MutexWithStallWhenLockedBehaviorDoesntUnlockMutexWhenThreadTerminates*\n") file(APPEND ${BLACKLIST_FILE_PATH} "race:*\n") - file(APPEND ${BLACKLIST_FILE_PATH} "deadlock:*\n") + file(APPEND ${BLACKLIST_FILE_PATH} "deadlock:*TimingTest_AttachingInCallbackWorks*\n") file(APPEND ${BLACKLIST_FILE_PATH} "# End of file\n") endif() endfunction() From 87c9b191c467557e676f34a68c5fac39cc07afae Mon Sep 17 00:00:00 2001 From: Ibrahim Kuru Date: Thu, 23 Feb 2023 11:30:54 +0100 Subject: [PATCH 03/36] iox-#1913 Add missing test cases for vector and UninitializedArray Signed-off-by: Ibrahim Kuru --- .../test_container_uninitialized_array.cpp | 33 +++++++++++++++++++ .../moduletests/test_container_vector.cpp | 19 +++++++++++ 2 files changed, 52 insertions(+) diff --git a/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp b/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp index 48e54b6f85..71af5b1bc7 100644 --- a/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp +++ b/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp @@ -100,6 +100,39 @@ TEST(UninitializedArrayTest, capacityIsCorrect) EXPECT_EQ(sut.capacity(), capacity); } +TEST(UninitializedArrayTest, isNotCopyConstructible) +{ + ::testing::Test::RecordProperty("TEST_ID", "abc31a08-77b2-4fd2-af14-3129bafda00c"); + + bool is_copy_constructible = std::is_copy_constructible>::value; + EXPECT_FALSE(is_copy_constructible); +} + +TEST(UninitializedArrayTest, isNotCopyAssignable) +{ + ::testing::Test::RecordProperty("TEST_ID", "42c31a08-77b2-4fd2-6914-3129869da00c"); + + bool is_copy_assignable = std::is_copy_assignable>::value; + EXPECT_FALSE(is_copy_assignable); +} + + +TEST(UninitializedArrayTest, isNotMoveConstructible) +{ + ::testing::Test::RecordProperty("TEST_ID", "baf31a08-77b2-4692-6914-31298693100c"); + + bool is_move_constructible = std::is_move_constructible>::value; + EXPECT_FALSE(is_move_constructible); +} + +TEST(UninitializedArrayTest, isNotMoveAssignable) +{ + ::testing::Test::RecordProperty("TEST_ID", "caba1a08-77b2-4fd2-3114-3129842daa0c"); + + bool is_move_assignable = std::is_move_assignable>::value; + EXPECT_FALSE(is_move_assignable); +} + typedef ::testing::Types, UninitializedArray, UninitializedArray, diff --git a/iceoryx_hoofs/test/moduletests/test_container_vector.cpp b/iceoryx_hoofs/test/moduletests/test_container_vector.cpp index 8978f1a3b4..87d856bc26 100644 --- a/iceoryx_hoofs/test/moduletests/test_container_vector.cpp +++ b/iceoryx_hoofs/test/moduletests/test_container_vector.cpp @@ -15,6 +15,8 @@ // // SPDX-License-Identifier: Apache-2.0 +#include "iceoryx_hoofs/error_handling/error_handling.hpp" +#include "iceoryx_hoofs/testing/fatal_failure.hpp" #include "iox/vector.hpp" #include "test.hpp" @@ -24,6 +26,7 @@ namespace { using namespace ::testing; using namespace iox; +using namespace iox::testing; class vector_test : public Test { @@ -960,6 +963,22 @@ TEST_F(vector_test, EraseOfMiddleElementCallsDTorAndMove) EXPECT_THAT(moveAssignment, Eq(2U)); } +TEST_F(vector_test, AccessOfNonExistingElementWithAtLeadTermination) +{ + ::testing::Test::RecordProperty("TEST_ID", "31a4f0fb-31dd-4269-9bec-31ef0542c42b"); + EXPECT_THAT(sut.empty(), Eq(true)); + + IOX_EXPECT_FATAL_FAILURE([&] { sut.at(69); }, iox::HoofsError::EXPECTS_ENSURES_FAILED); +} + +TEST_F(vector_test, AccessOfNonExistingElementWithBracketLeadTermination) +{ + ::testing::Test::RecordProperty("TEST_ID", "69a4f0fb-3d31-4273-9bec-69ef05a4242b"); + EXPECT_THAT(sut.empty(), Eq(true)); + + IOX_EXPECT_FATAL_FAILURE([&] { sut[31]; }, iox::HoofsError::EXPECTS_ENSURES_FAILED); +} + TEST_F(vector_test, EraseOfFrontElementCallsDTorAndMove) { ::testing::Test::RecordProperty("TEST_ID", "a5ce9c6f-0bc0-474b-9cff-5f9d317b4f95"); From 5928e8b1945b0cb1aa1adcc7c9509950a04c54ed Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Tue, 21 Feb 2023 21:08:38 +0100 Subject: [PATCH 04/36] iox-#1394 Fix Axivion warnings in 'uninitialized_array' --- iceoryx_hoofs/container/include/iox/uninitialized_array.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp b/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp index eaea499a29..e7118ee868 100644 --- a/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp +++ b/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp @@ -77,10 +77,10 @@ class UninitializedArray final using iterator = ElementType*; using const_iterator = const ElementType*; + /// @deterministic // The (empty) user-defined constructor is required. // Use of "= default" leads to value-initialization of class members. - - /// @deterministic + // AXIVION Next Construct AutosarC++19_03-A12.6.1 : This is a low-level building block which is supposed to provide uninitialized memory constexpr UninitializedArray() noexcept {}; UninitializedArray(const UninitializedArray&) = delete; UninitializedArray(UninitializedArray&&) = delete; From 8b1a3a7cec665ee44e9256926562ff713616d420 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Tue, 21 Feb 2023 21:23:47 +0100 Subject: [PATCH 05/36] iox-#1394 Fix Axivion warnings in 'duration' --- iceoryx_hoofs/time/include/iox/detail/duration.inl | 9 ++++++--- iceoryx_hoofs/time/include/iox/duration.hpp | 6 +++--- iceoryx_hoofs/time/source/duration.cpp | 9 ++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/iceoryx_hoofs/time/include/iox/detail/duration.inl b/iceoryx_hoofs/time/include/iox/detail/duration.inl index 0dc4432f21..6994100e42 100644 --- a/iceoryx_hoofs/time/include/iox/detail/duration.inl +++ b/iceoryx_hoofs/time/include/iox/detail/duration.inl @@ -350,6 +350,7 @@ Duration::multiplyWith(const std::enable_if_t::value, // a second and m_seconds can hold 64 bits and the multiplicator is at max 64 bits // check if the result of the m_nanoseconds multiplication can easily be converted into a Duration + // AXIVION Next Construct AutosarC++19_03-M0.1.2, AutosarC++19_03-M0.1.9, FaultDetection-DeadBranches : False positive! Branching depends on input parameter if (m_nanoseconds <= maxBeforeOverflow) { return durationFromSeconds + Duration::fromNanoseconds(m_nanoseconds * multiplicator); @@ -466,8 +467,9 @@ Duration::multiplyWith(const std::enable_if_t::value, return durationFromSeconds + durationFromNanoseconds; } +// AXIVION Next Construct AutosarC++19_03-M5.17.1 : False positive! Corresponding assignment operator is implemented below template -inline constexpr Duration Duration::operator*(const T rhs) const noexcept +inline constexpr Duration Duration::operator*(const T& rhs) const noexcept { static_assert(std::is_arithmetic::value, "non arithmetic types are not supported for multiplication"); @@ -475,7 +477,7 @@ inline constexpr Duration Duration::operator*(const T rhs) const noexcept } template -inline constexpr Duration& Duration::operator*=(const T rhs) noexcept +inline constexpr Duration& Duration::operator*=(const T& rhs) noexcept { static_assert(std::is_arithmetic::value, "non arithmetic types are not supported for multiplication"); @@ -484,6 +486,7 @@ inline constexpr Duration& Duration::operator*=(const T rhs) noexcept return *this; } +// AXIVION Next Construct AutosarC++19_03-M5.17.1 : False positive! Corresponding assignment operator is implemented below // AXIVION Next Construct AutosarC++19_03-A8.4.7 : Each argument is larger than two words template inline constexpr Duration operator*(const T& lhs, const Duration& rhs) noexcept @@ -493,7 +496,7 @@ inline constexpr Duration operator*(const T& lhs, const Duration& rhs) noexcept // AXIVION Next Construct AutosarC++19_03-A8.4.7 : Each argument is larger than two words template -inline constexpr T& operator*=(const T&, const Duration&) noexcept +inline constexpr T& operator*=(T&, const Duration&) noexcept { static_assert( cxx::always_false_v, diff --git a/iceoryx_hoofs/time/include/iox/duration.hpp b/iceoryx_hoofs/time/include/iox/duration.hpp index d85c223eb0..35c4ebbb7e 100644 --- a/iceoryx_hoofs/time/include/iox/duration.hpp +++ b/iceoryx_hoofs/time/include/iox/duration.hpp @@ -235,7 +235,7 @@ class Duration /// divisor. /// @note Multiplication of a non-zero duration with NaN and +Inf results in a saturated max duration template - constexpr Duration operator*(const T rhs) const noexcept; + constexpr Duration operator*(const T& rhs) const noexcept; /// @brief Multiplies a Duration with an arithmetic type and assigns the result to itself. /// @tparam T is an arithmetic type for the multiplicator @@ -247,7 +247,7 @@ class Duration /// divisor. /// @note Multiplication of a non-zero duration with NaN and +Inf results in a saturated max duration template - constexpr Duration& operator*=(const T rhs) noexcept; + constexpr Duration& operator*=(const T& rhs) noexcept; // END ARITHMETIC @@ -373,7 +373,7 @@ constexpr Duration operator*(const T& lhs, const Duration& rhs) noexcept; /// multiplication with 'operator*=' to an arithmetic type is not supported // AXIVION Next Construct AutosarC++19_03-A8.4.7 : Each argument is larger than two words template -constexpr T& operator*=(const T& lhs, const Duration& rhs) noexcept; +constexpr T& operator*=(T& lhs, const Duration& rhs) noexcept; /// @brief stream operator for the Duration class std::ostream& operator<<(std::ostream& stream, const Duration t); diff --git a/iceoryx_hoofs/time/source/duration.cpp b/iceoryx_hoofs/time/source/duration.cpp index 08f14258b0..8c1bc0f093 100644 --- a/iceoryx_hoofs/time/source/duration.cpp +++ b/iceoryx_hoofs/time/source/duration.cpp @@ -50,11 +50,9 @@ struct timespec Duration::timespec(const TimeSpecReference reference) const noex }; // AXIVION Next Construct AutosarC++19_03-M0.1.2, AutosarC++19_03-M0.1.9, FaultDetection-DeadBranches : False positive! Branching depends on input parameter - if (posix::posixCall(clock_gettime)((reference == TimeSpecReference::Epoch) ? CLOCK_REALTIME : CLOCK_MONOTONIC, - &referenceTime) - .failureReturnValue(-1) - .evaluate() - .has_error()) + // AXIVION Next Construct AutosarC++19_03-M5.0.3: False positive! CLOCK_REALTIME and CLOCK_MONOTONIC are of type clockid_t + const clockid_t clockId{(reference == TimeSpecReference::Epoch) ? CLOCK_REALTIME : CLOCK_MONOTONIC}; + if (posix::posixCall(clock_gettime)(clockId, &referenceTime).failureReturnValue(-1).evaluate().has_error()) { return {0, 0}; } @@ -62,6 +60,7 @@ struct timespec Duration::timespec(const TimeSpecReference reference) const noex const auto targetTime = Duration(referenceTime) + *this; static_assert(sizeof(uint64_t) >= sizeof(SEC_TYPE), "casting might alter result"); + // AXIVION Next Construct AutosarC++19_03-M0.1.2, AutosarC++19_03-M0.1.9, FaultDetection-DeadBranches : False positive! Branching depends on input parameter if (targetTime.m_seconds > static_cast(std::numeric_limits::max())) { IOX_LOG(TRACE) << ": Result of conversion would overflow, clamping to max value!"; From c75ac4fce213255d0c4592c9f5936211d0109c71 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 22 Feb 2023 22:10:42 +0100 Subject: [PATCH 06/36] iox-#1394 Fix Axivion warnings in 'into' --- iceoryx_hoofs/utility/include/iox/detail/into.inl | 1 + iceoryx_hoofs/utility/include/iox/into.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/iceoryx_hoofs/utility/include/iox/detail/into.inl b/iceoryx_hoofs/utility/include/iox/detail/into.inl index 09ed95bb64..56043cbbc4 100644 --- a/iceoryx_hoofs/utility/include/iox/detail/into.inl +++ b/iceoryx_hoofs/utility/include/iox/detail/into.inl @@ -40,6 +40,7 @@ inline auto FromImpl::fromImpl(const SourceType&) n -------------------------------------------------------------------------"); } +// AXIVION Next Construct AutosarC++19_03-A15.5.3, AutosarC++19_03-A15.4.2, FaultDetection-NoexceptViolations : Intentional behavior. The library itself does not throw and on the implementation side a try-catch block can be used template inline constexpr typename detail::extract_into_type::type_t into(const SourceType value) noexcept { diff --git a/iceoryx_hoofs/utility/include/iox/into.hpp b/iceoryx_hoofs/utility/include/iox/into.hpp index 9fb49539cf..9be2ee8eb3 100644 --- a/iceoryx_hoofs/utility/include/iox/into.hpp +++ b/iceoryx_hoofs/utility/include/iox/into.hpp @@ -101,6 +101,7 @@ constexpr typename detail::extract_into_type::type_t from(const template struct FromImpl { + // AXIVION Next Construct AutosarC++19_03-A7.1.5 : 'auto' is only used for the generic implementation which will always result in a compile error static auto fromImpl(const SourceType& value) noexcept; }; From b304dcf3bf6c5cc5e93644c88982ad5be4f9be20 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 22 Feb 2023 22:14:37 +0100 Subject: [PATCH 07/36] iox-#1394 Fix Axivion warnings in 'memory' --- iceoryx_hoofs/memory/include/iox/memory.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iceoryx_hoofs/memory/include/iox/memory.hpp b/iceoryx_hoofs/memory/include/iox/memory.hpp index 915293a862..6e4638b5ab 100644 --- a/iceoryx_hoofs/memory/include/iox/memory.hpp +++ b/iceoryx_hoofs/memory/include/iox/memory.hpp @@ -56,8 +56,9 @@ template // AXIVION Next Construct AutosarC++19_03-A2.10.5 : The function is in the 'iox' namespace which prevents easy misuse constexpr std::size_t maxAlignment() noexcept { - auto remainingMaxAlignment = maxAlignment(); - return (alignof(T) > remainingMaxAlignment) ? alignof(T) : remainingMaxAlignment; + const std::size_t remainingMaxAlignment{maxAlignment()}; + const std::size_t currentTypeAligment{alignof(T)}; + return (currentTypeAligment > remainingMaxAlignment) ? currentTypeAligment : remainingMaxAlignment; } /// template recursion stopper for maximum size calculation From 1f527ab2f936d7d24a43d10c95a99c5a28c7af80 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 22 Feb 2023 22:47:14 +0100 Subject: [PATCH 08/36] iox-#1394 Fix Axivion warnings in 'storable_function' --- .../include/iox/detail/storable_function.hpp | 2 +- .../include/iox/detail/storable_function.inl | 34 ++++++++++++------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/iceoryx_hoofs/functional/include/iox/detail/storable_function.hpp b/iceoryx_hoofs/functional/include/iox/detail/storable_function.hpp index 89ba0daf0e..e575ebb3ee 100644 --- a/iceoryx_hoofs/functional/include/iox/detail/storable_function.hpp +++ b/iceoryx_hoofs/functional/include/iox/detail/storable_function.hpp @@ -193,7 +193,7 @@ class storable_function> final static ReturnType invokeFreeFunction(void* callable, Args&&... args) noexcept; template - static constexpr void* safeAlign(byte_t* startAddress); + static constexpr void* safeAlign(void* startAddress) noexcept; }; /// @brief swap two storable functions diff --git a/iceoryx_hoofs/functional/include/iox/detail/storable_function.inl b/iceoryx_hoofs/functional/include/iox/detail/storable_function.inl index f320e5a60f..adbd735bb5 100644 --- a/iceoryx_hoofs/functional/include/iox/detail/storable_function.inl +++ b/iceoryx_hoofs/functional/include/iox/detail/storable_function.inl @@ -46,7 +46,7 @@ inline storable_function>::storable_fun // the correct type whenever the callable is used /// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) m_callable(reinterpret_cast(function)) - , m_invoker(invokeFreeFunction) + , m_invoker(&invokeFreeFunction) { cxx::Expects(function); @@ -80,7 +80,7 @@ inline storable_function>::storable_fun const auto p = &object; // AXIVION Next Construct AutosarC++19_03-A7.1.1: type erased functor lambda cannot be const // as it may change by calling its operator() later (hence stored as non-const) - auto functor = [p, method](Args... args) -> ReturnType { return (*p.*method)(std::forward(args)...); }; + const auto functor = [p, method](Args... args) -> ReturnType { return (*p.*method)(std::forward(args)...); }; storeFunctor(functor); } @@ -151,7 +151,7 @@ template inline ReturnType storable_function>::operator()(Args... args) const noexcept { cxx::Expects(m_callable != nullptr); // should not happen unless incorrectly used after move - // AXIVION Next Construct AutosarC++19_03-M0.3.1: m_invoker is initialized in ctor or assignment, + // AXIVION Next Construct AutosarC++19_03-M0.3.1, FaultDetection-NullPointerDereference: m_invoker is initialized in ctor or assignment, // can only be nullptr if this was moved from (calling operator() is illegal in this case) return m_invoker(m_callable, std::forward(args)...); } @@ -172,14 +172,17 @@ inline void swap(storable_function& f, storable_function template -inline constexpr void* storable_function>::safeAlign(byte_t* startAddress) +inline constexpr void* +storable_function>::safeAlign(void* startAddress) noexcept { static_assert(is_storable(), "type does not fit into storage"); - // NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast, performance-no-int-to-ptr) required for low level pointer alignment - uint64_t alignment = alignof(T); - uint64_t alignedPosition = align(reinterpret_cast(startAddress), alignment); + // AXIVION DISABLE STYLE AutosarC++19_03-A5.2.4, AutosarC++19_03-M5.2.9 : Cast required for low level pointer alignment + // NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast, performance-no-int-to-ptr) + const uint64_t alignment{alignof(T)}; + const uint64_t alignedPosition{align(reinterpret_cast(startAddress), alignment)}; return reinterpret_cast(alignedPosition); - // NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast, performance-no-int-to-ptr) required for low level pointer alignment + // NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast, performance-no-int-to-ptr) + // AXIVION ENABLE STYLE AutosarC++19_03-A5.2.4, AutosarC++19_03-M5.2.9 } template @@ -187,9 +190,10 @@ template inline void storable_function>::storeFunctor(const Functor& functor) noexcept { using StoredType = typename std::remove_reference::type; - m_callable = safeAlign(m_storage); + m_callable = safeAlign(&m_storage[0]); // erase the functor type and store as reference to the call in storage + // AXIVION Next Construct AutosarC++19_03-A18.5.10: False positive! 'safeAlign' takes care of proper alignment and size new (m_callable) StoredType(functor); m_invoker = &invoke; @@ -204,12 +208,13 @@ template inline void storable_function>::copy(const storable_function& src, storable_function& dest) noexcept { - dest.m_callable = safeAlign(dest.m_storage); + dest.m_callable = safeAlign(&dest.m_storage[0]); // AXIVION Next Construct AutosarC++19_03-M5.2.8: type erasure - conversion to compatible type const auto obj = static_cast(src.m_callable); cxx::Expects(obj != nullptr); // should not happen unless src is incorrectly used after move + // AXIVION Next Construct AutosarC++19_03-A18.5.10: False positive! 'safeAlign' takes care of proper alignment and size // NOLINTNEXTLINE(clang-analyzer-core.NonNullParamChecker) checked two lines above new (dest.m_callable) CallableType(*obj); dest.m_invoker = src.m_invoker; @@ -222,12 +227,13 @@ template inline void storable_function>::move(storable_function& src, storable_function& dest) noexcept { - dest.m_callable = safeAlign(dest.m_storage); + dest.m_callable = safeAlign(&dest.m_storage[0]); // AXIVION Next Construct AutosarC++19_03-M5.2.8: type erasure - conversion to compatible type const auto obj = static_cast(src.m_callable); cxx::Expects(obj != nullptr); // should not happen unless src is incorrectly used after move + // AXIVION Next Construct AutosarC++19_03-A18.5.10: False positive! 'safeAlign' takes care of proper alignment and size // NOLINTNEXTLINE(clang-analyzer-core.NonNullParamChecker) checked two lines above new (dest.m_callable) CallableType(std::move(*obj)); dest.m_invoker = src.m_invoker; @@ -236,6 +242,7 @@ inline void storable_function>::move(st src.m_invoker = nullptr; } +// AXIVION Next Construct AutosarC++19_03-M0.1.8: False positive! The function calls the destructor of a member of the parameter template template inline void storable_function>::destroy(storable_function& f) noexcept @@ -249,6 +256,7 @@ inline void storable_function>::destroy } } +// AXIVION Next Construct AutosarC++19_03-A8.4.8: Out parameter is required for the intended functionality of the internal helper function template inline void storable_function>::copyFreeFunction(const storable_function& src, @@ -309,7 +317,9 @@ template template inline constexpr uint64_t storable_function>::required_storage_size() noexcept { - return sizeof(T) + alignof(T) - 1; + const uint64_t size{sizeof(T)}; + const uint64_t alignment{alignof(T)}; + return (size + alignment) - 1; } template From 689a3582e12be0b2e988314ced7dd43f7ea004d7 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 22 Feb 2023 22:53:18 +0100 Subject: [PATCH 09/36] iox-#1394 Fix Axivion warnings in 'bump_allocator' --- iceoryx_hoofs/memory/include/iox/bump_allocator.hpp | 4 ++-- iceoryx_hoofs/memory/source/bump_allocator.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp b/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp index baad8f199f..7b88e8095a 100644 --- a/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp +++ b/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp @@ -24,14 +24,14 @@ namespace iox { -enum class BumpAllocatorError +enum class BumpAllocatorError : uint8_t { OUT_OF_MEMORY, REQUESTED_ZERO_SIZED_MEMORY }; /// @brief A bump allocator for the memory provided in the ctor arguments -class BumpAllocator +class BumpAllocator final { public: /// @brief c'tor diff --git a/iceoryx_hoofs/memory/source/bump_allocator.cpp b/iceoryx_hoofs/memory/source/bump_allocator.cpp index 35ffc60044..a2dc45bcc8 100644 --- a/iceoryx_hoofs/memory/source/bump_allocator.cpp +++ b/iceoryx_hoofs/memory/source/bump_allocator.cpp @@ -25,7 +25,7 @@ namespace iox { BumpAllocator::BumpAllocator(void* const startAddress, const uint64_t length) noexcept - // AXIVION Next Construct AutosarC++19_03-A5.2.4 : required for low level memory management + // AXIVION Next Construct AutosarC++19_03-A5.2.4, AutosarC++19_03-M5.2.9 : required for low level memory management // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) : m_startAddress(reinterpret_cast(startAddress)) , m_length(length) @@ -49,7 +49,7 @@ expected BumpAllocator::allocate(const uint64_t size, void* allocation{nullptr}; - auto nextPosition = alignedPosition + size; + const uint64_t nextPosition{alignedPosition + size}; if (m_length >= nextPosition) { // AXIVION Next Construct AutosarC++19_03-A5.2.4 : required for low level memory management From c01ac1e4d701827e1ceac8a98e34f1088fe2f0af Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 22 Feb 2023 23:14:07 +0100 Subject: [PATCH 10/36] iox-#1394 Fix Axivion warnings in 'optional' --- .../vocabulary/include/iox/detail/optional.inl | 4 +++- iceoryx_hoofs/vocabulary/include/iox/optional.hpp | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/iceoryx_hoofs/vocabulary/include/iox/detail/optional.inl b/iceoryx_hoofs/vocabulary/include/iox/detail/optional.inl index d24b7b6f5c..97b69fbdaa 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/detail/optional.inl +++ b/iceoryx_hoofs/vocabulary/include/iox/detail/optional.inl @@ -105,6 +105,7 @@ inline optional& optional::operator=(const optional& rhs) noexcept } else if (rhs.m_hasValue && m_hasValue) { + // AXIVION Next Construct AutosarC++19_03-A5.0.1 : False positive! 'value()' != 'rhs.value()' value() = rhs.value(); } else if (rhs.m_hasValue && !m_hasValue) @@ -132,6 +133,7 @@ inline optional& optional::operator=(optional&& rhs) noexcept } else if (rhs.m_hasValue && m_hasValue) { + // AXIVION Next Construct AutosarC++19_03-A5.0.1 : False positive! 'value()' != 'rhs.value()' value() = std::move(rhs.value()); } else if (rhs.m_hasValue && !m_hasValue) @@ -309,7 +311,7 @@ bool operator!=(const optional& lhs, const optional& rhs) noexcept const auto onlyLhsNul = !lhs.has_value() && rhs.has_value(); const auto onlyRhsNul = lhs.has_value() && !rhs.has_value(); const auto bothValuesUnequal = (lhs.has_value() && rhs.has_value()) && (*lhs != *rhs); - return bothValuesUnequal || onlyRhsNul || onlyLhsNul; + return (bothValuesUnequal || onlyRhsNul) || onlyLhsNul; } // AXIVION DISABLE STYLE AutosarC++19_03-A13.5.5: Comparison with nullopt_t is required diff --git a/iceoryx_hoofs/vocabulary/include/iox/optional.hpp b/iceoryx_hoofs/vocabulary/include/iox/optional.hpp index 3c9e1b7e7b..ad4c55b55d 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/optional.hpp +++ b/iceoryx_hoofs/vocabulary/include/iox/optional.hpp @@ -81,18 +81,20 @@ class optional final : public FunctionalInterface, T, void> /// @brief Creates an optional which has no value. If you access such an /// optional via .value() or the arrow operator the application /// terminates. - // NOLINTNEXTLINE(hicpp-explicit-conversions) for justification see doxygen + // NOLINTNEXTLINE(hicpp-explicit-conversions) the usage of 'nullopt' shall be transparent when used with an 'optional' optional(const nullopt_t) noexcept; /// @brief Creates an optional by forwarding value to the constructor of /// T. This optional has a value. /// @param[in] value rvalue of type T which will be moved into the optional - // NOLINTNEXTLINE(hicpp-explicit-conversions) for justification see doxygen + // AXIVION DISABLE STYLE AutosarC++19_03-A12.1.4 : the usage of 'T' shall be transparent when used with an 'optional' + // NOLINTNEXTLINE(hicpp-explicit-conversions) optional(T&& value) noexcept; /// @brief Creates an optional by using the copy constructor of T. /// @param[in] value lvalue of type T which will be copy constructed into the optional - // NOLINTNEXTLINE(hicpp-explicit-conversions) for justification see doxygen + // AXIVION DISABLE STYLE AutosarC++19_03-A12.1.4 : the usage of 'T' shall be transparent when used with an 'optional' + // NOLINTNEXTLINE(hicpp-explicit-conversions) optional(const T& value) noexcept; /// @brief Creates an optional and an object inside the optional on construction by perfectly forwarding args to the @@ -228,13 +230,15 @@ class optional final : public FunctionalInterface, T, void> // initHandle(&handle); // } bool m_hasValue{false}; + // AXIVION DISABLE STYLE AutosarC++19_03-A9.6.1 : False positive. Used type has defined size. struct alignas(T) element_t { - // AXIVION Next Construct AutosarC++19_03-A18.1.1 : safe access is guaranteed since the array + // AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-A1.1.1, AutosarC++19_03-M0.1.3 : required as low level building block, encapsulated in abstraction and not directly used // is wrapped inside the optional // NOLINTNEXTLINE(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays) byte_t data[sizeof(T)]; }; + // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size limit is not relevant for containers stored in shared memory element_t m_data; private: From e0073c4a8def8bade30a62beecaaf62820be6a1b Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 22 Feb 2023 23:36:29 +0100 Subject: [PATCH 11/36] iox-#1394 Fix Axivion warnings in 'expected' --- iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl b/iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl index 46368e810e..c1e1f6562d 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl +++ b/iceoryx_hoofs/vocabulary/include/iox/detail/expected.inl @@ -36,6 +36,7 @@ inline success::success(T&& t) noexcept { } +// AXIVION Next Construct AutosarC++19_03-A15.4.2, FaultDetection-NoexceptViolations : Intentional behavior. 'success' is not intended to be used with a type which throws template template inline success::success(Targs&&... args) noexcept @@ -104,6 +105,7 @@ template inline expected& expected::operator=(expected&& rhs) noexcept { + // AXIVION Next Construct AutosarC++19_03-M0.1.2, AutosarC++19_03-M0.1.9, FaultDetection-DeadBranches : False positive. Check needed to avoid self assignment. if (this != &rhs) { m_store = std::move(rhs.m_store); @@ -222,11 +224,12 @@ inline const ValueType& expected::operator*() const noexce } template -const ValueType& expected::value_unchecked() const noexcept +inline const ValueType& expected::value_unchecked() const noexcept { return *m_store.template get_at_index(); } +// AXIVION Next Construct AutosarC++19_03-A13.5.2, AutosarC++19_03-A13.5.3: see doxygen brief section in header template template inline expected::operator expected() const noexcept @@ -270,6 +273,7 @@ inline expected::expected(expected&& rhs) noexcept template inline expected& expected::operator=(expected&& rhs) noexcept { + // AXIVION Next Construct AutosarC++19_03-M0.1.2, AutosarC++19_03-M0.1.9, FaultDetection-DeadBranches : False positive. Check needed to avoid self assignment. if (this != &rhs) { m_store = std::move(rhs.m_store); From 2cfbea28975f755b156e294661ee513d0d337059 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Wed, 22 Feb 2023 23:36:41 +0100 Subject: [PATCH 12/36] iox-#1394 Replace back-ticks with single quotes --- .../include/iceoryx_hoofs/cxx/attributes.hpp | 2 +- .../iceoryx_hoofs/cxx/deadline_timer.hpp | 2 +- .../include/iceoryx_hoofs/cxx/expected.hpp | 6 ++-- .../include/iceoryx_hoofs/cxx/function.hpp | 2 +- .../iceoryx_hoofs/cxx/function_ref.hpp | 4 +-- .../cxx/functional_interface.hpp | 22 +++++++-------- .../include/iceoryx_hoofs/cxx/newtype.hpp | 28 +++++++++---------- .../include/iceoryx_hoofs/cxx/optional.hpp | 14 +++++----- .../include/iceoryx_hoofs/cxx/scope_guard.hpp | 2 +- .../iceoryx_hoofs/cxx/scoped_static.hpp | 2 +- .../include/iceoryx_hoofs/cxx/stack.hpp | 2 +- .../include/iceoryx_hoofs/cxx/string.hpp | 22 +++++++-------- .../include/iceoryx_hoofs/cxx/type_traits.hpp | 18 ++++++------ .../include/iceoryx_hoofs/cxx/variant.hpp | 6 ++-- .../include/iceoryx_hoofs/cxx/vector.hpp | 2 +- .../iceoryx_hoofs/iceoryx_hoofs_types.hpp | 4 +-- .../shared_memory_object/shared_memory.cpp | 2 +- .../test_container_uninitialized_array.cpp | 4 +-- 18 files changed, 72 insertions(+), 72 deletions(-) diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/attributes.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/attributes.hpp index fc5b73b9b2..9e62b3c6f2 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/attributes.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/attributes.hpp @@ -27,7 +27,7 @@ namespace cxx { namespace internal { -/// @deprecated use `iox::internal::IOX_DISCARD_RESULT_IMPL` instead of `iox::cxx::internal::IOX_DISCARD_RESULT_IMPL` +/// @deprecated use 'iox::internal::IOX_DISCARD_RESULT_IMPL' instead of 'iox::cxx::internal::IOX_DISCARD_RESULT_IMPL' using iox::internal::IOX_DISCARD_RESULT_IMPL; } // namespace internal } // namespace cxx diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/deadline_timer.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/deadline_timer.hpp index 789f90d87e..ceb07dbb93 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/deadline_timer.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/deadline_timer.hpp @@ -25,7 +25,7 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/deadline_timer.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::deadline_timer` instead of `iox::cxx::DeadlineTimer` +/// @deprecated use 'iox::deadline_timer' instead of 'iox::cxx::DeadlineTimer' using DeadlineTimer = iox::deadline_timer; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/expected.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/expected.hpp index 65e4c16761..361a2c97c5 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/expected.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/expected.hpp @@ -25,11 +25,11 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/expected.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::error` instead of `iox::cxx::error` +/// @deprecated use 'iox::error' instead of 'iox::cxx::error' using iox::error; -/// @deprecated use `iox::expected` instead of `iox::cxx::expected` +/// @deprecated use 'iox::expected' instead of 'iox::cxx::expected' using iox::expected; -/// @deprecated use `iox::success` instead of `iox::cxx::success` +/// @deprecated use 'iox::success' instead of 'iox::cxx::success' using iox::success; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function.hpp index 5f25ac42d3..cd71e9f760 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function.hpp @@ -25,7 +25,7 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/function.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::function` instead of `iox::cxx::function` +/// @deprecated use 'iox::function' instead of 'iox::cxx::function' using iox::function; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function_ref.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function_ref.hpp index 0e7069a214..9d15f5d9c6 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function_ref.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/function_ref.hpp @@ -25,10 +25,10 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/function_ref.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::function_ref` instead of `iox::cxx::function_ref` +/// @deprecated use 'iox::function_ref' instead of 'iox::cxx::function_ref' using iox::function_ref; -/// @deprecated use `iox::has_same_decayed_type` instead of `iox::cxx::has_same_decayed_type` +/// @deprecated use 'iox::has_same_decayed_type' instead of 'iox::cxx::has_same_decayed_type' using iox::has_same_decayed_type; } // namespace cxx diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/functional_interface.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/functional_interface.hpp index ebcf4c4426..fc09159e4a 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/functional_interface.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/functional_interface.hpp @@ -26,38 +26,38 @@ namespace cxx { namespace internal { -/// @deprecated use `iox::internal::HasValueMethod` instead of `iox::cxx::internal::HasValueMethod` +/// @deprecated use 'iox::internal::HasValueMethod' instead of 'iox::cxx::internal::HasValueMethod' using iox::internal::HasValueMethod; -/// @deprecated use `iox::internal::HasGetErrorMethod` instead of `iox::cxx::internal::HasGetErrorMethod` +/// @deprecated use 'iox::internal::HasGetErrorMethod' instead of 'iox::cxx::internal::HasGetErrorMethod' using iox::internal::HasGetErrorMethod; -/// @deprecated use `iox::internal::Expect` instead of `iox::cxx::internal::Expect` +/// @deprecated use 'iox::internal::Expect' instead of 'iox::cxx::internal::Expect' using iox::internal::Expect; -/// @deprecated use `iox::internal::ExpectWithValue` instead of `iox::cxx::internal::ExpectWithValue` +/// @deprecated use 'iox::internal::ExpectWithValue' instead of 'iox::cxx::internal::ExpectWithValue' using iox::internal::ExpectWithValue; -/// @deprecated use `iox::internal::ValueOr` instead of `iox::cxx::internal::ValueOr` +/// @deprecated use 'iox::internal::ValueOr' instead of 'iox::cxx::internal::ValueOr' using iox::internal::ValueOr; -/// @deprecated use `iox::internal::AndThenWithValue` instead of `iox::cxx::internal::AndThenWithValue` +/// @deprecated use 'iox::internal::AndThenWithValue' instead of 'iox::cxx::internal::AndThenWithValue' using iox::internal::AndThenWithValue; -/// @deprecated use `iox::internal::AndThen` instead of `iox::cxx::internal::AndThen` +/// @deprecated use 'iox::internal::AndThen' instead of 'iox::cxx::internal::AndThen' using iox::internal::AndThen; -/// @deprecated use `iox::internal::OrElseWithValue` instead of `iox::cxx::internal::OrElseWithValue` +/// @deprecated use 'iox::internal::OrElseWithValue' instead of 'iox::cxx::internal::OrElseWithValue' using iox::internal::OrElseWithValue; -/// @deprecated use `iox::internal::OrElse` instead of `iox::cxx::internal::OrElse` +/// @deprecated use 'iox::internal::OrElse' instead of 'iox::cxx::internal::OrElse' using iox::internal::OrElse; -/// @deprecated use `iox::internal::FunctionalInterfaceImpl` instead of `iox::cxx::internal::FunctionalInterfaceImpl` +/// @deprecated use 'iox::internal::FunctionalInterfaceImpl' instead of 'iox::cxx::internal::FunctionalInterfaceImpl' using iox::internal::FunctionalInterfaceImpl; } // namespace internal -/// @deprecated use `iox::FunctionalInterface` instead of `iox::cxx::FunctionalInterface` +/// @deprecated use 'iox::FunctionalInterface' instead of 'iox::cxx::FunctionalInterface' using iox::FunctionalInterface; } // namespace cxx diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp index 1bf985a600..c5b823515a 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/newtype.hpp @@ -24,35 +24,35 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/newtype.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::NewType` instead of `iox::cxx::NewType` +/// @deprecated use 'iox::NewType' instead of 'iox::cxx::NewType' using iox::NewType; namespace newtype { -/// @deprecated use `iox::newtype::AssignByValueCopy` instead of `iox::cxx::newtype::AssignByValueCopy` +/// @deprecated use 'iox::newtype::AssignByValueCopy' instead of 'iox::cxx::newtype::AssignByValueCopy' using iox::newtype::AssignByValueCopy; -/// @deprecated use `iox::newtype::AssignByValueMove` instead of `iox::cxx::newtype::AssignByValueMove` +/// @deprecated use 'iox::newtype::AssignByValueMove' instead of 'iox::cxx::newtype::AssignByValueMove' using iox::newtype::AssignByValueMove; -/// @deprecated use `iox::newtype::Comparable` instead of `iox::cxx::newtype::Comparable` +/// @deprecated use 'iox::newtype::Comparable' instead of 'iox::cxx::newtype::Comparable' using iox::newtype::Comparable; -/// @deprecated use `iox::newtype::ConstructByValueCopy` instead of `iox::cxx::newtype::ConstructByValueCopy` +/// @deprecated use 'iox::newtype::ConstructByValueCopy' instead of 'iox::cxx::newtype::ConstructByValueCopy' using iox::newtype::ConstructByValueCopy; -/// @deprecated use `iox::newtype::Convertable` instead of `iox::cxx::newtype::Convertable` +/// @deprecated use 'iox::newtype::Convertable' instead of 'iox::cxx::newtype::Convertable' using iox::newtype::Convertable; -/// @deprecated use `iox::newtype::CopyAssignable` instead of `iox::cxx::newtype::CopyAssignable` +/// @deprecated use 'iox::newtype::CopyAssignable' instead of 'iox::cxx::newtype::CopyAssignable' using iox::newtype::CopyAssignable; -/// @deprecated use `iox::newtype::CopyConstructable` instead of `iox::cxx::newtype::CopyConstructable` +/// @deprecated use 'iox::newtype::CopyConstructable' instead of 'iox::cxx::newtype::CopyConstructable' using iox::newtype::CopyConstructable; -/// @deprecated use `iox::newtype::DefaultConstructable` instead of `iox::cxx::newtype::DefaultConstructable` +/// @deprecated use 'iox::newtype::DefaultConstructable' instead of 'iox::cxx::newtype::DefaultConstructable' using iox::newtype::DefaultConstructable; -/// @deprecated use `iox::newtype::MoveAssignable` instead of `iox::cxx::newtype::MoveAssignable` +/// @deprecated use 'iox::newtype::MoveAssignable' instead of 'iox::cxx::newtype::MoveAssignable' using iox::newtype::MoveAssignable; -/// @deprecated use `iox::newtype::MoveConstructable` instead of `iox::cxx::newtype::MoveConstructable` +/// @deprecated use 'iox::newtype::MoveConstructable' instead of 'iox::cxx::newtype::MoveConstructable' using iox::newtype::MoveConstructable; -/// @deprecated use `iox::newtype::ProtectedConstructByValueCopy` instead of -/// `iox::cxx::newtype::ProtectedConstructByValueCopy` +/// @deprecated use 'iox::newtype::ProtectedConstructByValueCopy' instead of +/// 'iox::cxx::newtype::ProtectedConstructByValueCopy' using iox::newtype::ProtectedConstructByValueCopy; -/// @deprecated use `iox::newtype::Sortable` instead of `iox::cxx::newtype::Sortable` +/// @deprecated use 'iox::newtype::Sortable' instead of 'iox::cxx::newtype::Sortable' using iox::newtype::Sortable; namespace internal diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/optional.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/optional.hpp index 7a310ddbe4..dc619be5e6 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/optional.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/optional.hpp @@ -25,19 +25,19 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/optional.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::in_place` instead of `iox::cxx::in_place` +/// @deprecated use 'iox::in_place' instead of 'iox::cxx::in_place' using iox::in_place; -/// @deprecated use `iox::in_place_t` instead of `iox::cxx::in_place_t` +/// @deprecated use 'iox::in_place_t' instead of 'iox::cxx::in_place_t' using iox::in_place_t; -/// @deprecated use `iox::is_optional` instead of `iox::cxx::is_optional` +/// @deprecated use 'iox::is_optional' instead of 'iox::cxx::is_optional' using iox::is_optional; -/// @deprecated use `iox::make_optional` instead of `iox::cxx::make_optional` +/// @deprecated use 'iox::make_optional' instead of 'iox::cxx::make_optional' using iox::make_optional; -/// @deprecated use `iox::nullopt` instead of `iox::cxx::nullopt` +/// @deprecated use 'iox::nullopt' instead of 'iox::cxx::nullopt' using iox::nullopt; -/// @deprecated use `iox::nullopt_t` instead of `iox::cxx::nullopt_t` +/// @deprecated use 'iox::nullopt_t' instead of 'iox::cxx::nullopt_t' using iox::nullopt_t; -/// @deprecated use `iox::optional` instead of `iox::cxx::optional` +/// @deprecated use 'iox::optional' instead of 'iox::cxx::optional' using iox::optional; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scope_guard.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scope_guard.hpp index 70f78ca689..2c794c7288 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scope_guard.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scope_guard.hpp @@ -25,7 +25,7 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/scope_guard.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::ScopeGuard` instead of `iox::cxx::ScopeGuard` +/// @deprecated use 'iox::ScopeGuard' instead of 'iox::cxx::ScopeGuard' using iox::ScopeGuard; } // namespace cxx diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scoped_static.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scoped_static.hpp index ca580e18cc..0c92288982 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scoped_static.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/scoped_static.hpp @@ -25,7 +25,7 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/scoped_static.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::makeScopedStatic` instead of `iox::cxx::makeScopedStatic` +/// @deprecated use 'iox::makeScopedStatic' instead of 'iox::cxx::makeScopedStatic' using iox::makeScopedStatic; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp index 6a6e51d96e..329b981c3f 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/stack.hpp @@ -24,7 +24,7 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/stack.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::stack` instead of `iox::cxx::stack` +/// @deprecated use 'iox::stack' instead of 'iox::cxx::stack' using iox::stack; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp index 9f0bf15d23..3111775066 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/string.hpp @@ -25,26 +25,26 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/string.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::concatenate` instead of `iox::cxx::concatenate` +/// @deprecated use 'iox::concatenate' instead of 'iox::cxx::concatenate' using iox::concatenate; -/// @deprecated use `iox::is_cxx_string` instead of `iox::cxx::is_cxx_string` +/// @deprecated use 'iox::is_cxx_string' instead of 'iox::cxx::is_cxx_string' using iox::is_cxx_string; -/// @deprecated use `iox::IsCxxStringAndCxxStringOrCharArrayOrChar` instead of -/// `iox::cxx::IsCxxStringAndCxxStringOrCharArrayOrChar` +/// @deprecated use 'iox::IsCxxStringAndCxxStringOrCharArrayOrChar' instead of +/// 'iox::cxx::IsCxxStringAndCxxStringOrCharArrayOrChar' using iox::IsCxxStringAndCxxStringOrCharArrayOrChar; -/// @deprecated use `iox::IsCxxStringOrCharArray` instead of `iox::cxx::IsCxxStringOrCharArray` +/// @deprecated use 'iox::IsCxxStringOrCharArray' instead of 'iox::cxx::IsCxxStringOrCharArray' using iox::IsCxxStringOrCharArray; -/// @deprecated use `iox::IsCxxStringOrCharArrayOrChar` instead of `iox::cxx::IsCxxStringOrCharArrayOrChar` +/// @deprecated use 'iox::IsCxxStringOrCharArrayOrChar' instead of 'iox::cxx::IsCxxStringOrCharArrayOrChar' using iox::IsCxxStringOrCharArrayOrChar; -/// @deprecated use `iox::IsStringOrCharArray` instead of `iox::cxx::IsStringOrCharArray` +/// @deprecated use 'iox::IsStringOrCharArray' instead of 'iox::cxx::IsStringOrCharArray' using iox::IsStringOrCharArray; -/// @deprecated use `iox::IsStringOrCharArrayOrChar` instead of `iox::cxx::IsStringOrCharArrayOrChar` +/// @deprecated use 'iox::IsStringOrCharArrayOrChar' instead of 'iox::cxx::IsStringOrCharArrayOrChar' using iox::IsStringOrCharArrayOrChar; -/// @deprecated use `iox::string` instead of `iox::string` +/// @deprecated use 'iox::string' instead of 'iox::string' using iox::string; -/// @deprecated use `iox::TruncateToCapacity` instead of `iox::cxx::TruncateToCapacity` +/// @deprecated use 'iox::TruncateToCapacity' instead of 'iox::cxx::TruncateToCapacity' using iox::TruncateToCapacity; -/// @deprecated use `iox::TruncateToCapacity_t` instead of `iox::cxx::TruncateToCapacity_t` +/// @deprecated use 'iox::TruncateToCapacity_t' instead of 'iox::cxx::TruncateToCapacity_t' using iox::TruncateToCapacity_t; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/type_traits.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/type_traits.hpp index 2f04cca2b4..a15e871455 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/type_traits.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/type_traits.hpp @@ -25,31 +25,31 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/type_traits.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::add_const_conditionally` instead of `iox::cxx::add_const_conditionally` +/// @deprecated use 'iox::add_const_conditionally' instead of 'iox::cxx::add_const_conditionally' using iox::add_const_conditionally; -/// @deprecated use `iox::add_const_conditionally_t` instead of `iox::cxx::add_const_conditionally_t` +/// @deprecated use 'iox::add_const_conditionally_t' instead of 'iox::cxx::add_const_conditionally_t' using iox::add_const_conditionally_t; -/// @deprecated use `iox::always_false_v` instead of `iox::cxx::always_false_v` +/// @deprecated use 'iox::always_false_v' instead of 'iox::cxx::always_false_v' using iox::always_false_v; -/// @deprecated use `iox::is_invocable` instead of `iox::cxx::is_invocable` +/// @deprecated use 'iox::is_invocable' instead of 'iox::cxx::is_invocable' using iox::is_invocable; -/// @deprecated use `iox::is_invocable_r` instead of `iox::cxx::is_invocable_r` +/// @deprecated use 'iox::is_invocable_r' instead of 'iox::cxx::is_invocable_r' using iox::is_invocable_r; -/// @deprecated use `iox::is_function_pointer` instead of `iox::cxx::is_function_pointer` +/// @deprecated use 'iox::is_function_pointer' instead of 'iox::cxx::is_function_pointer' using iox::is_function_pointer; -/// @deprecated use `iox::is_char_array` instead of `iox::cxx::is_char_array` +/// @deprecated use 'iox::is_char_array' instead of 'iox::cxx::is_char_array' using iox::is_char_array; -/// @deprecated use `iox::void_t` instead of `iox::cxx::void_t` +/// @deprecated use 'iox::void_t' instead of 'iox::cxx::void_t' using iox::void_t; -/// @deprecated use `iox::TypeInfo` instead of `iox::cxx::TypeInfo` +/// @deprecated use 'iox::TypeInfo' instead of 'iox::cxx::TypeInfo' using iox::TypeInfo; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/variant.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/variant.hpp index 9ebcc591b4..2029a46a1c 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/variant.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/variant.hpp @@ -25,11 +25,11 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/variant.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::in_place_index` instead of `iox::cxx::in_place_index` +/// @deprecated use 'iox::in_place_index' instead of 'iox::cxx::in_place_index' using iox::in_place_index; -/// @deprecated use `iox::in_place_type` instead of `iox::cxx::in_place_type` +/// @deprecated use 'iox::in_place_type' instead of 'iox::cxx::in_place_type' using iox::in_place_type; -/// @deprecated use `iox::variant` instead of `iox::cxx::variant` +/// @deprecated use 'iox::variant' instead of 'iox::cxx::variant' using iox::variant; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/vector.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/vector.hpp index a80b736f35..6079f817fb 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/vector.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/cxx/vector.hpp @@ -24,7 +24,7 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/vector.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::vector` instead of `iox::cxx::vector` +/// @deprecated use 'iox::vector' instead of 'iox::cxx::vector' using iox::vector; } // namespace cxx } // namespace iox diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp index fae7f5be7c..dc725fa00e 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp @@ -25,12 +25,12 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/iceoryx_hoofs_types.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::byte_t` instead of `iox::cxx::byte_t` +/// @deprecated use 'iox::byte_t' instead of 'iox::cxx::byte_t' using iox::byte_t; } // namespace cxx namespace log { -/// @deprecated use `iox::log::LogLevel` instead of `iox::cxx::log::LogLevel` +/// @deprecated use 'iox::log::LogLevel' instead of 'iox::cxx::log::LogLevel' using iox::log::LogLevel; } // namespace log } // namespace iox diff --git a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/shared_memory.cpp b/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/shared_memory.cpp index eaa8306653..f0437aa431 100644 --- a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/shared_memory.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/shared_memory.cpp @@ -113,7 +113,7 @@ expected SharedMemoryBuilder::create() noexcept .evaluate(); } - // Check again, as the if-block above may have changed `result` + // Check again, as the if-block above may have changed 'result' if (result.has_error()) { printError(); diff --git a/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp b/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp index 48e54b6f85..8c919a3d14 100644 --- a/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp +++ b/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp @@ -149,7 +149,7 @@ TEST(UninitializedArrayTest, AllElementsInitializedWithZeroWhenBufferSetToZeroed for (auto& e : buffer) { new (&e) uint32_t(std::numeric_limits::max()); - // Access `e` to prevent the compiler from optimizing away the loop + // Access 'e' to prevent the compiler from optimizing away the loop EXPECT_EQ(e, std::numeric_limits::max()); } @@ -169,7 +169,7 @@ TEST(UninitializedArrayTest, AllElementsAreNotZeroedWhenBufferSetToNonZeroedBuff for (auto& e : buffer) { new (&e) uint32_t(std::numeric_limits::max()); - // Access `e` to prevent the compiler from optimizing away the loop + // Access 'e' to prevent the compiler from optimizing away the loop EXPECT_EQ(e, std::numeric_limits::max()); } From ea2ae85f0319074c25edf41c1ce995239b6ca760 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Thu, 23 Feb 2023 15:12:11 +0100 Subject: [PATCH 13/36] iox-#1394 Better justification for A1.1.1 --- .../container/include/iox/uninitialized_array.hpp | 14 +++++++++----- iceoryx_hoofs/container/include/iox/vector.hpp | 2 +- iceoryx_hoofs/vocabulary/include/iox/optional.hpp | 7 ++++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp b/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp index e7118ee868..4d6d318b08 100644 --- a/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp +++ b/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp @@ -33,11 +33,13 @@ struct ZeroedBuffer { struct alignas(ElementType) element_t { - // AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-M0.1.3 : required by low level UninitializedArray building block and encapsulated in abstraction, declaration of field in struct for usage elsewhere + // AXIVION Next Construct AutosarC++19_03-M0.1.3 : the field is intentionally unused and serves as a mean to provide memory + // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) byte_t data[sizeof(ElementType)]; }; - // AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-A1.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction, object size limit is not relevant for containers stored in shared memory. + // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation + // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) element_t value[Capacity]{}; }; @@ -50,11 +52,13 @@ struct NonZeroedBuffer { struct alignas(ElementType) element_t { - // AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-M0.1.3 : required by low level UninitializedArray building block and encapsulated in abstraction, declaration of field in struct for usage elsewhere + // AXIVION Next Construct AutosarC++19_03-M0.1.3 : the field is intentionally unused and serves as a mean to provide memory + // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) byte_t data[sizeof(ElementType)]; }; - // AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-A1.1.1 : required by low level UninitializedArray building block and encapsulated in abstraction, object size limit is not relevant for containers stored in shared memory + // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation + // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) element_t value[Capacity]; }; @@ -123,7 +127,7 @@ class UninitializedArray final static constexpr uint64_t capacity() noexcept; private: - // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size limit is not relevant for containers stored in shared memory + // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation Buffer m_buffer; }; diff --git a/iceoryx_hoofs/container/include/iox/vector.hpp b/iceoryx_hoofs/container/include/iox/vector.hpp index a38a3dcff2..46515f7397 100644 --- a/iceoryx_hoofs/container/include/iox/vector.hpp +++ b/iceoryx_hoofs/container/include/iox/vector.hpp @@ -251,7 +251,7 @@ class vector final void clearFrom(const uint64_t startPosition) noexcept; - // AXIVION Next Construct AutosarC++19_03-A1.1.1 : Object size limit is not relevant for containers stored in shared memory. + // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation UninitializedArray m_data{}; uint64_t m_size{0U}; }; diff --git a/iceoryx_hoofs/vocabulary/include/iox/optional.hpp b/iceoryx_hoofs/vocabulary/include/iox/optional.hpp index ad4c55b55d..52398dd742 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/optional.hpp +++ b/iceoryx_hoofs/vocabulary/include/iox/optional.hpp @@ -233,12 +233,13 @@ class optional final : public FunctionalInterface, T, void> // AXIVION DISABLE STYLE AutosarC++19_03-A9.6.1 : False positive. Used type has defined size. struct alignas(T) element_t { - // AXIVION Next Construct AutosarC++19_03-A18.1.1, AutosarC++19_03-A1.1.1, AutosarC++19_03-M0.1.3 : required as low level building block, encapsulated in abstraction and not directly used - // is wrapped inside the optional + // AXIVION Next Construct AutosarC++19_03-M0.1.3 : the field is intentionally unused and serves as a mean to provide memory + // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation + // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used // NOLINTNEXTLINE(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays) byte_t data[sizeof(T)]; }; - // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size limit is not relevant for containers stored in shared memory + // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation element_t m_data; private: From 0265efd0708a865e23c4459fecaa578bcf6fcbe6 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Thu, 23 Feb 2023 20:45:28 +0100 Subject: [PATCH 14/36] iox-#1394 Readd suppression in 'uninitialized_array' --- iceoryx_hoofs/container/include/iox/uninitialized_array.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp b/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp index 4d6d318b08..bdf87fb2ef 100644 --- a/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp +++ b/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp @@ -35,6 +35,7 @@ struct ZeroedBuffer { // AXIVION Next Construct AutosarC++19_03-M0.1.3 : the field is intentionally unused and serves as a mean to provide memory // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation + // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) byte_t data[sizeof(ElementType)]; }; @@ -54,6 +55,7 @@ struct NonZeroedBuffer { // AXIVION Next Construct AutosarC++19_03-M0.1.3 : the field is intentionally unused and serves as a mean to provide memory // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation + // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) byte_t data[sizeof(ElementType)]; }; From 727e7315db3137f3cb275a0a95ddd01158e92f4b Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Thu, 23 Feb 2023 20:53:59 +0100 Subject: [PATCH 15/36] iox-#1394 Fix Axivion warnings in 'functional_interface' --- .../design/include/iox/detail/functional_interface.inl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iceoryx_hoofs/design/include/iox/detail/functional_interface.inl b/iceoryx_hoofs/design/include/iox/detail/functional_interface.inl index 9ece2cc64a..d5a199b27f 100644 --- a/iceoryx_hoofs/design/include/iox/detail/functional_interface.inl +++ b/iceoryx_hoofs/design/include/iox/detail/functional_interface.inl @@ -210,8 +210,7 @@ template inline const Derived&& AndThen::and_then(const and_then_callback_t& callable) const&& noexcept { using Self = AndThen; - // AXIVION Next Construct AutosarC++19_03-A5.2.3 : const_cast avoids code duplication, is safe since the constness - // of the return value is restored + // AXIVION Next Construct AutosarC++19_03-A5.2.3 : const_cast avoids code duplication, is safe since the constness of the return value is restored // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast) return std::move(const_cast(const_cast(this)->and_then(callable))); } From a071486e4cfd28a0fd40389c9961930dd5cbe116 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Thu, 23 Feb 2023 20:56:03 +0100 Subject: [PATCH 16/36] iox-#1394 Fix Axivion warnings in 'scoped_static' --- iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl b/iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl index e3fb61c4c3..9acc040c02 100644 --- a/iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl +++ b/iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl @@ -25,7 +25,7 @@ template inline ScopeGuard makeScopedStatic(T& memory, CTorArgs&&... ctorArgs) noexcept { memory.emplace(std::forward(ctorArgs)...); - return ScopeGuard([&memory]() { memory.reset(); }); + return ScopeGuard([&memory]() noexcept { memory.reset(); }); } } // namespace iox From 213d6616500129c559b554ffc0797942bc95d38b Mon Sep 17 00:00:00 2001 From: Ziad Mostafa Date: Mon, 20 Feb 2023 13:35:12 +0100 Subject: [PATCH 17/36] iox-#1900 Refactor byte_t to be a distinct type Signed-off-by: Ziad Mostafa --- doc/website/release-notes/iceoryx-unreleased.md | 13 +++++++++++++ iceoryx_hoofs/README.md | 2 +- .../container/include/iox/uninitialized_array.hpp | 4 ++-- .../include/iox/detail/storable_function.hpp | 2 +- .../internal/posix_wrapper/shared_memory_object.hpp | 1 - .../include/iceoryx_hoofs/iceoryx_hoofs_types.hpp | 5 +++-- .../primitives/include/iox/iceoryx_hoofs_types.hpp | 5 ++++- .../include/iox/detail/variant_internal.hpp | 1 - iceoryx_hoofs/vocabulary/include/iox/optional.hpp | 2 +- iceoryx_hoofs/vocabulary/include/iox/variant.hpp | 3 ++- 10 files changed, 27 insertions(+), 11 deletions(-) diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index c5fd40effa..1eeb183971 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -119,6 +119,7 @@ - Remove `algorithm::uniqueMergeSortedContainers` from `algorithm.hpp` - Move `std::string` conversion function to `iceoryx_dust` [\#1612](https://github.com/eclipse-iceoryx/iceoryx/issues/1612) - The posix call `unlink` is directly used in `UnixDomainSocket` [\#1622](https://github.com/eclipse-iceoryx/iceoryx/issues/1622) +- Make iox::byte_t a distinct type [\#1900](https://github.com/eclipse-iceoryx/iceoryx/issues/1900) **Workflow:** @@ -1033,3 +1034,15 @@ // after iox::access_rights foo { iox::perms::owner_all | iox::perms::group_read }; ``` +47. Renaming `byte_t` to `byte` + `byte` is not a simple type alias, now it is a distinct type like c++17 `std::byte`. + The type `byte` does not support any arithmetic operations nor has member functions. + + ```cpp + //before + iox::byte_t m_size; + + //after + iox::byte m_size; + ``` + diff --git a/iceoryx_hoofs/README.md b/iceoryx_hoofs/README.md index a225680e8f..dc231640da 100644 --- a/iceoryx_hoofs/README.md +++ b/iceoryx_hoofs/README.md @@ -83,7 +83,7 @@ The module structure is a logical grouping. It is replicated for `concurrent` an | class | internal | description | |:---------------------:|:--------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |`type_traits` | | Extended support for evaluating types on compile-time. | -|`types` | | Declares essential building block types like `byte_t`. | +|`types` | | Declares essential building block types like `byte`. | |`attributes` | | C++17 and C++20 attributes are sometimes available through compiler extensions. The attribute macros defined in here (like `IOX_FALLTHROUGH`, `IOX_MAYBE_UNUSED` ... ) make sure that we are able to use them if the compiler supports it. | |`algorithm` | | Implements `min` and `max` for an arbitrary number of values of the same type. For instance `min(1,2,3,4,5);` | |`size` | | Helper functions to determine the size in generic ways | diff --git a/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp b/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp index bdf87fb2ef..64b3d65f27 100644 --- a/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp +++ b/iceoryx_hoofs/container/include/iox/uninitialized_array.hpp @@ -37,7 +37,7 @@ struct ZeroedBuffer // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) - byte_t data[sizeof(ElementType)]; + byte data[sizeof(ElementType)]; }; // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used @@ -57,7 +57,7 @@ struct NonZeroedBuffer // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) - byte_t data[sizeof(ElementType)]; + byte data[sizeof(ElementType)]; }; // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used diff --git a/iceoryx_hoofs/functional/include/iox/detail/storable_function.hpp b/iceoryx_hoofs/functional/include/iox/detail/storable_function.hpp index e575ebb3ee..a462707ef0 100644 --- a/iceoryx_hoofs/functional/include/iox/detail/storable_function.hpp +++ b/iceoryx_hoofs/functional/include/iox/detail/storable_function.hpp @@ -154,7 +154,7 @@ class storable_function> final // AXIVION Next Construct AutosarC++19_03-A18.1.1 : safe access is guaranteed since the c-array is wrapped inside the storable_function // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, hicpp-avoid-c-arrays) - byte_t m_storage[Capacity]; // storage for the callable + byte m_storage[Capacity]; // storage for the callable void* m_callable{nullptr}; // pointer to stored type-erased callable ReturnType (*m_invoker)(void*, Args&&...){nullptr}; // indirection to invoke the stored callable, // nullptr if no callable is stored diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp index 9ff0587536..8adb48be47 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp @@ -31,7 +31,6 @@ namespace iox { namespace posix { -using byte_t = uint8_t; enum class SharedMemoryObjectError { diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp index dc725fa00e..18be176f36 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp @@ -25,8 +25,9 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/iceoryx_hoofs_types.hpp' instead")]] namespace cxx { -/// @deprecated use 'iox::byte_t' instead of 'iox::cxx::byte_t' -using iox::byte_t; +/// @deprecated use `iox::byte` instead of `iox::cxx::byte_t` +using byte_t = byte; + } // namespace cxx namespace log { diff --git a/iceoryx_hoofs/primitives/include/iox/iceoryx_hoofs_types.hpp b/iceoryx_hoofs/primitives/include/iox/iceoryx_hoofs_types.hpp index d1fed5d69d..6dd7477864 100644 --- a/iceoryx_hoofs/primitives/include/iox/iceoryx_hoofs_types.hpp +++ b/iceoryx_hoofs/primitives/include/iox/iceoryx_hoofs_types.hpp @@ -24,7 +24,10 @@ namespace iox { -using byte_t = uint8_t; + +enum class byte : uint8_t +{ +}; // AXIVION Next Construct AutosarC++19_03-M2.10.1 : log is a sensible namespace for a logger; furthermore it is in the // iox namespace and when used as function the compiler will complain diff --git a/iceoryx_hoofs/vocabulary/include/iox/detail/variant_internal.hpp b/iceoryx_hoofs/vocabulary/include/iox/detail/variant_internal.hpp index 63778e13f5..105ac0a970 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/detail/variant_internal.hpp +++ b/iceoryx_hoofs/vocabulary/include/iox/detail/variant_internal.hpp @@ -52,7 +52,6 @@ struct is_in_place_type> : std::true_type { }; -using byte_t = uint8_t; template struct does_contain_type { diff --git a/iceoryx_hoofs/vocabulary/include/iox/optional.hpp b/iceoryx_hoofs/vocabulary/include/iox/optional.hpp index 52398dd742..887d5fd62f 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/optional.hpp +++ b/iceoryx_hoofs/vocabulary/include/iox/optional.hpp @@ -237,7 +237,7 @@ class optional final : public FunctionalInterface, T, void> // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation // AXIVION Next Construct AutosarC++19_03-A18.1.1 : required as low level building block, encapsulated in abstraction and not directly used // NOLINTNEXTLINE(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays) - byte_t data[sizeof(T)]; + byte data[sizeof(T)]; }; // AXIVION Next Construct AutosarC++19_03-A1.1.1 : object size depends on template parameter and has to be taken care of at the specific template instantiation element_t m_data; diff --git a/iceoryx_hoofs/vocabulary/include/iox/variant.hpp b/iceoryx_hoofs/vocabulary/include/iox/variant.hpp index 14e2ef8146..aa8d540618 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/variant.hpp +++ b/iceoryx_hoofs/vocabulary/include/iox/variant.hpp @@ -19,6 +19,7 @@ #include "iox/algorithm.hpp" #include "iox/detail/variant_internal.hpp" +#include "iox/iceoryx_hoofs_types.hpp" #include #include @@ -265,7 +266,7 @@ class variant final // AXIVION Next Construct AutosarC++19_03-M0.1.3 : data provides the actual storage and is accessed via m_storage since &m_storage.data = &m_storage // AXIVION Next Construct AutosarC++19_03-A18.1.1 : safe access is guaranteed since the c-array is wrapped inside the variant class // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays) - internal::byte_t data[TYPE_SIZE]; + iox::byte data[TYPE_SIZE]; }; storage_t m_storage{}; uint64_t m_type_index{INVALID_VARIANT_INDEX}; From 2f556d0bc3ab3c7a9e40acd8ef252c46b7bcd814 Mon Sep 17 00:00:00 2001 From: Ziad Mostafa Date: Tue, 21 Feb 2023 12:26:06 +0100 Subject: [PATCH 18/36] iox-#1900 Revert change of byte to a distinct type Signed-off-by: Ziad Mostafa --- doc/website/release-notes/iceoryx-unreleased.md | 4 +--- .../primitives/include/iox/iceoryx_hoofs_types.hpp | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index 1eeb183971..a8f8f2677f 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -119,7 +119,6 @@ - Remove `algorithm::uniqueMergeSortedContainers` from `algorithm.hpp` - Move `std::string` conversion function to `iceoryx_dust` [\#1612](https://github.com/eclipse-iceoryx/iceoryx/issues/1612) - The posix call `unlink` is directly used in `UnixDomainSocket` [\#1622](https://github.com/eclipse-iceoryx/iceoryx/issues/1622) -- Make iox::byte_t a distinct type [\#1900](https://github.com/eclipse-iceoryx/iceoryx/issues/1900) **Workflow:** @@ -1034,9 +1033,8 @@ // after iox::access_rights foo { iox::perms::owner_all | iox::perms::group_read }; ``` + 47. Renaming `byte_t` to `byte` - `byte` is not a simple type alias, now it is a distinct type like c++17 `std::byte`. - The type `byte` does not support any arithmetic operations nor has member functions. ```cpp //before diff --git a/iceoryx_hoofs/primitives/include/iox/iceoryx_hoofs_types.hpp b/iceoryx_hoofs/primitives/include/iox/iceoryx_hoofs_types.hpp index 6dd7477864..1befc87749 100644 --- a/iceoryx_hoofs/primitives/include/iox/iceoryx_hoofs_types.hpp +++ b/iceoryx_hoofs/primitives/include/iox/iceoryx_hoofs_types.hpp @@ -24,10 +24,8 @@ namespace iox { - -enum class byte : uint8_t -{ -}; +/// @todo iox-#1900 use std::byte with c++17 +using byte = uint8_t; // AXIVION Next Construct AutosarC++19_03-M2.10.1 : log is a sensible namespace for a logger; furthermore it is in the // iox namespace and when used as function the compiler will complain From 1cfb14a31a1b58efa2c43b72698bf0652b59de23 Mon Sep 17 00:00:00 2001 From: Ibrahim Kuru Date: Fri, 24 Feb 2023 10:02:40 +0100 Subject: [PATCH 19/36] iox-##1913 Add more test cases Signed-off-by: Ibrahim Kuru --- .../test_container_uninitialized_array.cpp | 20 +++-- .../moduletests/test_container_vector.cpp | 78 +++++++++++++++++-- 2 files changed, 82 insertions(+), 16 deletions(-) diff --git a/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp b/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp index 71af5b1bc7..1b1369e8e5 100644 --- a/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp +++ b/iceoryx_hoofs/test/moduletests/test_container_uninitialized_array.cpp @@ -103,34 +103,38 @@ TEST(UninitializedArrayTest, capacityIsCorrect) TEST(UninitializedArrayTest, isNotCopyConstructible) { ::testing::Test::RecordProperty("TEST_ID", "abc31a08-77b2-4fd2-af14-3129bafda00c"); + constexpr uint64_t CAPACITY{31U}; - bool is_copy_constructible = std::is_copy_constructible>::value; - EXPECT_FALSE(is_copy_constructible); + bool isCopyConstructible = std::is_copy_constructible>::value; + EXPECT_FALSE(isCopyConstructible); } TEST(UninitializedArrayTest, isNotCopyAssignable) { ::testing::Test::RecordProperty("TEST_ID", "42c31a08-77b2-4fd2-6914-3129869da00c"); + constexpr uint64_t CAPACITY{69U}; - bool is_copy_assignable = std::is_copy_assignable>::value; - EXPECT_FALSE(is_copy_assignable); + bool isCopyAssignable = std::is_copy_assignable>::value; + EXPECT_FALSE(isCopyAssignable); } TEST(UninitializedArrayTest, isNotMoveConstructible) { ::testing::Test::RecordProperty("TEST_ID", "baf31a08-77b2-4692-6914-31298693100c"); + constexpr uint64_t CAPACITY{13U}; - bool is_move_constructible = std::is_move_constructible>::value; - EXPECT_FALSE(is_move_constructible); + bool isMoveConstructible = std::is_move_constructible>::value; + EXPECT_FALSE(isMoveConstructible); } TEST(UninitializedArrayTest, isNotMoveAssignable) { ::testing::Test::RecordProperty("TEST_ID", "caba1a08-77b2-4fd2-3114-3129842daa0c"); + constexpr uint64_t CAPACITY{42U}; - bool is_move_assignable = std::is_move_assignable>::value; - EXPECT_FALSE(is_move_assignable); + bool isMoveAssignable = std::is_move_assignable>::value; + EXPECT_FALSE(isMoveAssignable); } typedef ::testing::Types, diff --git a/iceoryx_hoofs/test/moduletests/test_container_vector.cpp b/iceoryx_hoofs/test/moduletests/test_container_vector.cpp index 87d856bc26..b8bbe3c2ef 100644 --- a/iceoryx_hoofs/test/moduletests/test_container_vector.cpp +++ b/iceoryx_hoofs/test/moduletests/test_container_vector.cpp @@ -963,20 +963,82 @@ TEST_F(vector_test, EraseOfMiddleElementCallsDTorAndMove) EXPECT_THAT(moveAssignment, Eq(2U)); } -TEST_F(vector_test, AccessOfNonExistingElementWithAtLeadTermination) +TEST_F(vector_test, AccessOfNonExistingElementOnEmptyVectorLeadTermination) { - ::testing::Test::RecordProperty("TEST_ID", "31a4f0fb-31dd-4269-9bec-31ef0542c42b"); - EXPECT_THAT(sut.empty(), Eq(true)); + ::testing::Test::RecordProperty("TEST_ID", "31a4f0fb-31dd-4119-baba-31efab42c42b"); + + ASSERT_THAT(sut.empty(), Eq(true)); - IOX_EXPECT_FATAL_FAILURE([&] { sut.at(69); }, iox::HoofsError::EXPECTS_ENSURES_FAILED); + const uint64_t accessOffset{sut.size() + 1U}; + IOX_EXPECT_FATAL_FAILURE([&] { sut.at(accessOffset); }, iox::HoofsError::EXPECTS_ENSURES_FAILED); } -TEST_F(vector_test, AccessOfNonExistingElementWithBracketLeadTermination) +TEST_F(vector_test, AccessOfNonExistingElementOnPartiallyFilledVectorLeadTermination) { - ::testing::Test::RecordProperty("TEST_ID", "69a4f0fb-3d31-4273-9bec-69ef05a4242b"); - EXPECT_THAT(sut.empty(), Eq(true)); + ::testing::Test::RecordProperty("TEST_ID", "13a1f2fb-01dd-3265-9bec-31ef0542c42b"); + constexpr int a{5}; + + for (uint64_t i = 0U; i < (VECTOR_CAPACITY - 2U); ++i) + { + ASSERT_THAT(sut.push_back(a), Eq(true)); + } + + const uint64_t accessOffset{sut.size() + 1U}; + IOX_EXPECT_FATAL_FAILURE([&] { sut.at(accessOffset); }, iox::HoofsError::EXPECTS_ENSURES_FAILED); +} + +TEST_F(vector_test, AccessOfNonExistingElementOnFullVectorLeadTermination) +{ + ::testing::Test::RecordProperty("TEST_ID", "42a4f0fb-71ad-1269-9b1c-71efca72c42b"); + constexpr int a{5}; + + for (uint64_t i = 0U; i < VECTOR_CAPACITY; ++i) + { + ASSERT_THAT(sut.push_back(a), Eq(true)); + } + + ASSERT_THAT(sut.size(), Eq(VECTOR_CAPACITY)); + + const uint64_t accessOffset{sut.size() + 1U}; + IOX_EXPECT_FATAL_FAILURE([&] { sut.at(accessOffset); }, iox::HoofsError::EXPECTS_ENSURES_FAILED); +} + +TEST_F(vector_test, OutOfBoundsAccessOnEmptyVectorLeadsToTermination) +{ + ::testing::Test::RecordProperty("TEST_ID", "13d4f0fb-baba-1273-9b1c-acab15a4212b"); + + ASSERT_THAT(sut.empty(), Eq(true)); + + const uint64_t accessOffset{sut.size() + 1U}; + IOX_EXPECT_FATAL_FAILURE([&] { sut[accessOffset]; }, iox::HoofsError::EXPECTS_ENSURES_FAILED); +} + +TEST_F(vector_test, OutOfBoundsAccessOnPartiallyFilledVectorLeadsToTermination) +{ + ::testing::Test::RecordProperty("TEST_ID", "59a4f0fb-ad31-c273-9b41-69153564242b"); + constexpr int a{5}; + + for (uint64_t i = 0U; i < (VECTOR_CAPACITY - 2U); ++i) + { + ASSERT_THAT(sut.push_back(a), Eq(true)); + } + + const uint64_t accessOffset{sut.size() + 1U}; + IOX_EXPECT_FATAL_FAILURE([&] { sut[accessOffset]; }, iox::HoofsError::EXPECTS_ENSURES_FAILED); +} + +TEST_F(vector_test, OutOfBoundsAccessOnFullVectorLeadsToTermination) +{ + ::testing::Test::RecordProperty("TEST_ID", "09a4fafa-3d31-3113-5bec-62ef01a4212b"); + constexpr int a{5}; + + for (uint64_t i = 0U; i < VECTOR_CAPACITY; ++i) + { + ASSERT_THAT(sut.push_back(a), Eq(true)); + } - IOX_EXPECT_FATAL_FAILURE([&] { sut[31]; }, iox::HoofsError::EXPECTS_ENSURES_FAILED); + const uint64_t accessOffset{sut.size() + 1U}; + IOX_EXPECT_FATAL_FAILURE([&] { sut[accessOffset]; }, iox::HoofsError::EXPECTS_ENSURES_FAILED); } TEST_F(vector_test, EraseOfFrontElementCallsDTorAndMove) From 0facdea0138084e9e8907fc06e00cec857c5a9e7 Mon Sep 17 00:00:00 2001 From: Ziad Mostafa Date: Tue, 14 Feb 2023 18:57:46 +0100 Subject: [PATCH 20/36] iox-#1692 Wrap c calls in posixCall Signed-off-by: Ziad Mostafa --- .../release-notes/iceoryx-unreleased.md | 1 + .../introspection_app.hpp | 1 - .../source/introspection_app.cpp | 24 ++++++++++--------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index c5fd40effa..bbf800fb69 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -119,6 +119,7 @@ - Remove `algorithm::uniqueMergeSortedContainers` from `algorithm.hpp` - Move `std::string` conversion function to `iceoryx_dust` [\#1612](https://github.com/eclipse-iceoryx/iceoryx/issues/1612) - The posix call `unlink` is directly used in `UnixDomainSocket` [\#1622](https://github.com/eclipse-iceoryx/iceoryx/issues/1622) +- Wrap all C calls in posixCall in IntrospectionApp [\#1692](https://github.com/eclipse-iceoryx/iceoryx/issues/1692) **Workflow:** diff --git a/tools/introspection/include/iceoryx_introspection/introspection_app.hpp b/tools/introspection/include/iceoryx_introspection/introspection_app.hpp index 9cbc64c5f9..b8c16ac913 100644 --- a/tools/introspection/include/iceoryx_introspection/introspection_app.hpp +++ b/tools/introspection/include/iceoryx_introspection/introspection_app.hpp @@ -62,7 +62,6 @@ static const std::map prettyMap = { /// @brief base class for introspection -/// @todo iox-#1692 Wrap all C calls with posixCall class IntrospectionApp { public: diff --git a/tools/introspection/source/introspection_app.cpp b/tools/introspection/source/introspection_app.cpp index 102e3c126d..d8ed986c8b 100644 --- a/tools/introspection/source/introspection_app.cpp +++ b/tools/introspection/source/introspection_app.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2019 - 2020 by Robert Bosch GmbH. All rights reserved. -// Copyright (c) 2020 - 2021 by Apex.AI Inc. All rights reserved. +// Copyright (c) 2020 - 2023 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -228,15 +228,16 @@ void IntrospectionApp::waitForUserInput(int32_t timeoutMs) fileDesc.fd = STDIN_FILENO; fileDesc.events = POLLIN; constexpr size_t nFileDesc = 1u; - /// @todo iox-#1692 Wrap kernel calls with posixCall - int32_t eventCount = poll(&fileDesc, nFileDesc, timeoutMs); - - // Event detected - if ((eventCount == nFileDesc) && (fileDesc.revents == POLLIN)) - { - updateDisplayYX(); - refreshTerminal(); - } + iox::posix::posixCall(poll)(&fileDesc, nFileDesc, timeoutMs) + .failureReturnValue(-1) + .evaluate() + .and_then([&](auto eventCount) { + if (static_cast(eventCount.value) == nFileDesc && fileDesc.revents == POLLIN) + { + this->updateDisplayYX(); + this->refreshTerminal(); + } + }); } void IntrospectionApp::prettyPrint(const std::string& str, const PrettyOptions pr) @@ -791,7 +792,8 @@ void IntrospectionApp::runIntrospection(const iox::units::Duration updatePeriod, } } - getchar(); + iox::posix::posixCall(getchar)().failureReturnValue(EOF).evaluate().expect( + "unable to exit the introspection client since getchar failed"); closeTerminal(); } From ea72b7c2b1caeeb1fb3ede2e2cfb605af892aa54 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Mon, 27 Feb 2023 14:04:26 +0100 Subject: [PATCH 21/36] iox-#1394 Fix Axivion warnings in 'type_traits' --- .../primitives/include/iox/type_traits.hpp | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/iceoryx_hoofs/primitives/include/iox/type_traits.hpp b/iceoryx_hoofs/primitives/include/iox/type_traits.hpp index 772a7ff52b..cde934f22a 100644 --- a/iceoryx_hoofs/primitives/include/iox/type_traits.hpp +++ b/iceoryx_hoofs/primitives/include/iox/type_traits.hpp @@ -134,12 +134,12 @@ struct is_char_array : std::false_type }; template -// AXIVION Next Construct AutosarC++19_03-A18.1.1 : struct used to deduce char array types, it -// does not use them -/// @NOLINTNEXTLINE(hicpp-avoid-c-arrays,cppcoreguidelines-avoid-c-arrays) +// AXIVION DISABLE STYLE AutosarC++19_03-A18.1.1 : struct used to deduce char array types, it does not use them +// NOLINTNEXTLINE(hicpp-avoid-c-arrays,cppcoreguidelines-avoid-c-arrays) struct is_char_array : std::true_type { }; +// AXIVION ENABLE STYLE AutosarC++19_03-A18.1.1 /// @brief Maps a sequence of any types to the type void template @@ -149,12 +149,14 @@ using void_t = void; /// BEGIN TypeInfo ////////////////// -/// @brief Provides a translation from a type into its human readable name -/// NOLINTJUSTIFICATION The name should be stored in a compile time variable. Access is always -/// safe since it is null terminated and always constant. Other alternatives are not available -/// at compile time. -/// NOLINTBEGIN(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays) +// AXIVION DISABLE STYLE AutosarC++19_03-A8.5.2 : Initialization with equal sign is okay here and needed for MSVC +// AXIVION DISABLE STYLE AutosarC++19_03-A3.1.4 : See NOLINTJUSTIFICATION below +// NOLINTJUSTIFICATION The name should be stored in a compile time variable. Access is always +// safe since it is null terminated and always constant. Other alternatives are not available +// at compile time. +// NOLINTBEGIN(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays) +/// @brief Provides a translation from a type into its human readable name template struct TypeInfo { @@ -236,6 +238,7 @@ struct TypeInfo static constexpr const char NAME[] = "double"; }; +// AXIVION Next Construct AutosarC++19_03-A0.4.2 : The type is not directly used but only to get a string representation of the type template <> struct TypeInfo { @@ -249,7 +252,10 @@ struct TypeInfo> }; template constexpr const char TypeInfo>::NAME[]; -/// NOLINTEND(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays) +// NOLINTEND(hicpp-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays) +// AXIVION ENABLE STYLE AutosarC++19_03-A3.1.4 +// AXIVION ENABLE STYLE AutosarC++19_03-A8.5.2 + ////////////////// /// END TypeInfo ////////////////// From 21d2a2f353faa675932aa5a56ed1cfb59f4a8d4d Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Mon, 27 Feb 2023 14:15:23 +0100 Subject: [PATCH 22/36] iox-#1394 Fix Axivion warnings in `relativ_pointer` --- .../memory/include/iox/detail/relative_pointer.inl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iceoryx_hoofs/memory/include/iox/detail/relative_pointer.inl b/iceoryx_hoofs/memory/include/iox/detail/relative_pointer.inl index 098b7db74d..80892ce119 100644 --- a/iceoryx_hoofs/memory/include/iox/detail/relative_pointer.inl +++ b/iceoryx_hoofs/memory/include/iox/detail/relative_pointer.inl @@ -201,9 +201,14 @@ inline T* RelativePointer::getPtr(const segment_id_t id, const offset_t offse return nullptr; } const auto* const basePtr = getBasePtr(id); - // AXIVION Next Construct AutosarC++19_03-A5.2.4, AutosarC++19_03-M5.2.8, AutosarC++19_03-M5.2.6, AutosarC++19_03-M5.2.9 : Cast needed for pointer arithmetic + // AXIVION DISABLE STYLE AutosarC++19_03-A5.2.4 : Cast needed for pointer arithmetic + // AXIVION DISABLE STYLE AutosarC++19_03-M5.2.8 : Cast needed for pointer arithmetic + // AXIVION DISABLE STYLE AutosarC++19_03-M5.2.9 : Cast needed for pointer arithmetic // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast, performance-no-int-to-ptr) return reinterpret_cast(offset + reinterpret_cast(basePtr)); + // AXIVION ENABLE STYLE AutosarC++19_03-M5.2.9 + // AXIVION ENABLE STYLE AutosarC++19_03-M5.2.8 + // AXIVION ENABLE STYLE AutosarC++19_03-A5.2.4 } template From 9ef3d3f66e0ac2d4b18cac26853a22499ef56ae2 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Mon, 27 Feb 2023 14:19:33 +0100 Subject: [PATCH 23/36] iox-#1394 Fix Axivion warnings in 'filesystem' --- iceoryx_hoofs/filesystem/include/iox/detail/filesystem.inl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iceoryx_hoofs/filesystem/include/iox/detail/filesystem.inl b/iceoryx_hoofs/filesystem/include/iox/detail/filesystem.inl index 95e21ff32c..b076ceccfb 100644 --- a/iceoryx_hoofs/filesystem/include/iox/detail/filesystem.inl +++ b/iceoryx_hoofs/filesystem/include/iox/detail/filesystem.inl @@ -39,7 +39,8 @@ inline bool isValidPathEntry(const iox::string& name, // AXIVION Next Construct AutosarC++19_03-A3.9.1: Not used as an integer but as actual character const char c{name[i]}; - // AXIVION DISABLE STYLE AutosarC++19_03-A0.1.1, FaultDetection-UnusedAssignments : False positive, variable IS used + // AXIVION DISABLE STYLE FaultDetection-UnusedAssignments : False positive, variable IS used + // AXIVION DISABLE STYLE AutosarC++19_03-A0.1.1 : False positive, variable IS used // AXIVION DISABLE STYLE AutosarC++19_03-M4.5.3 : We are explicitly checking for ASCII characters which have defined consecutive values const bool isSmallLetter{(internal::ASCII_A <= c) && (c <= internal::ASCII_Z)}; const bool isCapitalLetter{(internal::ASCII_CAPITAL_A <= c) && (c <= internal::ASCII_CAPITAL_Z)}; @@ -47,7 +48,8 @@ inline bool isValidPathEntry(const iox::string& name, const bool isSpecialCharacter{((c == internal::ASCII_DASH) || (c == internal::ASCII_DOT)) || ((c == internal::ASCII_COLON) || (c == internal::ASCII_UNDERSCORE))}; // AXIVION ENABLE STYLE AutosarC++19_03-M4.5.3 - // AXIVION ENABLE STYLE AutosarC++19_03-A0.1.1, FaultDetection-UnusedAssignments + // AXIVION ENABLE STYLE AutosarC++19_03-A0.1.1 + // AXIVION ENABLE STYLE FaultDetection-UnusedAssignments if ((!isSmallLetter && !isCapitalLetter) && (!isNumber && !isSpecialCharacter)) { From 0072b564c57f7b9830091197be67b1aecd5d71cc Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Mon, 27 Feb 2023 14:21:08 +0100 Subject: [PATCH 24/36] iox-#1394 Fix Axivion warnings in 'vector.inl' --- iceoryx_hoofs/container/include/iox/detail/vector.inl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iceoryx_hoofs/container/include/iox/detail/vector.inl b/iceoryx_hoofs/container/include/iox/detail/vector.inl index 6f71e0bea3..cc8e5d0478 100644 --- a/iceoryx_hoofs/container/include/iox/detail/vector.inl +++ b/iceoryx_hoofs/container/include/iox/detail/vector.inl @@ -246,9 +246,10 @@ inline bool vector::resize(const uint64_t count, const Targs&... ar template inline T* vector::data() noexcept { - // AXIVION Next Construct AutosarC++19_03-A5.2.3 : const cast to avoid code duplication + // AXIVION DISABLE STYLE AutosarC++19_03-A5.2.3 : const cast to avoid code duplication // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast) return const_cast(const_cast*>(this)->data()); + // AXIVION ENABLE STYLE AutosarC++19_03-A5.2.3 } template From 46f6e01eca1136881191560d3fcdd95e0daf3417 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Mon, 27 Feb 2023 14:25:40 +0100 Subject: [PATCH 25/36] iox-#1394 Fix Axivion warnings in 'functional_interface' --- .../design/include/iox/detail/functional_interface.inl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iceoryx_hoofs/design/include/iox/detail/functional_interface.inl b/iceoryx_hoofs/design/include/iox/detail/functional_interface.inl index d5a199b27f..340db54b90 100644 --- a/iceoryx_hoofs/design/include/iox/detail/functional_interface.inl +++ b/iceoryx_hoofs/design/include/iox/detail/functional_interface.inl @@ -194,8 +194,7 @@ template inline const Derived& AndThen::and_then(const and_then_callback_t& callable) const& noexcept { using Self = AndThen; - // AXIVION Next Construct AutosarC++19_03-A5.2.3 : const_cast avoids code duplication, is safe since the constness - // of the return value is restored + // AXIVION Next Construct AutosarC++19_03-A5.2.3 : const_cast avoids code duplication, is safe since the constness of the return value is restored // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast) return const_cast(const_cast(this)->and_then(callable)); } @@ -210,9 +209,10 @@ template inline const Derived&& AndThen::and_then(const and_then_callback_t& callable) const&& noexcept { using Self = AndThen; - // AXIVION Next Construct AutosarC++19_03-A5.2.3 : const_cast avoids code duplication, is safe since the constness of the return value is restored + // AXIVION DISABLE STYLE AutosarC++19_03-A5.2.3 : const_cast avoids code duplication, is safe since the constness of the return value is restored // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast) return std::move(const_cast(const_cast(this)->and_then(callable))); + // AXIVION ENABLE STYLE AutosarC++19_03-A5.2.3 } // END and_then From 6af1803cd022a0bf517d152ad146a9ccd9f8a475 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Mon, 27 Feb 2023 14:45:03 +0100 Subject: [PATCH 26/36] iox-#1394 Add 'noexcept' related todo to 'scoped_static.inl' --- iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl | 1 + 1 file changed, 1 insertion(+) diff --git a/iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl b/iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl index 9acc040c02..842fbe28b1 100644 --- a/iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl +++ b/iceoryx_hoofs/memory/include/iox/detail/scoped_static.inl @@ -25,6 +25,7 @@ template inline ScopeGuard makeScopedStatic(T& memory, CTorArgs&&... ctorArgs) noexcept { memory.emplace(std::forward(ctorArgs)...); + /// @todo iox-#1392 make noexcept dependent on the actual used type return ScopeGuard([&memory]() noexcept { memory.reset(); }); } } // namespace iox From 40a9b636c0c191d40e680f10529e0509b3568cd9 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Mon, 27 Feb 2023 15:57:57 +0100 Subject: [PATCH 27/36] iox-#1394 Fix Axivion warnings in 'string' --- iceoryx_hoofs/vocabulary/include/iox/detail/string.inl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iceoryx_hoofs/vocabulary/include/iox/detail/string.inl b/iceoryx_hoofs/vocabulary/include/iox/detail/string.inl index 328e3e443c..ca2376d3c9 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/detail/string.inl +++ b/iceoryx_hoofs/vocabulary/include/iox/detail/string.inl @@ -123,8 +123,8 @@ inline string::string(TruncateToCapacity_t, const char* const other, c } else if (Capacity < count) { -// AXIVION DISABLE STYLE AutosarC++19_03-A16.0.1, AutosarC++19_03-A16.7.1: conditional compilation is required for setting gcc diagnostics, since -// gcc 8 incorrectly warns here about out of bounds array access +// AXIVION DISABLE STYLE AutosarC++19_03-A16.0.1: pre-processor is required for setting gcc diagnostics, since gcc 8 incorrectly warns here about out of bounds array access +// AXIVION DISABLE STYLE AutosarC++19_03-A16.7.1: see rule 'A16.0.1' above #if (defined(__GNUC__) && (__GNUC__ == 8)) && (__GNUC_MINOR__ >= 3) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" @@ -133,6 +133,7 @@ inline string::string(TruncateToCapacity_t, const char* const other, c #if (defined(__GNUC__) && (__GNUC__ == 8)) && (__GNUC_MINOR__ >= 3) #pragma GCC diagnostic pop #endif + // AXIVION ENABLE STYLE AutosarC++19_03-A16.7.1 // AXIVION ENABLE STYLE AutosarC++19_03-A16.0.1 m_rawstring[Capacity] = '\0'; From cbab7c78e19f3110434334809acc5d4c37bd4083 Mon Sep 17 00:00:00 2001 From: Simon Hoinkis Date: Mon, 27 Feb 2023 16:55:41 +0100 Subject: [PATCH 28/36] iox-#1394 Address left-over AUTOSAR warnings in 'function_ref' Signed-off-by: Simon Hoinkis --- .../functional/include/iox/detail/function_ref.inl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iceoryx_hoofs/functional/include/iox/detail/function_ref.inl b/iceoryx_hoofs/functional/include/iox/detail/function_ref.inl index 2d0c43ed67..f78c400e96 100644 --- a/iceoryx_hoofs/functional/include/iox/detail/function_ref.inl +++ b/iceoryx_hoofs/functional/include/iox/detail/function_ref.inl @@ -91,11 +91,13 @@ function_ref::operator=(function_ref +// AXIVION Next Construct AutosarC++19_03-A15.4.2, AutosarC++19_03-A15.5.3, FaultDetection-NoexceptViolations : Intentional behavior. The library itself does not throw and on the implementation side a try-catch block can be used inline ReturnType function_ref::operator()(ArgTypes... args) const noexcept { // Expect that a callable was assigned beforehand - // AXIVION Next Line AutosarC++19_03-M5.3.1 : 'nullptr' check shall be performed explicitly - cxx::ExpectsWithMsg(m_pointerToCallable != nullptr, "Empty function_ref invoked"); + cxx::ExpectsWithMsg((m_pointerToCallable != nullptr) && (m_functionPointer != nullptr), + "Empty function_ref invoked"); + // AXIVION Next Line AutosarC++19_03-M0.3.1, FaultDetection-NullPointerDereference : 'nullptr' check is done above return m_functionPointer(m_pointerToCallable, std::forward(args)...); } From f445545327e983546cfb0d8343e05128c5d9c618 Mon Sep 17 00:00:00 2001 From: Matthias Killat Date: Mon, 27 Feb 2023 17:35:16 +0100 Subject: [PATCH 29/36] iox-#1394 Fix Axivion warnings in 'storable_function' --- .../include/iox/detail/storable_function.inl | 61 +++++++++++-------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/iceoryx_hoofs/functional/include/iox/detail/storable_function.inl b/iceoryx_hoofs/functional/include/iox/detail/storable_function.inl index adbd735bb5..5633a5f244 100644 --- a/iceoryx_hoofs/functional/include/iox/detail/storable_function.inl +++ b/iceoryx_hoofs/functional/include/iox/detail/storable_function.inl @@ -23,8 +23,8 @@ namespace iox { -// AXIVION Next Construct AutosarC++19_03-A12.6.1: members are initialized in body before read access -// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) +// AXIVION DISABLE STYLE AutosarC++19_03-A12.6.1: members are initialized before read access +// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) template template inline storable_function>::storable_function(const Functor& functor) noexcept @@ -36,15 +36,14 @@ inline storable_function>::storable_fun // to lack of sufficient common initialization // AXIVION Next Construct AutosarC++19_03-M5.2.6: the converted pointer is only used // as its original function pointer type after reconversion (type erasure) -// AXIVION Next Construct AutosarC++19_03-A12.6.1: members are default initialized -// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) +// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) members are default initialized template inline storable_function>::storable_function( ReturnType (*function)(Args...)) noexcept : // AXIVION Next Construct AutosarC++19_03-A5.2.4: reinterpret_cast is required for type erasure, // we use type erasure in combination with compile time template arguments to restore // the correct type whenever the callable is used - /// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) m_callable(reinterpret_cast(function)) , m_invoker(&invokeFreeFunction) { @@ -55,37 +54,44 @@ inline storable_function>::storable_fun // destroy is not needed for free functions } -// AXIVION Next Construct AutosarC++19_03-A12.6.1: members are default initialized -// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) +// AXIVION DISABLE STYLE AutosarC++19_03-M0.3.1: Pointer p aliases a reference and method is a member function pointer that cannot be null (*) +// AXIVION DISABLE STYLE AutosarC++19_03-A5.3.2: see rule 'M0.3.1' above +// AXIVION DISABLE STYLE FaultDetection-NullPointerDereference: see rule 'M0.3.1' above + +// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) members are default initialized template template inline storable_function>::storable_function( T& object, ReturnType (T::*method)(Args...)) noexcept { - const auto p = &object; - // AXIVION Next Construct AutosarC++19_03-A7.1.1: type erased functor lambda cannot be const - // as it may change by calling its operator() later (hence stored as non-const) - auto functor = [p, method](Args... args) -> ReturnType { return (*p.*method)(std::forward(args)...); }; + T* const p{&object}; + const auto functor = [p, method](Args... args) noexcept -> ReturnType { + return (*p.*method)(std::forward(args)...); + }; + storeFunctor(functor); } -// AXIVION Next Construct AutosarC++19_03-A12.6.1: members are default initialized -// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) +// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) template template inline storable_function>::storable_function(const T& object, ReturnType (T::*method)(Args...) const) noexcept { - const auto p = &object; - // AXIVION Next Construct AutosarC++19_03-A7.1.1: type erased functor lambda cannot be const - // as it may change by calling its operator() later (hence stored as non-const) - const auto functor = [p, method](Args... args) -> ReturnType { return (*p.*method)(std::forward(args)...); }; + const T* const p{&object}; + const auto functor = [p, method](Args... args) noexcept -> ReturnType { + return (*p.*method)(std::forward(args)...); + }; + storeFunctor(functor); } -// AXIVION Next Construct AutosarC++19_03-A12.6.1: m_storage is default initialized -// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) +// AXIVION ENABLE STYLE FaultDetection-NullPointerDereference +// AXIVION ENABLE STYLE AutosarC++19_03-A5.3.2 +// AXIVION ENABLE STYLE AutosarC++19_03-M0.3.1 + +// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) m_storage is default initialized template inline storable_function>::storable_function( const storable_function& other) noexcept @@ -97,8 +103,7 @@ inline storable_function>::storable_fun // AXIVION Next Construct AutosarC++19_03-A12.8.4: we copy only the operation pointer table // (required) and will perform a move with its type erased move function -// AXIVION Next Construct AutosarC++19_03-A12.6.1: m_storage is default initialized -// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) +// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, hicpp-member-init) m_storage is default initialized template inline storable_function>::storable_function( storable_function&& other) noexcept @@ -107,6 +112,7 @@ inline storable_function>::storable_fun { m_operations.move(other, *this); } +// AXIVION ENABLE STYLE AutosarC++19_03-A12.6.1 template inline storable_function>& @@ -146,6 +152,8 @@ inline storable_function>::~storable_fu m_operations.destroy(*this); } +// AXIVION Next Construct AutosarC++19_03-A7.5.2: false positive, operator() does not call itself +// but the invoked function can be recursive in general (entirely controllable by caller) // AXIVION Next Construct AutosarC++19_03-A2.10.1: false positive, args does not hide anything template inline ReturnType storable_function>::operator()(Args... args) const noexcept @@ -176,13 +184,15 @@ inline constexpr void* storable_function>::safeAlign(void* startAddress) noexcept { static_assert(is_storable(), "type does not fit into storage"); - // AXIVION DISABLE STYLE AutosarC++19_03-A5.2.4, AutosarC++19_03-M5.2.9 : Cast required for low level pointer alignment + // AXIVION DISABLE STYLE AutosarC++19_03-A5.2.4 : Cast required for low level pointer alignment + // AXIVION DISABLE STYLE AutosarC++19_03-M5.2.9 : Conversion required for low level pointer alignment // NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast, performance-no-int-to-ptr) const uint64_t alignment{alignof(T)}; const uint64_t alignedPosition{align(reinterpret_cast(startAddress), alignment)}; return reinterpret_cast(alignedPosition); // NOLINTEND(cppcoreguidelines-pro-type-reinterpret-cast, performance-no-int-to-ptr) - // AXIVION ENABLE STYLE AutosarC++19_03-A5.2.4, AutosarC++19_03-M5.2.9 + // AXIVION ENABLE STYLE AutosarC++19_03-M5.2.9 + // AXIVION ENABLE STYLE AutosarC++19_03-A5.2.4 } template @@ -286,12 +296,13 @@ template inline ReturnType storable_function>::invoke(void* callable, Args&&... args) noexcept { - // AXIVION Next Construct AutosarC++19_03-A18.9.2: we use idiomatic perfect forwarding + // AXIVION DISABLE STYLE AutosarC++19_03-A18.9.2: we use idiomatic perfect forwarding // AXIVION Next Construct AutosarC++19_03-M5.2.8: type erasure - conversion to compatible type // AXIVION Next Construct AutosarC++19_03-A5.3.2: callable is guaranteed not to be nullptr // when invoke is called (it is private and only used for type erasure) // NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage) see justification above return (*static_cast(callable))(std::forward(args)...); + // AXIVION ENABLE STYLE AutosarC++19_03-A18.9.2 } // AXIVION Next Construct AutosarC++19_03-A2.10.1: false positive, args does not hide anything @@ -309,7 +320,7 @@ storable_function>::invokeFreeFunction( // AXIVION Next Construct AutosarC++19_03-A5.2.4: reinterpret_cast is required for type erasure // type erasure in combination with compile time template arguments to restore the correct type // when the callable is called - /// @NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) return (reinterpret_cast(callable))(std::forward(args)...); } From e5d9a2296c34de80e724d138789c200c13fba8c0 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Mon, 27 Feb 2023 19:36:04 +0100 Subject: [PATCH 30/36] iox-#1394 Add noexecept(false) to ostream operator --- iceoryx_hoofs/vocabulary/include/iox/detail/string.inl | 2 +- iceoryx_hoofs/vocabulary/include/iox/string.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iceoryx_hoofs/vocabulary/include/iox/detail/string.inl b/iceoryx_hoofs/vocabulary/include/iox/detail/string.inl index ca2376d3c9..dd96b1fb76 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/detail/string.inl +++ b/iceoryx_hoofs/vocabulary/include/iox/detail/string.inl @@ -310,7 +310,7 @@ inline string& string::move(string&& rhs) noexcept // AXIVION Next Construct AutosarC++19_03-M5.17.1: This is not used as shift operator but as stream operator and does // not require to implement '<<=' template -inline std::ostream& operator<<(std::ostream& stream, const string& str) noexcept +inline std::ostream& operator<<(std::ostream& stream, const string& str) noexcept(false) { stream << str.c_str(); return stream; diff --git a/iceoryx_hoofs/vocabulary/include/iox/string.hpp b/iceoryx_hoofs/vocabulary/include/iox/string.hpp index 3b7f7107d6..771db927a6 100644 --- a/iceoryx_hoofs/vocabulary/include/iox/string.hpp +++ b/iceoryx_hoofs/vocabulary/include/iox/string.hpp @@ -545,7 +545,7 @@ class string final /// /// @return the stream output of the fixed string template -std::ostream& operator<<(std::ostream& stream, const string& str) noexcept; +std::ostream& operator<<(std::ostream& stream, const string& str) noexcept(false); /// @brief Logging support for the fixed string /// From 23b2c93832e996b292dc88de13ec2b7c246332ff Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Tue, 28 Feb 2023 18:11:11 +0100 Subject: [PATCH 31/36] iox-#1930 Remove backticks from all the code --- .../include/iceoryx_binding_c/client.h | 6 +++--- .../include/iceoryx_binding_c/publisher.h | 6 +++--- .../include/iceoryx_binding_c/server.h | 6 +++--- .../include/iceoryx_binding_c/types.h | 2 +- .../cli/command_line_argument_definition.hpp | 12 ++++++------ .../iceoryx_dust/internal/cli/arguments.hpp | 2 +- .../waitset/ice_waitset_grouping.cpp | 2 +- .../waitset/ice_waitset_individual.cpp | 2 +- .../waitset/ice_waitset_trigger.cpp | 2 +- .../waitset_in_c/ice_c_waitset_grouping.c | 2 +- .../waitset_in_c/ice_c_waitset_individual.c | 2 +- .../iceoryx_hoofs/iceoryx_hoofs_types.hpp | 2 +- .../iceoryx_posh/capro/service_description.hpp | 8 ++++---- .../iceoryx_posh/iceoryx_posh_types.hpp | 8 ++++---- .../internal/capro/capro_message.hpp | 8 ++++---- .../internal/mepoo/memory_manager.hpp | 8 ++++---- .../iceoryx_posh/internal/popo/base_client.hpp | 2 +- .../internal/popo/base_publisher.hpp | 2 +- .../iceoryx_posh/internal/popo/base_server.hpp | 2 +- .../internal/popo/base_subscriber.hpp | 4 ++-- .../popo/building_blocks/chunk_receiver.hpp | 8 ++++---- .../popo/building_blocks/chunk_sender.hpp | 8 ++++---- .../iceoryx_posh/internal/popo/client_impl.hpp | 2 +- .../iceoryx_posh/internal/popo/client_impl.inl | 2 +- .../internal/popo/ports/client_port_user.hpp | 8 ++++---- .../internal/popo/ports/server_port_user.hpp | 16 ++++++++-------- .../internal/popo/publisher_impl.hpp | 2 +- .../iceoryx_posh/internal/popo/server_impl.hpp | 2 +- .../iceoryx_posh/internal/popo/server_impl.inl | 2 +- .../iceoryx_posh/internal/popo/smart_chunk.hpp | 8 ++++---- .../internal/popo/subscriber_impl.hpp | 2 +- .../internal/popo/typed_port_api_trait.hpp | 2 +- .../internal/popo/untyped_client_impl.hpp | 8 ++++---- .../internal/popo/untyped_publisher_impl.hpp | 2 +- .../internal/popo/untyped_server_impl.hpp | 8 ++++---- .../internal/popo/untyped_subscriber_impl.hpp | 4 ++-- .../memory/mempool_collection_memory_block.hpp | 2 +- .../mempool_segment_manager_memory_block.hpp | 2 +- .../roudi/memory/port_pool_memory_block.hpp | 2 +- .../iceoryx_posh/mepoo/chunk_header.hpp | 18 +++++++++--------- .../include/iceoryx_posh/popo/response.hpp | 2 +- .../include/iceoryx_posh/popo/sample.hpp | 4 ++-- iceoryx_posh/source/mepoo/chunk_header.cpp | 2 +- .../source/popo/ports/client_port_roudi.cpp | 2 +- .../test_service_discovery.cpp | 2 +- .../test/moduletests/test_popo_client_port.cpp | 2 +- .../moduletests/test_popo_server_port_user.cpp | 2 +- .../test_roudi_service_registry.cpp | 2 +- .../introspection/source/introspection_app.cpp | 2 +- 49 files changed, 108 insertions(+), 108 deletions(-) diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/client.h b/iceoryx_binding_c/include/iceoryx_binding_c/client.h index 06baaee960..3979008dfe 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/client.h +++ b/iceoryx_binding_c/include/iceoryx_binding_c/client.h @@ -43,7 +43,7 @@ typedef struct /// @brief Sets whether the client blocks when the server request queue is full ENUM iox_ConsumerTooSlowPolicy serverTooSlowPolicy; - /// @brief this value will be set exclusively by `iox_client_options_init` and is not supposed to be modified + /// @brief this value will be set exclusively by 'iox_client_options_init' and is not supposed to be modified /// otherwise uint64_t initCheck; } iox_client_options_t; @@ -85,8 +85,8 @@ void iox_client_deinit(iox_client_t const self); /// @param[in] payloadSize user-payload size of the allocated request /// @return on success it returns AllocationResult_SUCCESS otherwise a value which /// describes the error -/// @note for the user-payload alignment `IOX_C_CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT` is used -/// for a custom user-payload alignment please use `iox_client_loan_aligned_request` +/// @note for the user-payload alignment 'IOX_C_CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT' is used +/// for a custom user-payload alignment please use 'iox_client_loan_aligned_request' ENUM iox_AllocationResult iox_client_loan_request(iox_client_t const self, void** const payload, const uint32_t payloadSize); diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/publisher.h b/iceoryx_binding_c/include/iceoryx_binding_c/publisher.h index 93af309858..022d29e49b 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/publisher.h +++ b/iceoryx_binding_c/include/iceoryx_binding_c/publisher.h @@ -42,7 +42,7 @@ typedef struct /// @brief describes whether a publisher blocks when subscriber queue is full ENUM iox_ConsumerTooSlowPolicy subscriberTooSlowPolicy; - /// @brief this value will be set exclusively by `iox_pub_options_init` and is not supposed to be modified otherwise + /// @brief this value will be set exclusively by 'iox_pub_options_init' and is not supposed to be modified otherwise uint64_t initCheck; } iox_pub_options_t; @@ -83,8 +83,8 @@ void iox_pub_deinit(iox_pub_t const self); /// @param[in] userPayloadSize user-payload size of the allocated chunk /// @return on success it returns AllocationResult_SUCCESS otherwise a value which /// describes the error -/// @note for the user-payload alignment `IOX_C_CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT` is used -/// for a custom user-payload alignment please use `iox_pub_loan_aligned_chunk` +/// @note for the user-payload alignment 'IOX_C_CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT' is used +/// for a custom user-payload alignment please use 'iox_pub_loan_aligned_chunk' ENUM iox_AllocationResult iox_pub_loan_chunk(iox_pub_t const self, void** const userPayload, const uint32_t userPayloadSize); diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/server.h b/iceoryx_binding_c/include/iceoryx_binding_c/server.h index 064981f214..d88ce05f46 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/server.h +++ b/iceoryx_binding_c/include/iceoryx_binding_c/server.h @@ -43,7 +43,7 @@ typedef struct /// @brief Sets whether the server blocks when the client response queue is full ENUM iox_ConsumerTooSlowPolicy clientTooSlowPolicy; - /// @brief this value will be set exclusively by `iox_server_options_init` and is not supposed to be modified + /// @brief this value will be set exclusively by 'iox_server_options_init' and is not supposed to be modified /// otherwise uint64_t initCheck; } iox_server_options_t; @@ -98,8 +98,8 @@ void iox_server_release_request(iox_server_t const self, const void* const paylo /// @param[in] payloadSize user-payload size of the allocated request /// @return on success it returns AllocationResult_SUCCESS otherwise a value which /// describes the error -/// @note for the user-payload alignment `IOX_C_CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT` is used -/// for a custom user-payload alignment please use `iox_server_loan_aligned_response` +/// @note for the user-payload alignment 'IOX_C_CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT' is used +/// for a custom user-payload alignment please use 'iox_server_loan_aligned_response' ENUM iox_AllocationResult iox_server_loan_response(iox_server_t const self, const void* const requestPayload, void** const payload, diff --git a/iceoryx_binding_c/include/iceoryx_binding_c/types.h b/iceoryx_binding_c/include/iceoryx_binding_c/types.h index b3786accab..c3a5870040 100644 --- a/iceoryx_binding_c/include/iceoryx_binding_c/types.h +++ b/iceoryx_binding_c/include/iceoryx_binding_c/types.h @@ -64,7 +64,7 @@ typedef struct /// @brief handle of the chunk header typedef struct { - // could be empty but then we get `struct has no members` warning + // could be empty but then we get 'struct has no members' warning uint8_t do_not_touch_me[1]; } iox_chunk_header_t; diff --git a/iceoryx_dust/include/iceoryx_dust/cli/command_line_argument_definition.hpp b/iceoryx_dust/include/iceoryx_dust/cli/command_line_argument_definition.hpp index 75e660b39d..1c8f69d1f9 100644 --- a/iceoryx_dust/include/iceoryx_dust/cli/command_line_argument_definition.hpp +++ b/iceoryx_dust/include/iceoryx_dust/cli/command_line_argument_definition.hpp @@ -35,8 +35,8 @@ /// @param[in] type the type of the optional value /// @param[in] memberName the name under which the optional value is accessible /// @param[in] defaultValue the value when it is not set from outside -/// @param[in] shortName a single character for the short option like `-s` for instance -/// @param[in] longName a long option name under which this can be accessed like `--some-name` for instance +/// @param[in] shortName a single character for the short option like '-s' for instance +/// @param[in] longName a long option name under which this can be accessed like '--some-name' for instance /// @param[in] description a description of the optional value #define IOX_CLI_OPTIONAL(type, memberName, defaultValue, shortName, longName, description) \ IOX_INTERNAL_CMD_LINE_VALUE( \ @@ -46,8 +46,8 @@ /// terminate /// @param[in] type the type of the required value /// @param[in] memberName the name under which the required value is accessible -/// @param[in] shortName a single character for the short option like `-s` for instance -/// @param[in] longName a long option name under which this can be accessed like `--some-name` for instance +/// @param[in] shortName a single character for the short option like '-s' for instance +/// @param[in] longName a long option name under which this can be accessed like '--some-name' for instance /// @param[in] description a description of the required value #define IOX_CLI_REQUIRED(type, memberName, shortName, longName, description) \ IOX_INTERNAL_CMD_LINE_VALUE( \ @@ -55,8 +55,8 @@ /// @brief Adds a switch to the command line /// @param[in] memberName the name under which the switch is accessible -/// @param[in] shortName a single character for the short option like `-s` for instance -/// @param[in] longName a long option name under which this can be accessed like `--some-name` for instance +/// @param[in] shortName a single character for the short option like '-s' for instance +/// @param[in] longName a long option name under which this can be accessed like '--some-name' for instance /// @param[in] description a description of the switch #define IOX_CLI_SWITCH(memberName, shortName, longName, description) \ IOX_INTERNAL_CMD_LINE_VALUE(bool, memberName, false, shortName, longName, description, iox::cli::OptionType::SWITCH) diff --git a/iceoryx_dust/include/iceoryx_dust/internal/cli/arguments.hpp b/iceoryx_dust/include/iceoryx_dust/internal/cli/arguments.hpp index f68263cb95..84168cf3d3 100644 --- a/iceoryx_dust/include/iceoryx_dust/internal/cli/arguments.hpp +++ b/iceoryx_dust/include/iceoryx_dust/internal/cli/arguments.hpp @@ -33,7 +33,7 @@ namespace internal /// CommandLineParser::parse creates and returns a populated Arguments /// object. /// This class should never be used directly. Use the CommandLine builder -/// from `iceoryx_hoofs/cxx/command_line_argument_definition.hpp` to create a struct which contains +/// from 'iceoryx_hoofs/cxx/command_line_argument_definition.hpp' to create a struct which contains /// the values. class Arguments { diff --git a/iceoryx_examples/waitset/ice_waitset_grouping.cpp b/iceoryx_examples/waitset/ice_waitset_grouping.cpp index f8ca8739a3..fb8d9207b4 100644 --- a/iceoryx_examples/waitset/ice_waitset_grouping.cpp +++ b/iceoryx_examples/waitset/ice_waitset_grouping.cpp @@ -121,7 +121,7 @@ int main() std::cout << "dismiss data\n"; auto subscriber = notification->getOrigin(); // We need to release the data to reset the trigger hasData - // otherwise the WaitSet would notify us in `waitset.wait()` again + // otherwise the WaitSet would notify us in 'waitset.wait()' again // instantly. subscriber->releaseQueuedData(); } diff --git a/iceoryx_examples/waitset/ice_waitset_individual.cpp b/iceoryx_examples/waitset/ice_waitset_individual.cpp index c21fd6de4a..fab098f672 100644 --- a/iceoryx_examples/waitset/ice_waitset_individual.cpp +++ b/iceoryx_examples/waitset/ice_waitset_individual.cpp @@ -91,7 +91,7 @@ int main() if (notification->doesOriginateFrom(&subscriber2)) { // We need to release the samples to reset the trigger hasSamples - // otherwise the WaitSet would notify us in `waitset.wait()` again + // otherwise the WaitSet would notify us in 'waitset.wait()' again // instantly. subscriber2.releaseQueuedData(); std::cout << "subscriber 2 received something - dont care\n"; diff --git a/iceoryx_examples/waitset/ice_waitset_trigger.cpp b/iceoryx_examples/waitset/ice_waitset_trigger.cpp index 0b087443ff..e07f996131 100644 --- a/iceoryx_examples/waitset/ice_waitset_trigger.cpp +++ b/iceoryx_examples/waitset/ice_waitset_trigger.cpp @@ -52,7 +52,7 @@ class MyTriggerClass // IMPORTANT: For now the WaitSet does not support that the origin is moved // or copied. To support that we have to inform the waitset about // our new origin, otherwise the WaitSet would end up in the wrong - // memory location when it calls the `hasTriggerCallback` with the + // memory location when it calls the 'hasTriggerCallback' with the // old origin (already moved) pointer. The same applies to // the resetCallback which is used when the WaitSet goes out of scope // and is pointing also to the old origin. diff --git a/iceoryx_examples/waitset_in_c/ice_c_waitset_grouping.c b/iceoryx_examples/waitset_in_c/ice_c_waitset_grouping.c index b994861444..f0db6e840d 100644 --- a/iceoryx_examples/waitset_in_c/ice_c_waitset_grouping.c +++ b/iceoryx_examples/waitset_in_c/ice_c_waitset_grouping.c @@ -134,7 +134,7 @@ int main(void) printf("dismiss data\n"); iox_sub_t subscriber = iox_notification_info_get_subscriber_origin(notification); // We need to release the samples to reset the event hasSamples - // otherwise the WaitSet would notify us in `iox_ws_wait()` again + // otherwise the WaitSet would notify us in 'iox_ws_wait()' again // instantly. iox_sub_release_queued_chunks(subscriber); } diff --git a/iceoryx_examples/waitset_in_c/ice_c_waitset_individual.c b/iceoryx_examples/waitset_in_c/ice_c_waitset_individual.c index 68ceb46c86..a24f47b342 100644 --- a/iceoryx_examples/waitset_in_c/ice_c_waitset_individual.c +++ b/iceoryx_examples/waitset_in_c/ice_c_waitset_individual.c @@ -118,7 +118,7 @@ int main(void) else if (iox_notification_info_does_originate_from_subscriber(notification, subscriber[1])) { // We need to release the samples to reset the event hasSamples - // otherwise the WaitSet would notify us in `iox_ws_wait()` again + // otherwise the WaitSet would notify us in 'iox_ws_wait()' again // instantly. iox_sub_release_queued_chunks(subscriber[1U]); printf("subscriber 2 received something - dont care\n"); diff --git a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp index 18be176f36..3917c73224 100644 --- a/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp +++ b/iceoryx_hoofs/legacy/include/iceoryx_hoofs/iceoryx_hoofs_types.hpp @@ -25,7 +25,7 @@ namespace iox /// [[deprecated("Deprecated in 3.0, removed in 4.0, please include 'iox/iceoryx_hoofs_types.hpp' instead")]] namespace cxx { -/// @deprecated use `iox::byte` instead of `iox::cxx::byte_t` +/// @deprecated use 'iox::byte' instead of 'iox::cxx::byte_t' using byte_t = byte; } // namespace cxx diff --git a/iceoryx_posh/include/iceoryx_posh/capro/service_description.hpp b/iceoryx_posh/include/iceoryx_posh/capro/service_description.hpp index 447dbf741c..23d83ad447 100644 --- a/iceoryx_posh/include/iceoryx_posh/capro/service_description.hpp +++ b/iceoryx_posh/include/iceoryx_posh/capro/service_description.hpp @@ -180,16 +180,16 @@ class ServiceDescription /// @return Bool if comparison match or not bool serviceMatch(const ServiceDescription& first, const ServiceDescription& second) noexcept; -/// @brief Convenience stream operator to easily use the `ServiceDescription` with std::ostream +/// @brief Convenience stream operator to easily use the 'ServiceDescription' with std::ostream /// @param[in] stream output stream to write the message to /// @param[in] service ServiceDescription that shall be converted -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter std::ostream& operator<<(std::ostream& stream, const ServiceDescription& service) noexcept; -/// @brief Convenience stream operator to easily use the `ServiceDescription` with log::LogStream +/// @brief Convenience stream operator to easily use the 'ServiceDescription' with log::LogStream /// @param[in] stream output LogStream to write the message to /// @param[in] service ServiceDescription that shall be converted -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter log::LogStream& operator<<(log::LogStream& stream, const ServiceDescription& service) noexcept; } // namespace capro diff --git a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp index d407e01706..74a29f2ff9 100644 --- a/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp +++ b/iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp @@ -172,16 +172,16 @@ enum class ConnectionState : uint32_t /// @return pointer to a string literal inline constexpr const char* asStringLiteral(ConnectionState value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with std::ostream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with std::ostream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline std::ostream& operator<<(std::ostream& stream, ConnectionState value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline log::LogStream& operator<<(log::LogStream& stream, ConnectionState value) noexcept; // Default properties of ChunkDistributorData diff --git a/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.hpp b/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.hpp index 305515113f..093f70df3d 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/capro/capro_message.hpp @@ -54,16 +54,16 @@ enum class CaproMessageType : uint8_t /// @return pointer to a string literal inline constexpr const char* asStringLiteral(CaproMessageType value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with std::ostream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with std::ostream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline std::ostream& operator<<(std::ostream& stream, CaproMessageType value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline log::LogStream& operator<<(log::LogStream& stream, CaproMessageType value) noexcept; enum class CaproServiceType : uint8_t diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/memory_manager.hpp b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/memory_manager.hpp index c8ea1ff3d4..f267289ac9 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/memory_manager.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/memory_manager.hpp @@ -103,16 +103,16 @@ class MemoryManager /// @return pointer to a string literal inline constexpr const char* asStringLiteral(const MemoryManager::Error value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with std::ostream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with std::ostream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter std::ostream& operator<<(std::ostream& stream, const MemoryManager::Error value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter log::LogStream& operator<<(log::LogStream& stream, const MemoryManager::Error value) noexcept; } // namespace mepoo diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_client.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_client.hpp index 2f65b595de..6ca2bda3ef 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_client.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_client.hpp @@ -34,7 +34,7 @@ using uid_t = UniquePortId; /// @brief The BaseClient class contains the common implementation for the different clients /// @param[in] PortT type of the underlying port, required for testing /// @param[in] TriggerHandleT type of the underlying trigger handle, required for testing -/// @note Not intended for public usage! Use the `Client` or `UntypedClient` instead! +/// @note Not intended for public usage! Use the 'Client' or 'UntypedClient' instead! template class BaseClient { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_publisher.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_publisher.hpp index 84dbaeb93d..fdb9cdeee6 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_publisher.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_publisher.hpp @@ -32,7 +32,7 @@ using uid_t = UniquePortId; /// /// @brief The BasePublisher class contains the common implementation for the different publisher specializations. -/// @note Not intended for public usage! Use the `Publisher` or `UntypedPublisher` instead! +/// @note Not intended for public usage! Use the 'Publisher' or 'UntypedPublisher' instead! /// template class BasePublisher diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_server.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_server.hpp index 5e11ea0f20..bc05619bf3 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_server.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_server.hpp @@ -34,7 +34,7 @@ using uid_t = UniquePortId; /// @brief The BaseServer class contains the common implementation for the different server /// @param[in] PortT type of the underlying port, required for testing specializations. /// @param[in] TriggerHandleT type of the underlying trigger handle, required for testing -/// @note Not intended for public usage! Use the `Server` or `UntypedServer` instead! +/// @note Not intended for public usage! Use the 'Server' or 'UntypedServer' instead! template class BaseServer { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_subscriber.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_subscriber.hpp index 81839a7733..fdec4329be 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/base_subscriber.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/base_subscriber.hpp @@ -50,7 +50,7 @@ enum class SubscriberState : StateEnumIdentifier /// @brief base class for all types of subscriber /// @param[in] port_t type of the underlying port, required for testing -/// @note Not intended for public usage! Use the `Subscriber` or `UntypedSubscriber` instead! +/// @note Not intended for public usage! Use the 'Subscriber' or 'UntypedSubscriber' instead! template class BaseSubscriber { @@ -120,7 +120,7 @@ class BaseSubscriber BaseSubscriber(BaseSubscriber&& rhs) = delete; BaseSubscriber& operator=(BaseSubscriber&& rhs) = delete; - /// @brief small helper method to unwrap the `expected>` from the `tryGetChunk` method of the + /// @brief small helper method to unwrap the 'expected>' from the 'tryGetChunk' method of the /// port expected takeChunk() noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp index 6737600c17..aaa244daa7 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp @@ -38,16 +38,16 @@ enum class ChunkReceiveResult /// @return pointer to a string literal inline constexpr const char* asStringLiteral(const ChunkReceiveResult value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with std::ostream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with std::ostream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline std::ostream& operator<<(std::ostream& stream, ChunkReceiveResult value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline log::LogStream& operator<<(log::LogStream& stream, ChunkReceiveResult value) noexcept; /// @brief The ChunkReceiver is a building block of the shared memory communication infrastructure. It extends diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp index 3b1f7661b1..95ac75a952 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp @@ -55,16 +55,16 @@ namespace popo /// @return pointer to a string literal inline constexpr const char* asStringLiteral(const AllocationError value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with std::ostream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with std::ostream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline std::ostream& operator<<(std::ostream& stream, AllocationError value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline log::LogStream& operator<<(log::LogStream& stream, AllocationError value) noexcept; /// @brief The ChunkSender is a building block of the shared memory communication infrastructure. It extends diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/client_impl.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/client_impl.hpp index 9e783e9665..ac8639c252 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/client_impl.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/client_impl.hpp @@ -32,7 +32,7 @@ namespace iox namespace popo { /// @brief The ClientImpl class implements the typed client API -/// @note Not intended for public usage! Use the `Client` instead! +/// @note Not intended for public usage! Use the 'Client' instead! template > class ClientImpl : public BaseClientT, private RpcInterface, ClientSendError> { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/client_impl.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/client_impl.inl index 4b51e22458..66a03ecc2f 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/client_impl.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/client_impl.inl @@ -64,7 +64,7 @@ expected, AllocationError> ClientImpl::loan( template expected ClientImpl::send(Request&& request) noexcept { - // take the ownership of the chunk from the Request to transfer it to `sendRequest` + // take the ownership of the chunk from the Request to transfer it to 'sendRequest' auto payload = request.release(); auto* requestHeader = static_cast(mepoo::ChunkHeader::fromUserPayload(payload)->userHeader()); return port().sendRequest(requestHeader); diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_user.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_user.hpp index 68cb124dfa..d3b928b1ef 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_user.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/client_port_user.hpp @@ -42,16 +42,16 @@ enum class ClientSendError /// @return pointer to a string literal inline constexpr const char* asStringLiteral(const ClientSendError value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with std::ostream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with std::ostream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline std::ostream& operator<<(std::ostream& stream, ClientSendError value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline log::LogStream& operator<<(log::LogStream& stream, ClientSendError value) noexcept; /// @brief The ClientPortUser provides the API for accessing a client port from the user side. The client port diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_user.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_user.hpp index 1a32412e18..f8663f4d2f 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_user.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/ports/server_port_user.hpp @@ -45,16 +45,16 @@ enum class ServerRequestResult /// @return pointer to a string literal inline constexpr const char* asStringLiteral(const ServerRequestResult value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with std::ostream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with std::ostream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline std::ostream& operator<<(std::ostream& stream, ServerRequestResult value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline log::LogStream& operator<<(log::LogStream& stream, ServerRequestResult value) noexcept; } // namespace popo @@ -76,16 +76,16 @@ enum class ServerSendError /// @return pointer to a string literal inline constexpr const char* asStringLiteral(const ServerSendError value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with std::ostream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with std::ostream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline std::ostream& operator<<(std::ostream& stream, ServerSendError value) noexcept; -/// @brief Convenience stream operator to easily use the `asStringLiteral` function with iox::log::LogStream +/// @brief Convenience stream operator to easily use the 'asStringLiteral' function with iox::log::LogStream /// @param[in] stream sink to write the message to /// @param[in] value to convert to a string literal -/// @return the reference to `stream` which was provided as input parameter +/// @return the reference to 'stream' which was provided as input parameter inline log::LogStream& operator<<(log::LogStream& stream, ServerSendError value) noexcept; /// @brief The ServerPortUser provides the API for accessing a server port from the user side. The server port diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/publisher_impl.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/publisher_impl.hpp index 38f0c3dd7c..56950e0ffd 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/publisher_impl.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/publisher_impl.hpp @@ -29,7 +29,7 @@ namespace iox namespace popo { /// @brief The PublisherImpl class implements the typed publisher API -/// @note Not intended for public usage! Use the `Publisher` instead! +/// @note Not intended for public usage! Use the 'Publisher' instead! template > class PublisherImpl : public BasePublisherType, private PublisherInterface { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/server_impl.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/server_impl.hpp index b3bc33a8d3..3a09bbd377 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/server_impl.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/server_impl.hpp @@ -32,7 +32,7 @@ namespace iox namespace popo { /// @brief The ServerImpl class implements the typed server API -/// @note Not intended for public usage! Use the `Server` instead! +/// @note Not intended for public usage! Use the 'Server' instead! template > class ServerImpl : public BaseServerT, private RpcInterface, ServerSendError> { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/server_impl.inl b/iceoryx_posh/include/iceoryx_posh/internal/popo/server_impl.inl index 6c48d3ba6c..0e93112b9f 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/server_impl.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/server_impl.inl @@ -84,7 +84,7 @@ expected, AllocationError> ServerImpl::loan template expected ServerImpl::send(Response&& response) noexcept { - // take the ownership of the chunk from the Response to transfer it to `sendResponse` + // take the ownership of the chunk from the Response to transfer it to 'sendResponse' auto payload = response.release(); auto* responseHeader = static_cast(mepoo::ChunkHeader::fromUserPayload(payload)->userHeader()); return port().sendResponse(responseHeader); diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/smart_chunk.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/smart_chunk.hpp index cdccaa12e0..23b1f82933 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/smart_chunk.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/smart_chunk.hpp @@ -68,7 +68,7 @@ class SmartChunk { protected: static_assert(std::is_const::value == std::is_const::value, - "The type `T` and the user-header `H` must be equal in their const qualifier to ensure the same " + "The type 'T' and the user-header 'H' must be equal in their const qualifier to ensure the same " "access restrictions for the user-header as for the smartChunk data!"); /// @brief Helper type to enable the constructor for the producer, i.e. when T has no const qualifier @@ -87,7 +87,7 @@ class SmartChunk public: /// @brief Constructor for a SmartChunk used by the Producer /// @tparam S is a dummy template parameter to enable the constructor only for non-const T - /// @param smartChunkUniquePtr is a `rvalue` to a `iox::unique_ptr` with to the data of the encapsulated type + /// @param smartChunkUniquePtr is a 'rvalue' to a 'iox::unique_ptr' with to the data of the encapsulated type /// T /// @param producer is a reference to the producer to be able to use producer specific methods template > @@ -95,7 +95,7 @@ class SmartChunk /// @brief Constructor for a SmartChunk used by the Consumer /// @tparam S is a dummy template parameter to enable the constructor only for const T - /// @param smartChunkUniquePtr is a `rvalue` to a `iox::unique_ptr` with to the data of the encapsulated type + /// @param smartChunkUniquePtr is a 'rvalue' to a 'iox::unique_ptr' with to the data of the encapsulated type /// T template > explicit SmartChunk(iox::unique_ptr&& smartChunkUniquePtr) noexcept; @@ -176,7 +176,7 @@ class SmartChunk template > const R& getUserHeader() const noexcept; - /// @note used by the producer to release the chunk ownership from the `SmartChunk` after publishing the chunk and + /// @note used by the producer to release the chunk ownership from the 'SmartChunk' after publishing the chunk and /// therefore preventing the invocation of the custom deleter T* release() noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/subscriber_impl.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/subscriber_impl.hpp index 48dfb56027..ceec8917bc 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/subscriber_impl.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/subscriber_impl.hpp @@ -26,7 +26,7 @@ namespace iox namespace popo { /// @brief The SubscriberImpl class implements the typed subscriber API -/// @note Not intended for public usage! Use the `Subscriber` instead! +/// @note Not intended for public usage! Use the 'Subscriber' instead! template > class SubscriberImpl : public BaseSubscriberType { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/typed_port_api_trait.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/typed_port_api_trait.hpp index f63f25c2d0..dd2de19f25 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/typed_port_api_trait.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/typed_port_api_trait.hpp @@ -34,7 +34,7 @@ namespace popo /// // ... /// } /// @endcode -/// @note `typename TypedPortApiTrait::Assert` has to be used otherwise the compiler ignores the static_assert's +/// @note 'typename TypedPortApiTrait::Assert' has to be used otherwise the compiler ignores the static_assert's template struct TypedPortApiTrait { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_client_impl.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_client_impl.hpp index 1e888d5be4..075762ddf9 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_client_impl.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_client_impl.hpp @@ -28,7 +28,7 @@ namespace iox namespace popo { /// @brief The UntypedClientImpl class implements the untyped client API -/// @note Not intended for public usage! Use the `UntypedClient` instead! +/// @note Not intended for public usage! Use the 'UntypedClient' instead! template > class UntypedClientImpl : public BaseClientT { @@ -52,7 +52,7 @@ class UntypedClientImpl : public BaseClientT /// @brief Releases the ownership of the request chunk provided by the payload pointer. /// @param requestPayload pointer to the payload of the chunk to be released - /// @details The requestPayload pointer must have been previously provided by `loan` + /// @details The requestPayload pointer must have been previously provided by 'loan' /// and not have been already released. The chunk must not be accessed afterwards /// as its memory may have been reclaimed. void releaseRequest(void* const requestPayload) noexcept; @@ -65,12 +65,12 @@ class UntypedClientImpl : public BaseClientT /// @brief Take the response chunk from the top of the receive queue. /// @return The payload pointer of the request chunk taken. /// @details No automatic cleanup of the associated chunk is performed - /// and must be manually done by calling `releaseResponse` + /// and must be manually done by calling 'releaseResponse' expected take() noexcept; /// @brief Releases the ownership of the response chunk provided by the payload pointer. /// @param responsePayload pointer to the payload of the chunk to be released - /// @details The responsePayload pointer must have been previously provided by `take` + /// @details The responsePayload pointer must have been previously provided by 'take' /// and not have been already released. The chunk must not be accessed afterwards /// as its memory may have been reclaimed. void releaseResponse(const void* const responsePayload) noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_publisher_impl.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_publisher_impl.hpp index cb8190c18a..a63697a2bb 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_publisher_impl.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_publisher_impl.hpp @@ -26,7 +26,7 @@ namespace iox namespace popo { /// @brief The UntypedPublisherImpl class implements the untyped publisher API -/// @note Not intended for public usage! Use the `UntypedPublisher` instead! +/// @note Not intended for public usage! Use the 'UntypedPublisher' instead! template > class UntypedPublisherImpl : public BasePublisherType { diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_server_impl.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_server_impl.hpp index 742d415dde..0938d8dc16 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_server_impl.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_server_impl.hpp @@ -26,7 +26,7 @@ namespace iox namespace popo { /// @brief The UntypedServerImpl class implements the untyped server API -/// @note Not intended for public usage! Use the `UntypedServer` instead! +/// @note Not intended for public usage! Use the 'UntypedServer' instead! template > class UntypedServerImpl : public BaseServerT { @@ -43,12 +43,12 @@ class UntypedServerImpl : public BaseServerT /// @brief Take the request chunk from the top of the receive queue. /// @return The payload pointer of the request chunk taken. /// @details No automatic cleanup of the associated chunk is performed - /// and must be manually done by calling `releaseRequest` + /// and must be manually done by calling 'releaseRequest' expected take() noexcept; /// @brief Releases the ownership of the request chunk provided by the payload pointer. /// @param requestPayload pointer to the payload of the chunk to be released - /// @details The requestPayload pointer must have been previously provided by `take` + /// @details The requestPayload pointer must have been previously provided by 'take' /// and not have been already released. The chunk must not be accessed afterwards /// as its memory may have been reclaimed. void releaseRequest(const void* const requestPayload) noexcept; @@ -72,7 +72,7 @@ class UntypedServerImpl : public BaseServerT /// @brief Releases the ownership of the response chunk provided by the payload pointer. /// @param responsePayload pointer to the payload of the chunk to be released - /// @details The responsePayload pointer must have been previously provided by `loan` + /// @details The responsePayload pointer must have been previously provided by 'loan' /// and not have been already released. The chunk must not be accessed afterwards /// as its memory may have been reclaimed. void releaseResponse(void* const responsePayload) noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_subscriber_impl.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_subscriber_impl.hpp index b3f00beb8c..8fbeabeb5d 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_subscriber_impl.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/untyped_subscriber_impl.hpp @@ -33,7 +33,7 @@ class Void }; /// @brief The UntypedSubscriberImpl class implements the untyped subscriber API -/// @note Not intended for public usage! Use the `UntypedSubscriber` instead! +/// @note Not intended for public usage! Use the 'UntypedSubscriber' instead! template > class UntypedSubscriberImpl : public BaseSubscriberType { @@ -53,7 +53,7 @@ class UntypedSubscriberImpl : public BaseSubscriberType /// @brief Take the chunk from the top of the receive queue. /// @return The user-payload pointer of the chunk taken. /// @details No automatic cleanup of the associated chunk is performed - /// and must be manually done by calling `release` + /// and must be manually done by calling 'release' /// expected take() noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_collection_memory_block.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_collection_memory_block.hpp index e9beaa8179..22368c3cfb 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_collection_memory_block.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_collection_memory_block.hpp @@ -61,7 +61,7 @@ class MemPoolCollectionMemoryBlock final : public MemoryBlock protected: /// @copydoc MemoryBlock::onMemoryAvailable - /// @note This will create the MemPools at the location `memory` points to + /// @note This will create the MemPools at the location 'memory' points to void onMemoryAvailable(not_null memory) noexcept override; /// @copydoc MemoryBlock::destroy diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_segment_manager_memory_block.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_segment_manager_memory_block.hpp index 510f60acb9..54f4a9faaf 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_segment_manager_memory_block.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/mempool_segment_manager_memory_block.hpp @@ -56,7 +56,7 @@ class MemPoolSegmentManagerMemoryBlock : public MemoryBlock protected: /// @copydoc MemoryBlock::onMemoryAvailable - /// @note This will create the SegmentManager at the location `memory` points to + /// @note This will create the SegmentManager at the location 'memory' points to void onMemoryAvailable(not_null memory) noexcept override; /// @copydoc MemoryBlock::destroy diff --git a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/port_pool_memory_block.hpp b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/port_pool_memory_block.hpp index 7e2d37dc39..4b79d8ab5f 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/port_pool_memory_block.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/roudi/memory/port_pool_memory_block.hpp @@ -56,7 +56,7 @@ class PortPoolMemoryBlock : public MemoryBlock protected: /// @copydoc MemoryBlock::onMemoryAvailable - /// @note This will create the ports at the location `memory` points to + /// @note This will create the ports at the location 'memory' points to void onMemoryAvailable(not_null memory) noexcept override; /// @copydoc MemoryBlock::destroy diff --git a/iceoryx_posh/include/iceoryx_posh/mepoo/chunk_header.hpp b/iceoryx_posh/include/iceoryx_posh/mepoo/chunk_header.hpp index a54de12805..d888881414 100644 --- a/iceoryx_posh/include/iceoryx_posh/mepoo/chunk_header.hpp +++ b/iceoryx_posh/include/iceoryx_posh/mepoo/chunk_header.hpp @@ -91,24 +91,24 @@ struct ChunkHeader /// @return the const pointer to the user-payload const void* userPayload() const noexcept; - /// @brief Get a pointer to the `ChunkHeader` associated to the user-payload of the chunk + /// @brief Get a pointer to the 'ChunkHeader' associated to the user-payload of the chunk /// @param[in] userPayload is the pointer to the user-payload of the chunk - /// @return the pointer to the `ChunkHeader` or a `nullptr` if `userPayload` is a `nullptr` + /// @return the pointer to the 'ChunkHeader' or a 'nullptr' if 'userPayload' is a 'nullptr' static ChunkHeader* fromUserPayload(void* const userPayload) noexcept; - /// @brief Get a const pointer to the `ChunkHeader` associated to the user-payload of the chunk + /// @brief Get a const pointer to the 'ChunkHeader' associated to the user-payload of the chunk /// @param[in] userPayload is the const pointer to the user-payload of the chunk - /// @return the const pointer to the `ChunkHeader` or a `nullptr` if `userPayload` is a `nullptr` + /// @return the const pointer to the 'ChunkHeader' or a 'nullptr' if 'userPayload' is a 'nullptr' static const ChunkHeader* fromUserPayload(const void* const userPayload) noexcept; - /// @brief Get a pointer to the `ChunkHeader` associated to the user-header of the chunk + /// @brief Get a pointer to the 'ChunkHeader' associated to the user-header of the chunk /// @param[in] userHeader is the pointer to the user-header of the chunk - /// @return the pointer to the `ChunkHeader` or a `nullptr` if `userHeader` is a `nullptr` + /// @return the pointer to the 'ChunkHeader' or a 'nullptr' if 'userHeader' is a 'nullptr' static ChunkHeader* fromUserHeader(void* const userHeader) noexcept; - /// @brief Get a const pointer to the `ChunkHeader` associated to the user-header of the chunk + /// @brief Get a const pointer to the 'ChunkHeader' associated to the user-header of the chunk /// @param[in] userHeader is the const pointer to the user-header of the chunk - /// @return the const pointer to the `ChunkHeader` or a `nullptr` if `userPayload` is a `nullptr` + /// @return the const pointer to the 'ChunkHeader' or a 'nullptr' if 'userPayload' is a 'nullptr' static const ChunkHeader* fromUserHeader(const void* const userHeader) noexcept; /// @brief Calculates the used size of the chunk with the ChunkHeader, user-heander and user-payload @@ -158,7 +158,7 @@ struct ChunkHeader // size of the whole chunk, including the header uint32_t m_chunkSize{0U}; uint8_t m_chunkHeaderVersion{CHUNK_HEADER_VERSION}; - // reserved for future functionality and used to indicate the padding bytes; currently not used and set to `0` + // reserved for future functionality and used to indicate the padding bytes; currently not used and set to '0' uint8_t m_reserved{0}; // currently just a placeholder uint16_t m_userHeaderId{NO_USER_HEADER}; diff --git a/iceoryx_posh/include/iceoryx_posh/popo/response.hpp b/iceoryx_posh/include/iceoryx_posh/popo/response.hpp index bb8b818fd6..836fd91092 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/response.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/response.hpp @@ -47,7 +47,7 @@ class Response public: /// @brief Constructor for a Response used by the server/client - /// @param smartChunkUniquePtr is a `rvalue` to a `iox::unique_ptr` with to the data of the encapsulated type + /// @param smartChunkUniquePtr is a 'rvalue' to a 'iox::unique_ptr' with to the data of the encapsulated type /// T /// @param producer (for server only) is a reference to the server to be able to use server specific methods using BaseType::BaseType; diff --git a/iceoryx_posh/include/iceoryx_posh/popo/sample.hpp b/iceoryx_posh/include/iceoryx_posh/popo/sample.hpp index 9d335e7444..7db547f692 100644 --- a/iceoryx_posh/include/iceoryx_posh/popo/sample.hpp +++ b/iceoryx_posh/include/iceoryx_posh/popo/sample.hpp @@ -44,7 +44,7 @@ class Sample : public SmartChunk, T, H> /// @brief Constructor for a Sample used by the publisher/subscriber /// @tparam S is a dummy template parameter to enable the constructor only for non-const T - /// @param smartChunkUniquePtr is a `rvalue` to a `iox::unique_ptr` with to the data of the encapsulated type + /// @param smartChunkUniquePtr is a 'rvalue' to a 'iox::unique_ptr' with to the data of the encapsulated type /// T /// @param producer (for publisher only) is a reference to the publisher to be able to use publisher specific /// methods @@ -64,7 +64,7 @@ class Sample : public SmartChunk, T, H> template friend class PublisherImpl; - /// @note used by the publisher to release the chunk ownership from the `Sample` after publishing the chunk and + /// @note used by the publisher to release the chunk ownership from the 'Sample' after publishing the chunk and /// therefore preventing the invocation of the custom deleter using BaseType::release; diff --git a/iceoryx_posh/source/mepoo/chunk_header.cpp b/iceoryx_posh/source/mepoo/chunk_header.cpp index 7c2cbcc31c..c59696af81 100644 --- a/iceoryx_posh/source/mepoo/chunk_header.cpp +++ b/iceoryx_posh/source/mepoo/chunk_header.cpp @@ -66,7 +66,7 @@ ChunkHeader::ChunkHeader(const uint32_t chunkSize, const ChunkSettings& chunkSet m_userPayloadOffset = static_cast(offsetToUserPayload); // this is safe since the alignment of the user-payload is larger than the one from the ChunkHeader - // -> the user-payload is either adjacent and `backOffset` is at the same location as `userPayloadOffset` + // -> the user-payload is either adjacent and 'backOffset' is at the same location as 'userPayloadOffset' // or the user-payload is not adjacent and there is space of at least the alignment of ChunkHeader // between the ChunkHeader and the user-payload auto addressOfBackOffset = alignedUserPayloadAddress - sizeof(UserPayloadOffset_t); diff --git a/iceoryx_posh/source/popo/ports/client_port_roudi.cpp b/iceoryx_posh/source/popo/ports/client_port_roudi.cpp index 9c9ffb4aa8..e4243430bc 100644 --- a/iceoryx_posh/source/popo/ports/client_port_roudi.cpp +++ b/iceoryx_posh/source/popo/ports/client_port_roudi.cpp @@ -111,7 +111,7 @@ ClientPortRouDi::dispatchCaProMessageAndGetPossibleResponse(const capro::CaproMe void ClientPortRouDi::handleCaProProtocolViolation(const iox::capro::CaproMessageType messageType) noexcept { // this shouldn't be reached - LogFatal() << "CaPro Protocol Violation! Got '" << messageType << "' in `" + LogFatal() << "CaPro Protocol Violation! Got '" << messageType << "' in '" << getMembers()->m_connectionState.load(std::memory_order_relaxed) << "'"; errorHandler(PoshError::POPO__CAPRO_PROTOCOL_ERROR, ErrorLevel::SEVERE); } diff --git a/iceoryx_posh/test/integrationtests/test_service_discovery.cpp b/iceoryx_posh/test/integrationtests/test_service_discovery.cpp index b2f6f97e0e..c4595b67c7 100644 --- a/iceoryx_posh/test/integrationtests/test_service_discovery.cpp +++ b/iceoryx_posh/test/integrationtests/test_service_discovery.cpp @@ -623,7 +623,7 @@ using string_t = iox::capro::IdString_t; string_t randomString(uint64_t size = string_t::capacity()) { - // deliberately contains no `0` (need to exclude some char) + // deliberately contains no '0' (need to exclude some char) static const char chars[] = "123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"; diff --git a/iceoryx_posh/test/moduletests/test_popo_client_port.cpp b/iceoryx_posh/test/moduletests/test_popo_client_port.cpp index a990db7d54..530285b769 100644 --- a/iceoryx_posh/test/moduletests/test_popo_client_port.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_client_port.cpp @@ -750,7 +750,7 @@ TEST_F(ClientPort_test, ReleaseAllChunksWorks) sut.portRouDi.releaseAllChunks(); - // this is not part of the client port but holds the chunk from `sendRequest` + // this is not part of the client port but holds the chunk from 'sendRequest' serverRequestQueue.clear(); EXPECT_THAT(getNumberOfUsedChunks(), Eq(0U)); diff --git a/iceoryx_posh/test/moduletests/test_popo_server_port_user.cpp b/iceoryx_posh/test/moduletests/test_popo_server_port_user.cpp index 58f59b2b63..e87cb46ff8 100644 --- a/iceoryx_posh/test/moduletests/test_popo_server_port_user.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_server_port_user.cpp @@ -715,7 +715,7 @@ TEST_F(ServerPort_test, SendResponseWithInvalidClientQueueIdReleasesTheChunkToTh ::testing::Test::RecordProperty("TEST_ID", "45823507-b83b-496b-965e-a48bd3c07b9e"); auto& sut = serverPortWithOfferOnCreate; - // the client is not yet connected to the `clientResponseQueue` which ID is used to send the responses to + // the client is not yet connected to the 'clientResponseQueue' which ID is used to send the responses to allocateResponseWithRequestHeaderAndThen(sut, [&](const auto, auto res) { constexpr uint64_t NUMBER_OF_REQUEST_CHUNKS{1U}; constexpr uint64_t NUMBER_OF_RESPONSE_CHUNKS{1U}; diff --git a/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp b/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp index 84a766de95..a0fa4c602f 100644 --- a/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp +++ b/iceoryx_posh/test/moduletests/test_roudi_service_registry.cpp @@ -549,7 +549,7 @@ using string_t = iox::capro::IdString_t; string_t randomString(uint64_t size = string_t::capacity()) { - // deliberately contains no `0` (need to exclude some char) + // deliberately contains no '0' (need to exclude some char) static const char chars[] = "123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"; diff --git a/tools/introspection/source/introspection_app.cpp b/tools/introspection/source/introspection_app.cpp index d8ed986c8b..11cb577b72 100644 --- a/tools/introspection/source/introspection_app.cpp +++ b/tools/introspection/source/introspection_app.cpp @@ -109,7 +109,7 @@ void IntrospectionApp::parseCmdLineArguments(int argc, } else { - std::cout << "Invalid argument for `t`! Will be ignored!"; + std::cout << "Invalid argument for 't'! Will be ignored!"; } break; } From 669881ea38fb517302c9267a4cbcb4f4e4fbc6c7 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Tue, 28 Feb 2023 18:15:29 +0100 Subject: [PATCH 32/36] iox-#1930 Add script to check for invalic characters --- tools/scripts/check_invalid_characters.sh | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 tools/scripts/check_invalid_characters.sh diff --git a/tools/scripts/check_invalid_characters.sh b/tools/scripts/check_invalid_characters.sh new file mode 100755 index 0000000000..1d12acab21 --- /dev/null +++ b/tools/scripts/check_invalid_characters.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Copyright (c) 2023 by Apex.AI Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +# This script does a sanity check for invalid characters in C++ source code + +set -e + +ICEORYX_PATH=$(git rev-parse --show-toplevel) +cd $ICEORYX_PATH + +function findInFiles() { + searchString=$1 + grep -rn --include=\*.{h,hpp,inl,c,cpp} "\`" iceoryx_* +} + +BACKTICK_SEARCH_STRING="\`" +NUMBER_OF_BACKTICKS=$(findInFiles $BACKTICK_SEARCH_STRING | wc -l) +if [[ "$NUMBER_OF_BACKTICKS" -gt "0" ]]; then + echo -e "\e[1;31mFound invalid backtick character in the following file(s)!\e[m" + echo -e "\e[1;31mPlease replace with a single quote!\e[m" + echo -e "\e[1;31m\` -> '\e[m" + findInFiles $BACKTICK_SEARCH_STRING + exit 1 +fi From 05ee5d26c20719f1b41012008c0770a52ffb21c1 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Tue, 28 Feb 2023 18:15:48 +0100 Subject: [PATCH 33/36] iox-#1930 Add commit hook for invalid characters --- tools/git-hooks/pre-commit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/git-hooks/pre-commit b/tools/git-hooks/pre-commit index bd808738b6..db7fd5d204 100755 --- a/tools/git-hooks/pre-commit +++ b/tools/git-hooks/pre-commit @@ -56,4 +56,10 @@ if ! tools/scripts/check_test_ids.sh; then exit 1 fi +## check for invalid characters +if ! tools/scripts/check_invalid_characters.sh; then + echo "Error checking for invalid characters" + exit 1 +fi + cd "${current_dir}" || exit From 7c43100ee31fb9bf44ff6d61c5689dffe1be1714 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Tue, 28 Feb 2023 18:17:27 +0100 Subject: [PATCH 34/36] iox-#1930 Add CI check for invalid characters --- .github/workflows/build-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 5101d060fe..0ed5ebf5a7 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -21,6 +21,7 @@ jobs: - run: ./tools/scripts/clang_format.sh check - run: ./tools/scripts/list_stl_dependencies.sh check - run: ./tools/scripts/check_test_ids.sh + - run: ./tools/scripts/check_invalid_characters.sh - run: ./tools/ci/cmake-linter.sh build-test-ubuntu: From 5d07b99f0d23a31e9ead515b5ffa94e16d8bc046 Mon Sep 17 00:00:00 2001 From: Jakub Sosnovec Date: Wed, 1 Mar 2023 10:51:36 +0100 Subject: [PATCH 35/36] iox-#1932 Fix console_logger timestamp millisecond conversion --- .../source/log/building_blocks/console_logger.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iceoryx_hoofs/source/log/building_blocks/console_logger.cpp b/iceoryx_hoofs/source/log/building_blocks/console_logger.cpp index 69aefd9ede..012092ba32 100644 --- a/iceoryx_hoofs/source/log/building_blocks/console_logger.cpp +++ b/iceoryx_hoofs/source/log/building_blocks/console_logger.cpp @@ -1,5 +1,6 @@ // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. // Copyright (c) 2021 - 2022 by Apex.AI Inc. All rights reserved. +// Copyright (c) 2023 by NXP. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -106,8 +107,10 @@ void ConsoleLogger::createLogMessageHeader(const char* file, strncpy(×tampString[0], &TIME_FORMAT[0], ConsoleLogger::bufferSize(TIME_FORMAT)); } - constexpr uint32_t MILLISECS_PER_SECOND{1000}; - const auto milliseconds = static_cast(timestamp.tv_nsec % MILLISECS_PER_SECOND); + constexpr uint32_t MILLISECS_PER_SEC{1000}; + constexpr uint32_t NANOSECS_PER_MILLISEC{1000000}; + // convert nanoseconds to milliseconds and compute the remaining milliseconds in a second + const auto milliseconds = static_cast((timestamp.tv_nsec / NANOSECS_PER_MILLISEC) % MILLISECS_PER_SEC); /// @todo iox-#1755 do we also want to always log the iceoryx version and commit sha? Maybe do that only in /// 'initLogger' with LogDebug From 1b85ff4ee440593c842da7edd28e3a9cdc552a13 Mon Sep 17 00:00:00 2001 From: Jakub Sosnovec Date: Wed, 1 Mar 2023 10:54:02 +0100 Subject: [PATCH 36/36] iox-#1932 Add timestamp milliseconds fix to unreleased changelog --- doc/website/release-notes/iceoryx-unreleased.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/website/release-notes/iceoryx-unreleased.md b/doc/website/release-notes/iceoryx-unreleased.md index 3867b96b04..86c131352f 100644 --- a/doc/website/release-notes/iceoryx-unreleased.md +++ b/doc/website/release-notes/iceoryx-unreleased.md @@ -70,6 +70,7 @@ - Can not build iceoryx with gcc 9.4 [\#1871](https://github.com/eclipse-iceoryx/iceoryx/issues/1871) - Update iceoryx_integrationtest package to use ROS2 Humble [\#1906](https://github.com/eclipse-iceoryx/iceoryx/issues/1906) - Fix potential memory leak in `iox::stack` [\#1893](https://github.com/eclipse-iceoryx/iceoryx/issues/1893) +- Fix milliseconds in log timestamps [\#1932](https://github.com/eclipse-iceoryx/iceoryx/issues/1932) **Refactoring:**