Skip to content

fix: resolve compiler warnings for clean -Wall -Wextra -Wshadow build#4810

Closed
maxwbuckley wants to merge 1 commit intofacebookresearch:mainfrom
maxwbuckley:fix/compiler-warnings
Closed

fix: resolve compiler warnings for clean -Wall -Wextra -Wshadow build#4810
maxwbuckley wants to merge 1 commit intofacebookresearch:mainfrom
maxwbuckley:fix/compiler-warnings

Conversation

@maxwbuckley
Copy link
Copy Markdown
Contributor

Summary

  • Add configurable compiler warning infrastructure (cmake/StrictCompilerWarnings.cmake) with 3 warning levels (basic, standard, strict) and optional -Werror support
  • Fix all compiler warnings across 160+ source files including -Wshadow, -Wunused-parameter, -Wnon-virtual-dtor, -Wformat, -Wimplicit-fallthrough, and -Woverloaded-virtual
  • Library and tests now compile cleanly at warning level 2 (-Wall -Wextra -Wpedantic -Wshadow -Wnon-virtual-dtor -Wunused -Woverloaded-virtual -Wformat=2 -Wimplicit-fallthrough) with -Werror

Motivation

Compiler warnings often indicate real bugs (shadowed variables, implicit fallthrough, format string issues) and make it harder to spot new problems when they're noisy. This PR brings the FAISS codebase to a warning-clean state and provides infrastructure to keep it that way.

Warning infrastructure

The new cmake/StrictCompilerWarnings.cmake module provides:

  • FAISS_WARNING_LEVEL cache variable (0=off, 1=basic, 2=standard, 3=strict)
  • FAISS_WARNINGS_AS_ERRORS option for CI enforcement
  • faiss_add_warnings() function applied to all build targets
  • Default is level 0 (off) so this is fully opt-in and does not break existing builds

Changes by category

Shadow variable fixes (-Wshadow): Renamed local variables, loop variables, and constructor parameters that shadowed outer-scope or member variables throughout the codebase.

Unused parameter fixes (-Wunused-parameter): Added (void)param casts or removed parameter names for intentionally unused parameters.

Format string fixes (-Wformat): Changed %ld/%d to portable format macros (PRId64, zu) where appropriate.

Implicit fallthrough fixes (-Wimplicit-fallthrough): Added [[fallthrough]] attributes or break/return statements.

Non-virtual destructor fixes (-Wnon-virtual-dtor): Added virtual destructors where classes have virtual methods.

Other: Fixed signed/unsigned comparisons, overloaded-virtual warnings, and various minor issues.

Test plan

  • faiss library builds with -Werror at warning level 2 (GCC)
  • Test binary builds cleanly
  • All 170/171 tests pass (1 skipped - SIMD level test in static/generic build)
  • No functional changes - all fixes are mechanical renames and annotations

🤖 Generated with Claude Code

@meta-cla meta-cla bot added the CLA Signed label Feb 15, 2026
@junjieqi
Copy link
Copy Markdown
Contributor

@maxwbuckley thanks for the contribution. Would you like to update your change?

@maxwbuckley maxwbuckley force-pushed the fix/compiler-warnings branch from ead7693 to 94f88c5 Compare February 18, 2026 22:29
@maxwbuckley
Copy link
Copy Markdown
Contributor Author

Thanks @junjieqi! I've rebased onto the latest main and resolved the merge conflicts with #4811 (the deserialization hardening PR). The branch is now up to date.

@junjieqi
Copy link
Copy Markdown
Contributor

@maxwbuckley thanks for the update! There are couple of CI build failures, could you help to fix them?

@maxwbuckley maxwbuckley force-pushed the fix/compiler-warnings branch from ef2fe4c to 3958b49 Compare February 22, 2026 19:24
@maxwbuckley
Copy link
Copy Markdown
Contributor Author

@junjieqi Thanks for flagging the CI failures! I've pushed fixes for all three:

  1. Format check — ran clang-format on all source files
  2. Linux x86_64 warnings build — fixed %d format specifier for size_t variable in AdditiveQuantizer.cpp (should be %zd)
  3. Windows conda build — MSVC requires signed integral types for OpenMP for loop variables; reverted 7 loop variables from size_t back to idx_t/int64_t

I also rebased onto the latest main and added the deserialization hardening changes from #4811 (overflow-safe arithmetic, HNSW/NSG validation on read, bounds checking).

@junjieqi
Copy link
Copy Markdown
Contributor

