From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Kleinschmidt <jkleinsc@electronjs.org>
Date: Wed, 24 Jan 2024 11:14:50 -0500
Subject: fix: suppress clang -Wimplicit-const-int-float-conversion in
 v8_binding_for_core

fixes the following error on build:

../../third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h:272:38: error: implicit conversion from 'const uint64_t' (aka 'const unsigned long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-const-int-float-conversion]
  272 |   double fmod_value = fmod(trunc(d), kMaxULL + 1.0);
      |                                      ^~~~~~~ ~

This error appears to be caused by https://chromium-review.googlesource.com/c/chromium/src/+/5224201
but doesn't appear to be reproducible in chrome.

Given the nature of this code it appears safe to ignore this check.

diff --git a/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h b/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h
index 29d361a9e2784a9e44880dff08d8a769e12c7455..256792a3dbe3dcf0a71573d337386ead622358e9 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h
+++ b/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h
@@ -269,7 +269,10 @@ inline uint64_t DoubleToInteger(double d) {
   constexpr uint64_t kMaxULL = std::numeric_limits<uint64_t>::max();
 
   // -2^{64} < fmod_value < 2^{64}.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wimplicit-const-int-float-conversion"
   double fmod_value = fmod(trunc(d), kMaxULL + 1.0);
+#pragma clang diagnostic pop
   if (fmod_value >= 0) {
     // 0 <= fmod_value < 2^{64}.
     // 0 <= value < 2^{64}. This cast causes no loss.
