summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-06-22 15:56:20 +0200
committerTor Egge <Tor.Egge@online.no>2022-06-22 15:56:20 +0200
commitf96a1f35d638c80b61e8b0fedfc48c10de8ca0c7 (patch)
treee5ec2a330cf4cd815aefced3931074903d79782c
parent07c6eff98909eb10a3cad8c27acc46edec1198ed (diff)
Remove array-bounds warning (vespalib).
-rw-r--r--vespalib/src/vespa/vespalib/util/shared_string_repo.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/util/shared_string_repo.h b/vespalib/src/vespa/vespalib/util/shared_string_repo.h
index 353e4fd1ca4..7ed50bf0858 100644
--- a/vespalib/src/vespa/vespalib/util/shared_string_repo.h
+++ b/vespalib/src/vespa/vespalib/util/shared_string_repo.h
@@ -215,7 +215,12 @@ private:
string_id resolve(vespalib::stringref str) {
uint32_t direct_id = try_make_direct_id(str);
if (direct_id >= ID_BIAS) {
+#pragma GCC diagnostic push
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 12
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
uint64_t full_hash = XXH3_64bits(str.data(), str.size());
+#pragma GCC diagnostic pop
uint32_t part = full_hash & PART_MASK;
uint32_t local_hash = full_hash >> PART_BITS;
uint32_t local_idx = _partitions[part].resolve(AltKey{str, local_hash});