From 8561c79363a12e5592b78f53822b35b3000e90ae Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Fri, 5 Jun 2020 18:20:05 -0700 Subject: [PATCH] Remove inline from some static KeyedHash members Coverity Scan builds currently encounter catastrophic error, claiming alignas requires use on both declaration and definition, so appears to actually not understand "static inline" in combo with alignas. --- src/Hash.cc | 4 ++++ src/Hash.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Hash.cc b/src/Hash.cc index a5a375750b..ebc997f709 100644 --- a/src/Hash.cc +++ b/src/Hash.cc @@ -13,6 +13,10 @@ #include "highwayhash/highwayhash_target.h" #include "highwayhash/instruction_sets.h" +alignas(32) uint64_t KeyedHash::shared_highwayhash_key[4]; +alignas(32) uint64_t KeyedHash::cluster_highwayhash_key[4]; +alignas(16) unsigned long long KeyedHash::shared_siphash_key[2]; + // we use the following lines to not pull in the highwayhash headers in Hash.h - but to check the types did not change underneath us. static_assert(std::is_same::value, "Highwayhash return values must match hash_x_t"); static_assert(std::is_same::value, "Highwayhash return values must match hash_x_t"); diff --git a/src/Hash.h b/src/Hash.h index 9e39909d58..0bc4daeec0 100644 --- a/src/Hash.h +++ b/src/Hash.h @@ -186,11 +186,11 @@ public: private: // actually HHKey. This key changes each start (unless a seed is specified) - alignas(32) inline static uint64_t shared_highwayhash_key[4]; + alignas(32) static uint64_t shared_highwayhash_key[4]; // actually HHKey. This key is installation specific and sourced from the digest_salt script-level const. - alignas(32) inline static uint64_t cluster_highwayhash_key[4]; + alignas(32) static uint64_t cluster_highwayhash_key[4]; // actually HH_U64, which has the same type. This key changes each start (unless a seed is specified) - alignas(16) inline static unsigned long long shared_siphash_key[2]; + alignas(16) static unsigned long long shared_siphash_key[2]; // This key changes each start (unless a seed is specified) inline static uint8_t shared_hmac_md5_key[16]; inline static bool seeds_initialized = false;