Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So, this would work, but wouldn't properly slot into how the macros are used across Catch2. If I am reading the docs correctly, then the correct approach would be something like this
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.
Thanks for your comment! Unfortunately, your suggestion makes the warnings come back. The reason is that in the place where the "unused" variables are introduced we do not use
CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS
, butCATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
. Apparently, other compilers than nvcc would emit a different warning here. I see two solutions to this:CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
with the suppression of 177 instead ofCATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS
.#define
s as you suggested and addCATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS
to the macros incatch_test_registry.hpp
that introduce the variables nvcc complains about.I updated my PR to implement option 2), since I think that is the cleaner approach. After all, nvcc's warning is about a variable that is "declared but never referenced" and nothing related to global variables. Let me know what you think!
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.