From f9d2734ed46ed3223dd2d00d7d4e3f4c4179b6b9 Mon Sep 17 00:00:00 2001 From: Lars Froehlich Date: Fri, 13 Mar 2026 09:48:47 +0100 Subject: [PATCH] Store zmq_timers_timeout() result in long, not int MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [why] When compiling with -Wconversion, gcc 13.3 issues a warning: zmq.hpp: In member function ‘zmq::timers::timeout_result_t zmq::timers::timeout() const’: zmq.hpp:2857:41: warning: conversion from ‘long int’ to ‘int’ may change value [-Wconversion] 2857 | int timeout = zmq_timers_timeout(_timers); | ~~~~~~~~~~~~~~~~~~^~~~~~~~~ zmq_timers_timeout() returns long, but its return value is stored in an int variable, which may or may not be a mismatch depending on compiler and architecture. [how] Simply adjust the type of the variable from int to long. We could also change the literal in the following comparison from -1 to -1L, but that seems pedantic and does not match the style of the surrounding code. Signed-off-by: Lars Froehlich --- zmq.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zmq.hpp b/zmq.hpp index ccad8ca..3a755fc 100644 --- a/zmq.hpp +++ b/zmq.hpp @@ -2928,7 +2928,7 @@ class timers timeout_result_t timeout() const { - int timeout = zmq_timers_timeout(_timers); + long timeout = zmq_timers_timeout(_timers); if (timeout == -1) return timeout_result_t{}; return std::chrono::milliseconds{timeout};