Resolve unused variable warning#1558
Merged
EduPonz merged 2 commits intoeProsima:2.0.xfrom Nov 7, 2020
Merged
Conversation
Signed-off-by: Stephen Brawner <brawner@gmail.com>
This was referenced Nov 6, 2020
Merged
EduPonz
suggested changes
Nov 6, 2020
|
|
||
| // Add Participant | ||
| auto wit = writers_.insert(std::make_pair(guid_aux, dei)); | ||
| writers_.insert(std::make_pair(guid_aux, dei)); |
There was a problem hiding this comment.
That's a tricky one, as the variable is indeed used in line 2346, which is a logInfo message that is not compiled unless INTERNAL_DEBUG is set or CMAKE_BUILD_TYPE is set to Debug. Our CI builds with INTERNAL_DEBUG to verify that all logInfo are correct, and thus we don't get the warning. The best is probably to remove the iterator (as you did), as well as the part of the log that uses it.
Contributor
Author
There was a problem hiding this comment.
What do you think about just putting in a static_cast<void>, like my most recent commit? It suppresses the warning, but still works for the log?
Signed-off-by: Stephen Brawner <brawner@gmail.com>
EduPonz
approved these changes
Nov 7, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#1555 introduced this unused variable. It doesn' look like the code needs to refer to the pair itself, so I thought it best to just remove the iterator variable.
Signed-off-by: Stephen Brawner brawner@gmail.com