From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1tFG-0005RZ-D2 for qemu-devel@nongnu.org; Mon, 08 Jun 2015 05:21:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1tFA-0006UX-Ek for qemu-devel@nongnu.org; Mon, 08 Jun 2015 05:21:26 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:32839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1tFA-0006UJ-7R for qemu-devel@nongnu.org; Mon, 08 Jun 2015 05:21:20 -0400 Received: by wgez8 with SMTP id z8so97944698wge.0 for ; Mon, 08 Jun 2015 02:21:19 -0700 (PDT) Date: Mon, 8 Jun 2015 10:21:17 +0100 From: Stefan Hajnoczi Message-ID: <20150608092117.GD30104@stefanha-thinkpad.redhat.com> References: <5571D9FD.2030900@weilnetz.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8w3uRX/HFJGApMzv" Content-Disposition: inline In-Reply-To: <5571D9FD.2030900@weilnetz.de> 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 Weil Cc: qemu-devel --8w3uRX/HFJGApMzv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 05, 2015 at 07:18:53PM +0200, Stefan Weil wrote: > 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? >=20 > 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. >=20 > 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. Does that mean you want: 1. gmtime() is a macro - use QEMU implementation 2. gmtime() is a function - use mingw function 3. gmtime() is undefined - use QEMU implementation ? --8w3uRX/HFJGApMzv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVdV6NAAoJEJykq7OBq3PIRTMIALE4ItSYRntoFLAbx1q2cW6v WOwEP0N92dyz0SktxanhjVpbwk+wIG7KTAIpiqh02/7QC4MliRRLXRQaEndNPGfT 9OJ1Mvg+XVsP7rxbcrXX4dY+SAKGqcbK54iLGvMyW9SZBbQSL1nMSXxwaFlhG4E8 Gxwimi4us6nzyZJIVQSvfJtkZFSJrZ0Qv+tF1vcAL7WsS7foKh+NIqUXDCEElSAZ oB4iDuD5lXh6VGGcfz/8ZMnv69R7YMnp8Puus0peXA+wlqONpkm3FGg4wrMoqKcH CypFtE2o7R36+IHNRdi0TpZALxIjT4bPTldVXc0jictUMdM5HoANL1bo4UUx4/A= =6L2S -----END PGP SIGNATURE----- --8w3uRX/HFJGApMzv--