From 8ef3996ac8b804dbe3d40a6da157456bfbbe39a2 Mon Sep 17 00:00:00 2001 From: runhwguo <444347292@qq.com> Date: Tue, 6 Dec 2022 13:04:32 +0800 Subject: [PATCH] fix: byte_width_ = 1U << static_cast(packed_type & 3) implicit conversion loses integer precision: 'unsigned int' to 'uint8_t' (aka 'unsigned char') [-Werror,-Wimplicit-int-conversion] --- include/flatbuffers/flexbuffers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flatbuffers/flexbuffers.h b/include/flatbuffers/flexbuffers.h index 79cdd9c5d62..838f94be539 100644 --- a/include/flatbuffers/flexbuffers.h +++ b/include/flatbuffers/flexbuffers.h @@ -384,7 +384,7 @@ class Reference { Reference(const uint8_t *data, uint8_t parent_width, uint8_t packed_type) : data_(data), parent_width_(parent_width) { - byte_width_ = 1U << static_cast(packed_type & 3); + byte_width_ = static_cast(1U << (packed_type & 3)); type_ = static_cast(packed_type >> 2); }