Skip to content

Commit

Permalink
Adding [[fallthrough]] annotation to case statements in faiss/utils/h…
Browse files Browse the repository at this point in the history
…amming_distance/neon-inl.h

Summary:
Error: https://www.internalfb.com/sandcastle/workflow/1661828262501424314
Due to a recent change (D52393687) to increase compiler warnings arcoss faiss/PACKAGE aggregator build is failing. The annotation [[fallthrough]]; needs to be used in every [nested]case statement where fallthrough can occur.

WHAT I DIDNT DO
I did NOT EXPORTED TO OSS FAISS
mdouze please do this if it is required. I do not know your policy. Prior to landing i saw the message but was unsure. As well as not having github account.

Reviewed By: r-barnes

Differential Revision: D52420730

fbshipit-source-id: 92ec8382226ea35bdacb668b3c329bd8b41a67fc
  • Loading branch information
Eddy Li authored and facebook-github-bot committed Dec 26, 2023
1 parent 9d74f09 commit 0727fff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions faiss/utils/hamming_distance/neon-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,21 +341,27 @@ struct HammingComputerDefault {
case 7:
accu += popcount64(a64[i] ^ b64[i]);
i++;
[[fallthrough]];
case 6:
accu += popcount64(a64[i] ^ b64[i]);
i++;
[[fallthrough]];
case 5:
accu += popcount64(a64[i] ^ b64[i]);
i++;
[[fallthrough]];
case 4:
accu += popcount64(a64[i] ^ b64[i]);
i++;
[[fallthrough]];
case 3:
accu += popcount64(a64[i] ^ b64[i]);
i++;
[[fallthrough]];
case 2:
accu += popcount64(a64[i] ^ b64[i]);
i++;
[[fallthrough]];
case 1:
accu += popcount64(a64[i] ^ b64[i]);
i++;
Expand All @@ -367,18 +373,25 @@ struct HammingComputerDefault {
switch (remainder8) {
case 7:
accu += hamdis_tab_ham_bytes[a[6] ^ b[6]];
[[fallthrough]];
case 6:
accu += hamdis_tab_ham_bytes[a[5] ^ b[5]];
[[fallthrough]];
case 5:
accu += hamdis_tab_ham_bytes[a[4] ^ b[4]];
[[fallthrough]];
case 4:
accu += hamdis_tab_ham_bytes[a[3] ^ b[3]];
[[fallthrough]];
case 3:
accu += hamdis_tab_ham_bytes[a[2] ^ b[2]];
[[fallthrough]];
case 2:
accu += hamdis_tab_ham_bytes[a[1] ^ b[1]];
[[fallthrough]];
case 1:
accu += hamdis_tab_ham_bytes[a[0] ^ b[0]];
[[fallthrough]];
default:
break;
}
Expand Down

0 comments on commit 0727fff

Please sign in to comment.