summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-06-22 16:35:41 +0200
committerGitHub <noreply@github.com>2022-06-22 16:35:41 +0200
commit9e4bd5fc8e348a8fe25d47b505b2cb5efe7d7c7f (patch)
tree89c15dbb8528322439dfbc3565d546fc6787ee25
parentc947ce8f8161cc75525cab18a7522dc1483c3a26 (diff)
parentf96a1f35d638c80b61e8b0fedfc48c10de8ca0c7 (diff)
Merge pull request #23202 from vespa-engine/toregge/remove-array-bounds-warning-in-vespalib
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});