Minor fixes to resolve some compilation warnings #687
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.
This PR aims to eliminate a bunch of GCC/clang compiler warnings.
Most of these relate to unused variables. I've used the
(void)variablepattern to trick the compiler into silencing the warning. I could have used[[maybe_unused]]but decided against it as that would force everyone to use C++17. Alternatively, I could have just removed the variable name from the function signature, but the names seemed to be informative (e.g., for theBasemethods) so I left them in.Other warnings were related to signed/unsigned comparisons when the template type
Sis an unsigned integer. While I was working on this, I ended up also fixing a small bug in theforloop for unsignedS. I also extended the test suite to compile and test for unsigned indices. In hindsight this might be better off as a separate PR.There are still some remaining warnings in
annoymodule.cc, but those are related to interactions with the Python C API and I'm uncertain on how to fix them. At least the warnings inannoylib.hhave all been resolved.Also FYI,
ci.ymlactually doesn't test anywhere other than Linux,{{ matrix.os }}isn't actually used anywhere. So we just end up running triplicate CI on Linux while pretending that it's running on Windows and Mac.