-
Notifications
You must be signed in to change notification settings - Fork 404
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-#1196 Fix left-over clang-tidy warnings in cxx::vector
and remove space in suppressions
#1525
iox-#1196 Fix left-over clang-tidy warnings in cxx::vector
and remove space in suppressions
#1525
Conversation
aa36345
to
909afb4
Compare
Can we consider to add these files to https://github.com/eclipse-iceoryx/iceoryx/blob/master/clang-tidy-files-to-scan.txt? |
cxx::vector
cxx::vector
and remove space in suppressions
I don't understand the strategy here. Shall we add each class after having it ticked in the list? Or will we enable everything once done with #1196?
Unfortunately, that doesn't work. PR and issue are then not linked. |
e35a823
to
179f391
Compare
return const_cast<T&>(const_cast<const vector<T, Capacity>*>(this)->at_unchecked(index)); | ||
} | ||
|
||
template <typename T, uint64_t Capacity> | ||
const T& vector<T, Capacity>::at_unchecked(const uint64_t index) const noexcept | ||
{ | ||
// AXIVION Next Construct AutosarC++19_03-A5.2.4 : Type-safety ensured by template parameter | ||
// NOLINTNEXTLINE (cppcoreguidelines-pro-type-reinterpret-cast) | ||
// NOLINTJUSTIFICATION User accessible method at() performs bounds check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think bound checks have nothing to do with a reinterpret_cast
usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elfenpiff You have to look more carefully above and below ;) Here, two warnings are suppressed:
reinterpret_cast
for Axivion with justification and clang-tidy without duplicate justification- Bounds safety issue of working with raw array instead of
std::span
, justification only for clang-tidy
@@ -166,8 +166,11 @@ TEST_F(function_refDeathTest, CallMovedFromLeadsToTermination) | |||
function_ref<int()> sut1{lambda}; | |||
function_ref<int()> sut2{std::move(sut1)}; | |||
// Use after move is tested here | |||
// NOLINTNEXTLINE (bugprone-use-after-move) | |||
// NOLINTBEGIN(bugprone-use-after-move, hicpp-invalid-access-moved, cppcoreguidelines-pro-type-vararg, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does multiline NOLINTBEGIN
work? Is this ignored when you run clang-tidy
manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elfenpiff Unfortunately, I'm still running clang 13 locally, which does not support this syntax. However, the clang15 in the CI seems to run fine with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works also locally for me.
@@ -166,8 +166,11 @@ TEST_F(function_refDeathTest, CallMovedFromLeadsToTermination) | |||
function_ref<int()> sut1{lambda}; | |||
function_ref<int()> sut2{std::move(sut1)}; | |||
// Use after move is tested here | |||
// NOLINTNEXTLINE (bugprone-use-after-move) | |||
// NOLINTBEGIN(bugprone-use-after-move, hicpp-invalid-access-moved, cppcoreguidelines-pro-type-vararg, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works also locally for me.
…ctor Signed-off-by: Simon Hoinkis <[email protected]>
…and add CI check Signed-off-by: Simon Hoinkis <[email protected]>
Signed-off-by: Simon Hoinkis <[email protected]>
Signed-off-by: Simon Hoinkis <[email protected]>
3eb629b
to
7eb4a39
Compare
Codecov Report
@@ Coverage Diff @@
## master #1525 +/- ##
==========================================
+ Coverage 78.96% 78.98% +0.01%
==========================================
Files 378 378
Lines 14464 14464
Branches 2010 2010
==========================================
+ Hits 11422 11424 +2
+ Misses 2412 2411 -1
+ Partials 630 629 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Simon Hoinkis [email protected]
Pre-Review Checklist for the PR Author
Changelog updated in the unreleased section including API breaking changesiox-#123-this-is-a-branch
)iox-#123 commit text
)git commit -s
)task-list-completed
)Notes for Reviewer
// NOLINTNEXTLINE (foobar)
suppresses all findings// NOLINTNEXTLINE(foobar)
Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References