From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0vGo-0002A1-Ql for qemu-devel@nongnu.org; Fri, 05 Jun 2015 13:19:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0vGj-0007si-Fa for qemu-devel@nongnu.org; Fri, 05 Jun 2015 13:19:02 -0400 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=58646 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0vGj-0007sV-8U for qemu-devel@nongnu.org; Fri, 05 Jun 2015 13:18:57 -0400 Message-ID: <5571D9FD.2030900@weilnetz.de> Date: Fri, 05 Jun 2015 19:18:53 +0200 From: Stefan Weil MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Redundant redeclaration of 'gmtime_r' with mingw64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel Am 05.06.2015 um 16:38 schrieb Stefan Hajnoczi: > Hi Stefan, > I get the following compiler warning in Fedora 22 > (mingw32-headers-4.0.2-1.fc22): > > In file included from qemu/include/qemu-common.h:47:0, > from qemu/include/qemu/timer.h:5, > from qemu/include/sysemu/sysemu.h:8, > from os-win32.c:34: > qemu/include/sysemu/os-win32.h:77:12: warning: redundant redeclaration > of 'gmtime_r' [-Wredundant-decls] > struct tm *gmtime_r(const time_t *timep, struct tm *result); > ^ > In file included from os-win32.c:30:0: > /usr/i686-w64-mingw32/sys-root/mingw/include/time.h:272:107: note: > previous definition of 'gmtime_r' was here > > QEMU has its own (non-reentrant) gmtime_r() and localtime_r() > functions on Windows. os-win32.h redefines the functions so the > compiler is right to complain. > > I thought about adding qemu_gmtime_r() and qemu_localtime_r() > functions to avoid the name clash. > > Do you have any new thoughts on this commit which introduced the > os-win32.h definitions? The version provided by Debian Jessie (mingw-w64 3.2.0) still uses macros to implement those functions - that's why I don't see that compiler warnings. I'd prefer a solution which conditionally includes the QEMU declaration (include/sysemu/os-win32.h) and the implementation (util/oslib-win32.c), either depending on the mingw-w64 version or on the result of a configuration check done while running configure. Regards Stefan