qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC] mingw32/64 fixes


From: Juan Quintela
Subject: [Qemu-devel] [RFC] mingw32/64 fixes
Date: Thu, 5 Feb 2015 16:15:50 +0100

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]