From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhxoB-00082W-3f for qemu-devel@nongnu.org; Wed, 07 May 2014 05:06:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Whxo2-0002Wv-DE for qemu-devel@nongnu.org; Wed, 07 May 2014 05:06:35 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:30405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Whxo2-0002WY-6l for qemu-devel@nongnu.org; Wed, 07 May 2014 05:06:26 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N57007SY5ANK390@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Wed, 07 May 2014 10:06:23 +0100 (BST) Message-id: <5369F78C.7040904@samsung.com> Date: Wed, 07 May 2014 13:06:20 +0400 From: Stanislav Vorobiov MIME-version: 1.0 References: <1397838243-17921-1-git-send-email-s.vorobiov@samsung.com> <20140507080235.GB27925@stefanha-thinkpad.muc.redhat.com> <5369F089.3010108@samsung.com> <6C900CB5-FDDF-4D2F-8DF1-1DD356120FB3@alex.org.uk> In-reply-to: <6C900CB5-FDDF-4D2F-8DF1-1DD356120FB3@alex.org.uk> Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3] glib: fix g_poll early timeout on windows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: sw@weilnetz.de, sangho1206.park@samsung.com, qemu-devel@nongnu.org, Stefan Hajnoczi , syeon.hwang@samsung.com, pbonzini@redhat.com Hi, Yes it's probably the cause, thanks. On 05/07/2014 12:49 PM, Alex Bligh wrote: > > On 7 May 2014, at 09:36, Stanislav Vorobiov wrote: > >> Hi, >> >> Hm, but (int)res expression is not unsigned, it's signed. I've also had this warning, >> but with this expression: (res < WAIT_OBJECT_0), that's why I put (int) there. Could it be that >> for some reason your compiler treats "int" and "unsigned int", that would be really strange though... > > I suspect the problem is that WAIT_OBJECT_0 is defined as an unsigned long: > > #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 ) > > #define STATUS_WAIT_0 ((DWORD)0x00000000L) > > So IIRC under the 'usual conversions', and int compared with it will be cast to an unsigned long too. > > I think you want to cast WAIT_OBJECT_0 to a long or similar. > > Alex > > >> On 05/07/2014 12:02 PM, Stefan Hajnoczi wrote: >>> On Fri, Apr 18, 2014 at 08:24:03PM +0400, Stanislav Vorobiov wrote: >>> >>> Please fix the following compiler warning with gcc 4.8.2: >>> >>>> + } else if ((res == WAIT_TIMEOUT) || (res == WAIT_IO_COMPLETION) || >>>> + ((int)res < WAIT_OBJECT_0) || >>>> + (res >= (WAIT_OBJECT_0 + nhandles))) { >>>> + break; >>>> + } >>> >>> util/oslib-win32.c: In function 'g_poll_fixed': >>> util/oslib-win32.c:324:21: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] >>> ((int)res < WAIT_OBJECT_0) || >>> ^ >>> >> >> >> >