🚨 suppress warnings

This commit is contained in:
Niels Lohmann 2023-10-31 19:56:41 +01:00
parent cdb29069da
commit 00c95e5c94
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69

View File

@ -566,7 +566,7 @@ struct pod_serializer
// calling get calls from_json, for now, we cannot do this in custom
// serializers
nlohmann::from_json(j, value);
auto* bytes = static_cast<char*>(static_cast<void*>(&value));
auto* bytes = static_cast<char*>(static_cast<void*>(&value)); // NOLINT(bugprone-casting-through-void)
std::memcpy(&t, bytes, sizeof(value));
}
@ -585,7 +585,7 @@ struct pod_serializer
std::is_pod<U>::value && std::is_class<U>::value, int >::type = 0 >
static void to_json(BasicJsonType& j, const T& t) noexcept
{
const auto* bytes = static_cast< const unsigned char*>(static_cast<const void*>(&t));
const auto* bytes = static_cast< const unsigned char*>(static_cast<const void*>(&t)); // NOLINT(bugprone-casting-through-void)
std::uint64_t value = 0;
std::memcpy(&value, bytes, sizeof(value));
nlohmann::to_json(j, value);