Fix all compiler warnings with strict warning flags #641
+307
−294
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.
Summary
HNSWLIB_WERRORCMake option to treat warnings as errorsChanges
Library headers:
static_cast,reinterpret_cast,const_cast)/*name*/syntaxoverridekeywords on virtual functionsHNSWLIB_MAYBE_UNUSEDmacro for conditionally-used SIMD functionsvisited_list_pool.hExamples and tests:
overridekeywordsBuild infrastructure:
HNSWLIB_WERRORoption to treat warnings as errorsNote
The
.github/workflows/build.ymlchange to enable-DHNSWLIB_WERROR=ONin CI could not be included in this PR due to GitHub token permissions. Maintainers may want to add this line to the build step:cmake .. -DHNSWLIB_WERROR=ONTest plan
searchKnnCloserFirst_test,epsilon_search_test,searchKnnWithFilter_test,multivector_search_test,multiThread_replace_test,multiThreadLoad_test)-DHNSWLIB_WERROR=ON(warnings as errors)🤖 Generated with Claude Code