From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeNTW-0004Hh-Ry for qemu-devel@nongnu.org; Tue, 22 Sep 2015 09:19:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeNTT-0001xg-2Q for qemu-devel@nongnu.org; Tue, 22 Sep 2015 09:19:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeNTS-0001xP-TD for qemu-devel@nongnu.org; Tue, 22 Sep 2015 09:19:11 -0400 Date: Tue, 22 Sep 2015 14:19:07 +0100 From: "Daniel P. Berrange" Message-ID: <20150922131907.GQ28888@redhat.com> References: <20150922160917-mutt-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150922160917-mutt-send-email-mst@redhat.com> Subject: Re: [Qemu-devel] Redundant redeclaration of 'gmtime_r' with mingw64 Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Stefan Hajnoczi , qemu-devel , Stefan Weil On Tue, Sep 22, 2015 at 04:11:34PM +0300, Michael S. Tsirkin wrote: > On Fri, Jun 05, 2015 at 03:38:21PM +0100, Stefan Hajnoczi wrote: > > 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? > > > > commit d3e8f95753114a827f9cd8e819b1d5cc8333f76b > > Author: Stefan Weil > > Date: Sat Sep 22 22:26:19 2012 +0200 > > > > w32: Add implementation of gmtime_r, localtime_r > > > > Those functions are missing in MinGW. > > > > Some versions of MinGW-w64 include defines for gmtime_r and localtime_r. > > Older versions of these macros are buggy (they return a pointer to a > > static variable), therefore we don't want them. Newer versions are > > similar to the code used here, but without the memset. > > > > The implementation which is used here is not strictly reentrant, > > but sufficiently good for QEMU on w32 or w64. > > > > Signed-off-by: Stefan Weil > > [blauwirbel@gmail.com: added comment about locking] > > Signed-off-by: Blue Swirl > > I tried this: it compiles, but then fails to link. > > Signed-off-by: Michael S. Tsirkin I've had a more complete patch posted several times now, still waiting to be picked up... https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg01926.html Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|