From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZh30-0001n7-Gh for qemu-devel@nongnu.org; Sun, 11 Dec 2011 05:54:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZh2z-0003cF-Ej for qemu-devel@nongnu.org; Sun, 11 Dec 2011 05:54:22 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:41635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZh2z-0003bz-AA for qemu-devel@nongnu.org; Sun, 11 Dec 2011 05:54:21 -0500 Message-ID: <4EE48B9C.5060202@weilnetz.de> Date: Sun, 11 Dec 2011 11:53:16 +0100 From: Stefan Weil MIME-Version: 1.0 References: <20111211064733.26491.7785.malonedeb@soybean.canonical.com> <20111211064733.26491.7785.malonedeb@soybean.canonical.com> In-Reply-To: <20111211064733.26491.7785.malonedeb@soybean.canonical.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Bug 902720] [NEW] TIME_MAX not set correctly for OpenBSD in qemu-common.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bug 902720 <902720@bugs.launchpad.net> Cc: qemu-devel@nongnu.org, Gerd Hoffmann Am 11.12.2011 07:47, schrieb Brad Smith: > Public bug reported: > > Looking at the OpenBSD buildbot logs I noticed a warning that appears > to be a bug in the code. > OpenBSD has a 32-bit time_t on all archs at the moment (32-bit and > 64-bit). > > CC i386-softmmu/monitor.o > /buildbot-qemu/default_openbsd_current/build/monitor.c: In function > 'expire_password': > /buildbot-qemu/default_openbsd_current/build/monitor.c:944: warning: > overflow in implicit constant conversion > > qemu-common.h has... > > #ifndef TIME_MAX > #define TIME_MAX LONG_MAX > #endif > > for OpenBSD this should be INT_MAX. > > ** Affects: qemu > Importance: Undecided > Status: New This needs special handling for w32 / w64, too. Looking at the code where TIME_MAX is used, I assume that more fixes are needed. The following code for example won't work: if (lifetime > INT_MAX) { What about using #define TIME_FOREVER -1 instead of TIME_MAX? Of course this would need additional code changes. Regards, Stefan Weil