Minor fixes to silence various compiler warnings. #638
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.
Most of these warnings relate to unused variables, which I silenced with the
(void)variabletrick. Alternatives would have been to use[[maybe_unused]]but that requires C++17; or to just remove the variable name from the function signature, but the names can be self-documenting so I often prefer to leave them in.The other major class of warnings involve signed/unsigned comparisons, which are mostly fixed by using a more appropriate loop counter or by slapping together a poor man's version of C++20's
std::cmp_equal(). Also< 0comparisons are unnecessary for unsigned integers, so I got rid of them.Other warnings include deletion of
void*in the capsules, which is fixed by casting it back to its original type; and unused static functions, when AVX extensions are not available.Coverage of the vectorization code might be a bit iffy, it seems that sometimes the GHA runner supports AVX(512) and sometimes it doesn't. So there might still be some warnings lurking around there.