From 2ea70eae732682851ae6f9403daad7a966c11f5f Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 31 Oct 2018 07:48:59 +0100 Subject: [PATCH] src: fix compiler warning for debug build This commit updates the check of the offset argument passed to CallJSOnreadMethod to avoid doing a cast as this currently generates the following compiler warning when doing a debug build: ./src/stream_base.cc:295:3: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'size_t' (aka 'unsigned long') [-Wsign-compare] CHECK_EQ(static_cast(offset), offset); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ PR-URL: /~https://github.com/nodejs/node/pull/23994 Reviewed-By: Anna Henningsen Reviewed-By: Matheus Marchini Reviewed-By: Luigi Pinca Reviewed-By: Ujjwal Sharma Reviewed-By: Joyee Cheung Reviewed-By: James M Snell --- src/stream_base.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream_base.cc b/src/stream_base.cc index adb839c3e5d633..670b3cbd5091d1 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -292,7 +292,7 @@ void StreamBase::CallJSOnreadMethod(ssize_t nread, #ifdef DEBUG CHECK_EQ(static_cast(nread), nread); - CHECK_EQ(static_cast(offset), offset); + CHECK_LE(offset, INT32_MAX); if (ab.IsEmpty()) { CHECK_EQ(offset, 0);