-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
STYLE: Prefer c++17 [[maybe_unused]] attribute over (void) #4581
STYLE: Prefer c++17 [[maybe_unused]] attribute over (void) #4581
Conversation
7f8732a
to
017193a
Compare
Modules/Compatibility/Deprecated/include/itkTreeIteratorBase.hxx
Outdated
Show resolved
Hide resolved
017193a
to
d69c780
Compare
d69c780
to
e773540
Compare
e749cae
to
1938221
Compare
Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorCreateCenterVertexTest.cxx
Outdated
Show resolved
Hide resolved
1938221
to
3856b89
Compare
@thewtex -- This PR is getting old, and is one that will likely have merge-conflicts. Is this one that can be merged at this point? |
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 noted the two cases I saw, where the void maybe used to prevent a variable from being optimized away. Although I was not able reproduce this scenario, I am hesitant to merged those changes right before the release.
If those two cases were separated into another PR, I think this PR is OK, if @thewtex is OK with it and the release schedual.
@blowekamp I'll wait until next month after the release. Hopefully, there won't be too many merge conflicts. |
Making a draft until until after 5.4 release is complete. |
Thank you for saving this improvement for after v5.4.0 👍 |
Isn't |
@hjmjohnson v5.4.0 has been tagged -- please merge when you see fit. |
02c188a
to
6582d65
Compare
Updated comments. |
The use of (void)varname was a mechanism to silence compiler warnings prior to universal language support in c++17 for the [[maybe_unused]] attribute specifier.
Function signature variable names are preserved using itkNotUsed macro for documentation purposes.
Prefer to test input values are correct rather than ignore the unused variable.
6582d65
to
a7b4d14
Compare
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.
🔢
The use of (void)varname was a mechanism to silence compiler warnings prior to universal language support in c++17 for the [[maybe_unused]] attribute specifier.
PR Checklist