Skip to content

Commit

Permalink
suppress warning (#3708)
Browse files Browse the repository at this point in the history
Summary:
suppress below warning:

```
In file included from /path/to/faiss/faiss/utils/extra_distances.h:59,
                 from /path/to/faiss/faiss/IndexFlatCodes.cpp:16:
/path/to/faiss/faiss/utils/extra_distances-inl.h: In function ‘typename Consumer::T faiss::dispatch_VectorDistance(size_t, MetricType, float, Consumer&, Types ...) [with Consumer = {anonymous}::Run_get_distance_computer; Types = {const IndexFlatCodes*}]’:
/path/to/faiss/faiss/utils/extra_distances-inl.h:198:1: warning: control reaches end of non-void function [-Wreturn-type]
  198 | }
      | ^
```

Pull Request resolved: #3708

Reviewed By: ramilbakhshyiev

Differential Revision: D60528995

Pulled By: mengdilin

fbshipit-source-id: 97a6721f3f59ec59ae6d2e69137b1ecc85d7da12
  • Loading branch information
vorj authored and facebook-github-bot committed Jul 31, 2024
1 parent 2883129 commit 677e73f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions faiss/utils/extra_distances-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* and inner product */

#include <faiss/MetricType.h>
#include <faiss/impl/FaissAssert.h>
#include <faiss/utils/distances.h>
#include <cmath>
#include <type_traits>
Expand Down Expand Up @@ -193,6 +194,8 @@ typename Consumer::T dispatch_VectorDistance(
DISPATCH_VD(METRIC_Jaccard);
DISPATCH_VD(METRIC_NaNEuclidean);
DISPATCH_VD(METRIC_ABS_INNER_PRODUCT);
default:
FAISS_THROW_FMT("Invalid metric %d", metric);
}
#undef DISPATCH_VD
}
Expand Down

0 comments on commit 677e73f

Please sign in to comment.