@junjieqi Thanks for flagging the CI failures! I've pushed fixes for all three:

  1. Format check — ran clang-format on all source files
  2. Linux x86_64 warnings build — fixed %d format specifier for size_t variable in AdditiveQuantizer.cpp (should be %zd)
  3. Windows conda build — MSVC requires signed integral types for OpenMP for loop variables; reverted 7 loop variables from size_t back to idx_t/int64_t

I also rebased onto the latest main and added the deserialization hardening changes from #4811 (overflow-safe arithmetic, HNSW/NSG validation on read, bounds checking).

@maxwbuckley looks like there are more conflicts, could you help update it? Thanks!

@maxwbuckley maxwbuckley force-pushed the fix/compiler-warnings branch 2 times, most recently from 1ceddb4 to bd6a4ae Compare February 24, 2026 18:29
@maxwbuckley
Copy link
Copy Markdown
Contributor Author

@junjieqi Rebased onto the latest main and resolved all merge conflicts. The branch is now up to date with a single squashed commit.

Changes since last push:

@maxwbuckley maxwbuckley force-pushed the fix/compiler-warnings branch from bd6a4ae to 463533f Compare February 24, 2026 19:11
@maxwbuckley
Copy link
Copy Markdown
Contributor Author

Updated to also fix warnings in AVX2-specific code paths (-DFAISS_OPT_LEVEL=avx2):

  • faiss/utils/simdlib_avx2.h — shadow warnings (constructor params shadowing members)
  • faiss/utils/hamming_distance/avx2-inl.h — unused parameters, shadow warnings
  • faiss/utils/partitioning.cpp — sign-compare fixes
  • faiss/utils/distances_fused/simdlib_based.cpp — sign-compare fix for OpenMP loop
  • faiss/cppcontrib/sa_decode/Level2-avx2-inl.h — unused parameter warnings in stubs
  • faiss/cppcontrib/sa_decode/PQ-avx2-inl.h — unused parameter warnings in stubs

Both generic and AVX2 builds compile clean with -Wall -Wextra -Wshadow -Werror. All tests pass (195/196 with AVX2, 1 pre-existing failure in TPO.IVFFlatPP unrelated to this PR).

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Feb 24, 2026

@limqiying has imported this pull request. If you are a Meta employee, you can view this in D94101552.

Systematically fix compiler warnings across the FAISS codebase to enable
clean builds with -Wall -Wextra -Wshadow. Changes include:

- Rename shadowing variables (constructor params, loop vars, locals)
- Fix signed/unsigned comparison mismatches
- Add explicit casts where needed (e.g. size_t for OpenMP on MSVC)
- Mark intentionally unused parameters with /*name*/ comments
- Add cmake/StrictCompilerWarnings.cmake for opt-in strict builds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maxwbuckley maxwbuckley force-pushed the fix/compiler-warnings branch from 463533f to b0410f5 Compare February 24, 2026 22:08
@mnorris11
Copy link
Copy Markdown
Contributor

Sorry for the delay on this. I think this would be great to do, but 170 files may be too much to do all at once. There is a big refactor going on with dynamic dispatch of SIMD (see PRs by @algoriddle ). So the code churn will be high until it is complete. If you create smaller (maybe 10-20 files at a time?) PRs, that might be easier to merge in quickly. Or, we can take it up after the dynamic dispatch PRs are all merged.

maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 2/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 11/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 6/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 9/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 8/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 3/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 4/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 13/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 10/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 5/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 1/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 12/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 17, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 7/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@maxwbuckley
Copy link
Copy Markdown
Contributor Author

maxwbuckley commented Mar 17, 2026

@mnorris11 Thanks for the feedback! I've split this PR into 13 smaller PRs (10-20 files each), rebased onto the latest main:

# PR Files Area
1 #4932 15 CMake warning infrastructure
2 #4933 12 Core base classes and headers
3 #4956 12 Graph-based indexes (HNSW, NSG, NNDescent)
4 #4957 14 Quantizer implementations
5 #4936 15 IO, result handlers, misc impl
6 #4937 11 Distance and hamming utilities
7 #4958 10 SIMD, sorting, misc utilities
8 #4939 12 Inverted lists and cppcontrib
9 #4940 12 Binary and misc Index files
10 #4941 8 PQ, PreTransform, Refine Index files
11 #4942 14 IVF Index implementations
12 #4943 13 Top-level FAISS source files
13 #4944 20 Test files

Each PR is independent and can be reviewed/merged separately. All changes are mechanical (variable renames, unused parameter annotations, casts, [[fallthrough]] attributes) with no functional changes.

I'll close this PR in favor of the smaller ones. Let me know if you'd like any of them adjusted!

maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 18, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 1/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 18, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 2/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 18, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 12/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
meta-codesync bot pushed a commit that referenced this pull request Mar 18, 2026
…4938)

