diff --git a/iceoryx_hoofs/buffer/include/iox/detail/stack.inl b/iceoryx_hoofs/buffer/include/iox/detail/stack.inl index e591aa5591..0135e6187d 100644 --- a/iceoryx_hoofs/buffer/include/iox/detail/stack.inl +++ b/iceoryx_hoofs/buffer/include/iox/detail/stack.inl @@ -159,9 +159,8 @@ inline bool stack::push(Targs&&... args) noexcept return false; } - // AXIVION Next Line AutosarC++19_03-A18.5.10 : every entry of m_data is aligned to alignof(T) - // AXIVION Next Line FaultDetection-IndirectAssignmentOverflow : False positive. Size at - // location guaranteed by T. + // AXIVION Next Construct AutosarC++19_03-A18.5.10 : every entry of m_data is aligned to alignof(T) + // AXIVION Next Construct FaultDetection-IndirectAssignmentOverflow : Size guaranteed by T. new (&m_data[m_size++]) T(std::forward(args)...); return true; } diff --git a/iceoryx_hoofs/container/include/iox/detail/vector.inl b/iceoryx_hoofs/container/include/iox/detail/vector.inl index fef5c56e70..6f71e0bea3 100644 --- a/iceoryx_hoofs/container/include/iox/detail/vector.inl +++ b/iceoryx_hoofs/container/include/iox/detail/vector.inl @@ -50,9 +50,7 @@ inline vector::vector(const uint64_t count) noexcept m_size = std::min(count, Capacity); for (uint64_t i{0U}; i < m_size; ++i) { - // AXIVION Next Line AutosarC++19_03-A18.5.2 : false positive, it is a placement new - // AXIVION Next Line FaultDetection-IndirectAssignmentOverflow : False positive. Size at - // location guaranteed by T. + // AXIVION Next Line AutosarC++19_03-A18.5.2, FaultDetection-IndirectAssignmentOverflow : False positive, it is a placement new. Size guaranteed by T. new (&at(i)) T(); } } @@ -87,8 +85,7 @@ inline vector& vector::operator=(const vector& rhs) no // copy using copy assignment for (; i < minSize; ++i) { - // AXIVION Next Line AutosarC++19_03-A5.0.1 : Expands to basic variable assignment. - // Evaluation order is inconsequential. + // AXIVION Next Line AutosarC++19_03-A5.0.1 : Expands to basic variable assignment. Evaluation order is inconsequential. at(i) = rhs.at(i); } @@ -118,8 +115,7 @@ inline vector& vector::operator=(vector&& rhs) noexcep // move using move assignment for (; i < minSize; ++i) { - // AXIVION Next Line AutosarC++19_03-A5.0.1 : Expands to basic variable assignment. - // Evaluation order is inconsequential. + // AXIVION Next Line AutosarC++19_03-A5.0.1 : Expands to basic variable assignment. Evaluation order is inconsequential. at(i) = std::move(rhs.at(i)); } @@ -168,9 +164,7 @@ inline bool vector::emplace_back(Targs&&... args) noexcept { if (m_size < Capacity) { - // AXIVION Next Construct FaultDetection-IndirectAssignmentOverflow : False positive. Size at - // location guaranteed by T - // AXIVION Next Construct AutosarC++19_03-A5.0.1 : Evaluation order is inconsequential. + // AXIVION Next Line AutosarC++19_03-A5.0.1, FaultDetection-IndirectAssignmentOverflow: Size guaranteed by T. Evaluation order is inconsequential. new (&at(m_size++)) T(std::forward(args)...); return true; } @@ -181,7 +175,7 @@ template template inline bool vector::emplace(const uint64_t position, Targs&&... args) noexcept { - const uint64_t sizeBeforeEmplace = m_size; + const uint64_t sizeBeforeEmplace{m_size}; if ((m_size >= Capacity) || ((position >= Capacity) || (position > sizeBeforeEmplace))) { return false; @@ -347,7 +341,7 @@ inline typename vector::iterator vector::end() noexcep template inline typename vector::const_iterator vector::end() const noexcept { - // AXIVION Next Construct AutosarC++19_03-A5.2.4 : Type-safety ensured by template parameter + // AXIVION Next Construct AutosarC++19_03-A5.2.4, AutosarC++19_03-A5.0.4, AutosarC++19_03-M5.0.15 : Type-safety ensured by template parameter. // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) return reinterpret_cast(&(at_unchecked(0)) + m_size); } @@ -362,8 +356,7 @@ inline bool vector::erase(iterator position) noexcept size_t n{index}; while ((n + 1U) < size()) { - // AXIVION Next Line AutosarC++19_03-A5.0.1 : Expands to basic variable assignment. - // Evaluation order is inconsequential. + // AXIVION Next Line AutosarC++19_03-A5.0.1 : Expands to basic variable assignment. Evaluation order is inconsequential. at(n) = std::move(at(n + 1U)); ++n; }