From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45111 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODP4z-00027S-32 for qemu-devel@nongnu.org; Sat, 15 May 2010 17:39:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODP4w-00041d-TQ for qemu-devel@nongnu.org; Sat, 15 May 2010 17:39:28 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:61346) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODP4w-00040r-Ec for qemu-devel@nongnu.org; Sat, 15 May 2010 17:39:26 -0400 Message-ID: <4BEF1489.6000907@mail.berlios.de> Date: Sat, 15 May 2010 23:39:21 +0200 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 0/3] mingw32 compile fixes References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel Am 15.05.2010 22:49, schrieb Blue Swirl: > Hi, > > With this mingw32 compiler: > > $ i586-mingw32msvc-gcc -v > Using built-in specs. > Target: i586-mingw32msvc > Configured with: > /tmp/buildd/gcc-mingw32-4.4.2/build-tree/gcc-4.4.2/configure > --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' > --mandir='/usr/share/man' --infodir='/usr/share/info' > --sysconfdir=/etc --localstatedir=/var > --libexecdir='/usr/lib/gcc-mingw32' --disable-multilib > --enable-threads --enable-sjlj-exceptions > --enable-version-specific-runtime-libs --disable-shared > --target=i586-mingw32msvc --enable-languages=c,c++,fortran : > (reconfigured) /tmp/buildd/gcc-mingw32-4.4.2/build-tree/gcc-4.4.2/configure > --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' > --mandir='/usr/share/man' --infodir='/usr/share/info' > --sysconfdir=/etc --localstatedir=/var > --libexecdir='/usr/lib/gcc-mingw32' --disable-multilib > --enable-threads --enable-sjlj-exceptions > --enable-version-specific-runtime-libs --disable-shared > --target=i586-mingw32msvc --enable-languages=c,c++,fortran > Thread model: win32 > gcc version 4.4.2 (GCC) > > build will not succeed because formats %zd, %zu, %hh, %lld, %llx and > %llu are not known by the compiler. > > Any %ll* use is clearly a bug, we have PRI*64 macros just for this purpose. > > For %hh and %z there may be better ways than these patches. > > With the patches I can build working Win32 binaries and there are no warnings. > > Blue Swirl (3): > Fix %lld or %llx printf format use > mingw32: avoid using %hh format which is not known by the compiler > mingw32: avoid using %zd etc. formats which are not known by the > compiler > > arch_init.c | 18 +++++++++++++ > audio/audio.c | 11 ++++--- > audio/audio_template.h | 4 +- > audio/esdaudio.c | 8 +++--- > audio/mixeng.c | 3 +- > audio/ossaudio.c | 8 +++--- > block/curl.c | 13 +++++---- > block/parallels.c | 7 +++- > block/qcow2.c | 10 ++++--- > buffered_file.c | 13 +++++---- > darwin-user/commpage.c | 2 +- > darwin-user/syscall.c | 2 +- > hw/ac97.c | 4 +- > hw/eepro100.c | 22 +++++++++------ > hw/loader.c | 8 +++--- > hw/scsi-bus.c | 4 +- > hw/scsi-disk.c | 16 ++++++------ > hw/usb-ohci.c | 7 +++-- > hw/vga.c | 2 +- > hw/vhost_net.c | 2 +- > hw/virtio-9p-debug.c | 2 +- > hw/virtio-9p.c | 2 +- > hw/xen_console.c | 3 +- > hw/xen_disk.c | 6 +++- > hw/xenfb.c | 9 ++++-- > ia64-dis.c | 9 ++++-- > nbd.c | 4 +- > osdep.c | 2 +- > qemu-common.h | 7 +++++ > qemu-img.c | 10 +++--- > qemu-io.c | 57 +++++++++++++++++++++-------------------- > sysemu.h | 4 +++ > target-cris/translate.c | 6 ++-- > target-microblaze/translate.c | 2 +- > target-ppc/translate.c | 7 +++-- > target-sparc/helper.c | 2 +- > usb-linux.c | 2 +- > vnc-auth-sasl.c | 2 +- > vnc.c | 9 +++--- > 39 files changed, 182 insertions(+), 127 deletions(-) > It's a compiler bug that the compiler does not know these format strings. The code works nevertheless (at least with mingw libraries which are not too old) because the format strings are interpreted by the C runtime library. Is it worth changing a lot of files when we can expect a newer mingw compiler version which works correctly for standard format strings? Regards Stefan