Summary:
- Fix compiler warnings in SIMD libraries (simdlib_avx2, simdlib_emulated), NeuralNet, sorting, random, rabitq_simd, and general utils
- Fixes include `-Wshadow` (constructor params shadowing members), `-Wunused-parameter`, and `[[maybe_unused]]` annotations

All changes are mechanical. No functional changes.

Part 7/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4938

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96996248

Pulled By: alibeklfc

fbshipit-source-id: 83167905562b8a3ac181c29b7628a6a183f54e93
meta-codesync bot pushed a commit that referenced this pull request Mar 18, 2026
Summary:
- Fix compiler warnings in AdditiveQuantizer, ProductQuantizer, ResidualQuantizer, LocalSearchQuantizer, ScalarQuantizer, and related files
- Includes scalar_quantizer subdirectory (distance_computers, quantizers, similarities, training)
- Fixes include `-Wshadow`, `-Wunused-parameter`, `-Wformat`, and signed/unsigned comparisons

All changes are mechanical. No functional changes.

Part 4/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4935

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96995866

Pulled By: alibeklfc

fbshipit-source-id: 1a28eabda784e50b1c8fe32b665deb8919413df0
meta-codesync bot pushed a commit that referenced this pull request Mar 18, 2026
…4934)

Summary:
- Fix compiler warnings in HNSW, NSG, NNDescent graph implementations and their Index wrappers
- Also covers ClusteringInitialization, Panorama, and IndexBinaryHNSW
- Fixes include `-Wshadow` (variable renames), `-Wunused-parameter`, and `-Wimplicit-fallthrough`

All changes are mechanical. No functional changes.

Part 3/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4934

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96995514

Pulled By: alibeklfc

fbshipit-source-id: 8117658ba7e1e34db932e3e243cd17319b84c607
@maxwbuckley
Copy link
Copy Markdown
Contributor Author

Closing in favor of the 13 smaller PRs (see table above). Each can be reviewed and merged independently.

meta-codesync bot pushed a commit that referenced this pull request Mar 19, 2026
Summary:
- Fix compiler warnings in distance computation, hamming distance, heap, partitioning, and quantize_lut utilities
- Fixes include `-Wshadow`, `-Wunused-parameter`, `-Wformat`, and signed/unsigned comparisons

All changes are mechanical. No functional changes.

Part 6/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4937

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96996091

Pulled By: alibeklfc

fbshipit-source-id: 50073b6dd9cf7ed555df8b367a729d2dfbe3b003
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 19, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 1/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 19, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 2/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxwbuckley added a commit to maxwbuckley/faiss that referenced this pull request Mar 19, 2026
Mechanical fixes for compiler warnings found with -Wall -Wextra -Wshadow.
No functional changes — only variable renames, unused parameter annotations,
signed/unsigned casts, and [[fallthrough]] attributes.

Part 12/13 of the compiler warnings cleanup (split from PR facebookresearch#4810).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
meta-codesync bot pushed a commit that referenced this pull request Mar 20, 2026
…4956)

Summary:
- Fix compiler warnings in HNSW, NSG, NNDescent graph implementations and their Index wrappers
- Also covers ClusteringInitialization, Panorama, and IndexBinaryHNSW
- Fixes include `-Wshadow` (variable renames), `-Wunused-parameter`, and `-Wimplicit-fallthrough`

All changes are mechanical. No functional changes.

Part 3/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4956

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed By: junjieqi

Differential Revision: D97359107

Pulled By: alibeklfc

fbshipit-source-id: 04b484edf4cc555421cf216c989062f236082d71
meta-codesync bot pushed a commit that referenced this pull request Mar 20, 2026
Summary:
- Fix compiler warnings in all IndexIVF variants: IndexIVF, IndexIVFFlat, IndexIVFPQ, IndexIVFFastScan, IndexIVFAdditiveQuantizer, IndexIVFAdditiveQuantizerFastScan, IndexIVFRaBitQ, IndexIVFRaBitQFastScan, IndexIVFPQFastScan, IndexIVFPQR, IndexIVFSpectralHash, IndexIVFFlatPanorama, IndexIVFIndependentQuantizer
- Fixes include `-Wshadow`, `-Wunused-parameter`, `-Wformat`, signed/unsigned comparisons, and MSVC OpenMP loop variable types

All changes are mechanical. No functional changes.

Part 11/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4942

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96996860

Pulled By: alibeklfc

