From 0727fff94148a440c86ef5dc06edc1db70c2139d Mon Sep 17 00:00:00 2001 From: Eddy Li Date: Tue, 26 Dec 2023 15:14:13 -0800 Subject: [PATCH] Adding [[fallthrough]] annotation to case statements in faiss/utils/hamming_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 --- faiss/utils/hamming_distance/neon-inl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/faiss/utils/hamming_distance/neon-inl.h b/faiss/utils/hamming_distance/neon-inl.h index d1a0fdee7a..b66c16368c 100644 --- a/faiss/utils/hamming_distance/neon-inl.h +++ b/faiss/utils/hamming_distance/neon-inl.h @@ -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++; @@ -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; }