From 937a658b587fb55ee9b2757059c7407006ce6e0e Mon Sep 17 00:00:00 2001 From: Alastair Donaldson Date: Fri, 3 Sep 2021 12:31:30 +0000 Subject: [PATCH] Avoid i386 compile error related to comparison Adds casts to uint64_t so that a comparison between size_t and the largest possible uint32_t value does not lead to a tautological warning when building for i386. Fixes tint:1162 Change-Id: Ib18140805d443d51bb7e48c9e345b21b9d5651fb Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/63440 Auto-Submit: Alastair Donaldson Reviewed-by: Ben Clayton Commit-Queue: Alastair Donaldson Kokoro: Kokoro --- src/inspector/inspector.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/inspector/inspector.cc b/src/inspector/inspector.cc index dc057c6e29..54da3c364d 100644 --- a/src/inspector/inspector.cc +++ b/src/inspector/inspector.cc @@ -321,7 +321,8 @@ uint32_t Inspector::GetStorageSize(const std::string& entry_point) { } } - if (size > std::numeric_limits::max()) { + if (static_cast(size) > + static_cast(std::numeric_limits::max())) { return std::numeric_limits::max(); } return static_cast(size);