Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iox-1394 fix axivion warnings for multiple files #1896

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
iox-#1394 Fix Axivion warnigs in algorithm
  • Loading branch information
elBoberido committed Feb 14, 2023
commit d49265d0323fa11f5a469d0cd745daefbd0cd303
4 changes: 3 additions & 1 deletion iceoryx_hoofs/include/iceoryx_hoofs/cxx/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ struct range
range(T t) noexcept
: m_value(t)
{
// AXIVION Next Construct AutosarC++19_03-A1.4.3 : False positive! 't >= Minimum' depends on input parameter
cxx::Expects((t >= Minimum) && (t <= Maximum));
}

Expand All @@ -216,7 +217,8 @@ template <typename T>
constexpr bool isPowerOfTwo(const T n) noexcept
{
static_assert(std::is_unsigned<T>::value && !std::is_same<T, bool>::value, "Only unsigned integer are allowed!");
return n && ((n & (n - 1U)) == 0U);
// AXIVION Next Construct AutosarC++19_03-M0.1.2, AutosarC++19_03-M0.1.9, FaultDetection-DeadBranches : False positive! 'n' can be zero.
return (n > 0) && ((n & (n - 1U)) == 0U);
}
} // namespace iox

Expand Down