mitigated `Unchecked return value` Coverity warnings
@pfultz2 please have a look.
These are not a false positives. The analysis looks at the code and if it sees that the return value is used in most cases it flags it as unintentional and a potential issue. If we would enable the clang-tidy warning about introducing [[nodiscard]] that would probably come up as well.
These are not a false positives. The analysis looks at the code and if it sees that the return value is used in most cases it flags it as unintentional and a potential issue.
well.. from my point of view that ARE false positives. If we ignore the return values by intention then they are false positives. If they are true positives (we unintentionally ignore the result) then you shouldn't add void casts.
I don't classify a finding as false positive or true positive depending on what heuristics the tool use. The heuristic coverity uses is not insane at all. I do feel it could probably detect some genuine bugs also.
I will still wait for feedback from @pfultz2 as I have no idea if this was intentional or not.
I will still wait for feedback from @pfultz2 as I have no idea if this was intentional or not.
I vote to merge this because it is good practice to be explicit. By casting a return value to void, its clear that the return value is ignored in this context.
I vote to merge this because it is good practice to be explicit. By casting a return value to void, its clear that the return value is ignored in this context.
Watch out for more fun in that area soon.