fbshipit-source-id: e591751f0268a3b7a6ee512fc8658c7292f289b4
meta-codesync bot pushed a commit that referenced this pull request Mar 20, 2026
…files (#4941)

Summary:
- Fix compiler warnings in IndexNeuralNetCodec, IndexPQ, IndexPQFastScan, IndexPreTransform, IndexRaBitQ, IndexRaBitQFastScan, IndexRefine
- Fixes include `-Wshadow`, `-Wunused-parameter`, and `-Wnon-virtual-dtor`

All changes are mechanical. No functional changes.

Part 10/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4941

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96996735

Pulled By: alibeklfc

fbshipit-source-id: 61b2a702dbdaa6cbef205360b9c7944528319a71
meta-codesync bot pushed a commit that referenced this pull request Mar 20, 2026
…4936)

Summary:
- Fix compiler warnings in index_read, index_write, IO utilities, ResultHandler, simd_result_handlers, fast_scan
- Also covers IDSelector, AuxIndexStructures, CodePacker, PolysemousTraining, kmeans1d, lattice_Zn
- Fixes include `-Wshadow`, `-Wunused-parameter`, `-Wformat`, and `-Wimplicit-fallthrough`

All changes are mechanical. No functional changes.

Part 5/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4936

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: limqiying

Differential Revision: D96995986

Pulled By: alibeklfc

fbshipit-source-id: abfac3dceaa9a64752f3ac908c9a53c0f44bb2fa
meta-codesync bot pushed a commit that referenced this pull request Mar 20, 2026
Summary:
- Fix compiler warnings in InvertedLists, BlockInvertedLists, DirectMap, OnDiskInvertedLists, InvertedListsIOHook
- Also covers cppcontrib sa_decode files (Level2-avx2-inl, Level2-inl, PQ-avx2-inl, PQ-inl)
- Fixes include `-Wshadow`, `-Wunused-parameter`, signed/unsigned comparisons, and MSVC OpenMP loop variable types

All changes are mechanical. No functional changes.

Part 8/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4939

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96996384

Pulled By: alibeklfc

fbshipit-source-id: c83bd3c2fe7be38dfc9667cec2333f2e47f6c96a
meta-codesync bot pushed a commit that referenced this pull request Mar 20, 2026
Summary:
- Fix `-Wshadow`, `-Wunused-parameter`, `-Wnon-virtual-dtor` warnings in core FAISS base classes and headers
- Files: Index, IndexBinary, IndexFlat, IndexFlatCodes, DistanceComputer, FaissAssert, FaissException, Quantizer, ThreadedIndex, MatrixStats

All changes are mechanical (variable renames, unused parameter annotations, casts). No functional changes.

Part 2/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4933

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96995274

Pulled By: alibeklfc

fbshipit-source-id: 2650884a1f336cb34527d4c50d42a847c9fbc0ce
meta-codesync bot pushed a commit that referenced this pull request Mar 20, 2026
Summary:
- Fix compiler warnings in all 20 FAISS C++ test files
- Fixes include `-Wshadow`, `-Wunused-parameter`, and signed/unsigned comparisons

All changes are mechanical. No functional changes.

Part 13/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4944

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96996609

Pulled By: alibeklfc

fbshipit-source-id: 72555246a4ccf540eb5422e64018c8d5e2660dce
meta-codesync bot pushed a commit that referenced this pull request Mar 20, 2026
Summary:
- Fix compiler warnings in AutoTune, Clustering, IVFlib, VectorTransform, clone_index, index_factory, MetaIndexes, IndexReplicas, IndexRowwiseMinMax, IndexScalarQuantizer, IndexShards, IndexShardsIVF
- Fixes include `-Wshadow`, `-Wunused-parameter`, `-Wformat`, and `-Woverloaded-virtual`

All changes are mechanical. No functional changes.

Part 12/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4943

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96996987

Pulled By: alibeklfc

fbshipit-source-id: 82e71810c4846284b602e045ea8069a1c3bb567f
meta-codesync bot pushed a commit that referenced this pull request Mar 20, 2026
#4940)

Summary:
- Fix compiler warnings in Index2Layer, IndexAdditiveQuantizer, IndexAdditiveQuantizerFastScan, IndexBinaryFlat, IndexBinaryFromFloat, IndexBinaryHash, IndexBinaryIVF, IndexFastScan, IndexIDMap, IndexLSH, IndexLattice
- Fixes include `-Wshadow`, `-Wunused-parameter`, and signed/unsigned comparisons

All changes are mechanical. No functional changes.

Part 9/13 of the compiler warnings cleanup (split from #4810 per maintainer request).

Pull Request resolved: #4940

Test Plan:
- [x] No functional changes — all fixes are mechanical renames and annotations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Reviewed By: mnorris11

Differential Revision: D96996483

Pulled By: alibeklfc

fbshipit-source-id: 2f472fcd448efc13edcc2802762da3cc3d8bdbbd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants