From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJO9t-0000zT-Oy for qemu-devel@nongnu.org; Thu, 05 Feb 2015 10:15:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJO9o-0000np-Pl for qemu-devel@nongnu.org; Thu, 05 Feb 2015 10:15:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJO9o-0000nh-I9 for qemu-devel@nongnu.org; Thu, 05 Feb 2015 10:15:52 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t15FFqhX009218 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 5 Feb 2015 10:15:52 -0500 From: Juan Quintela Date: Thu, 5 Feb 2015 16:15:50 +0100 Message-Id: <1423149350-23961-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [RFC] mingw32/64 fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi In fedora 21 when crosscompiling for windows I get that this functions are already defined. As they are declared there, I guess than in older complilers they weren't there. Is there a portable way to get happy both old and new compilers? Once there, the only other error that I got is this, but I think that this is a bug on the compiler (w32 have qemu configured for cross-compiling for windows 32 bit, w64 for 64). The problem is with the assert() on that function. assert(region_num < PCI_NUM_REGIONS); If I comment that assert, change it to ((unsigned)PCI_NUM_REGIONS) or (PCI_NUM_REGIONS -1) the error go away. Notice that there are other functions on that file that use the same/similar asserts on a different function that also access io_regions give no errors/warnings. Any idea? ()amit-pull *)$ make -j5 -C /scratch/tmp/next/w32/ make: Entering directory '/scratch/tmp/next/w32' CC hw/pci/pci.o /mnt/kvm/qemu/next/hw/pci/pci.c: In function 'pci_register_bar': /mnt/kvm/qemu/next/hw/pci/pci.c:932:29: error: array subscript is above array bounds [-Werror=array-bounds] r = &pci_dev->io_regions[region_num]; ^ /mnt/kvm/qemu/next/hw/pci/pci.c:932:29: error: array subscript is above array bounds [-Werror=array-bounds] cc1: all warnings being treated as errors /mnt/kvm/qemu/next/rules.mak:57: recipe for target 'hw/pci/pci.o' failed make: *** [hw/pci/pci.o] Error 1 make: Leaving directory '/scratch/tmp/next/w32' (amit-pull)$ make -j5 -C /scratch/tmp/next/w64/ make: Entering directory '/scratch/tmp/next/w64' CC hw/pci/pci.o /mnt/kvm/qemu/next/hw/pci/pci.c: In function 'pci_register_bar': /mnt/kvm/qemu/next/hw/pci/pci.c:932:29: error: array subscript is above array bounds [-Werror=array-bounds] r = &pci_dev->io_regions[region_num]; ^ /mnt/kvm/qemu/next/hw/pci/pci.c:932:29: error: array subscript is above array bounds [-Werror=array-bounds] /mnt/kvm/qemu/next/hw/pci/pci.c:932:29: error: array subscript is above array bounds [-Werror=array-bounds] /mnt/kvm/qemu/next/hw/pci/pci.c:932:29: error: array subscript is above array bounds [-Werror=array-bounds] cc1: all warnings being treated as errors /mnt/kvm/qemu/next/rules.mak:57: recipe for target 'hw/pci/pci.o' failed make: *** [hw/pci/pci.o] Error 1 make: Leaving directory '/scratch/tmp/next/w64' Later, Juan. Signed-off-by: Juan Quintela --- include/sysemu/os-win32.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index af3fbc4..7f39c42 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -75,14 +75,6 @@ /* Declaration of ffs() is missing in MinGW's strings.h. */ int ffs(int i); -/* Missing POSIX functions. Don't use MinGW-w64 macros. */ -#undef gmtime_r -struct tm *gmtime_r(const time_t *timep, struct tm *result); -#undef localtime_r -struct tm *localtime_r(const time_t *timep, struct tm *result); - -char *strtok_r(char *str, const char *delim, char **saveptr); - static inline void os_setup_signal_handling(void) {} static inline void os_daemonize(void) {} static inline void os_setup_post(void) {} -- 2.1.0