* [Qemu-devel] [PATCH] configure: Add compiler option -Wmissing-format-attribute
@ 2010-11-15 20:22 Stefan Weil
2010-11-15 21:03 ` [Qemu-devel] " Stefan Weil
2010-11-21 14:51 ` [Qemu-devel] " Anthony Liguori
0 siblings, 2 replies; 4+ messages in thread
From: Stefan Weil @ 2010-11-15 20:22 UTC (permalink / raw)
To: QEMU Developers; +Cc: Blue Swirl
With the previous patches, hopefully all functions with
printf like arguments use gcc's format checking.
This was tested with default build configuration on linux
and windows hosts (including some cross compilations),
so chances are good that there remain few (if any) functions
without format checking.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
HACKING | 3 ---
configure | 1 +
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/HACKING b/HACKING
index 6ba9d7e..3af53fd 100644
--- a/HACKING
+++ b/HACKING
@@ -120,6 +120,3 @@ gcc's printf attribute directive in the prototype.
This makes it so gcc's -Wformat and -Wformat-security options can do
their jobs and cross-check format strings with the number and types
of arguments.
-
-Currently many functions in QEMU are not following this rule but
-patches to add the attribute would be very much appreciated.
diff --git a/configure b/configure
index 7025d2b..d4c983a 100755
--- a/configure
+++ b/configure
@@ -140,6 +140,7 @@ windres="${cross_prefix}${windres}"
QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
CFLAGS="-g $CFLAGS"
QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
+QEMU_CFLAGS="-Wmissing-format-attribute $QEMU_CFLAGS"
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
--
1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: [PATCH] configure: Add compiler option -Wmissing-format-attribute
2010-11-15 20:22 [Qemu-devel] [PATCH] configure: Add compiler option -Wmissing-format-attribute Stefan Weil
@ 2010-11-15 21:03 ` Stefan Weil
2010-11-21 14:51 ` [Qemu-devel] " Anthony Liguori
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Weil @ 2010-11-15 21:03 UTC (permalink / raw)
To: Blue Swirl; +Cc: QEMU Developers
Am 15.11.2010 21:22, schrieb Stefan Weil:
> With the previous patches, hopefully all functions with
> printf like arguments use gcc's format checking.
>
> This was tested with default build configuration on linux
> and windows hosts (including some cross compilations),
> so chances are good that there remain few (if any) functions
> without format checking.
>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
[snip]
Hi,
to make testing and committing of this and the previous
patches easier, I have now set up a git repository which
contains all of them (more at the bottom of this mail).
I'd appreciate if someone could test compilation especially
with these environment (which I could not test):
* BSD / Darwin host
* Special configure options
This was my configuration (+ cross compilations for windows / mips /
powerpc):
$ ./configure --enable-debug-tcg --trace-backend=simple
--audio-drv-list="oss,alsa,sdl,esd,pa" --enable-attr
Install prefix /usr/local
BIOS directory /usr/local/share/qemu
binary directory /usr/local/bin
config directory /usr/local/etc
Manual directory /usr/local/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path /home/stefan/src/qemu
C compiler gcc
Host C compiler gcc
CFLAGS -O2 -g
QEMU_CFLAGS -Werror -m64 -I. -I$(SRC_PATH) -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-Wstrict-prototypes -Wredundant-decls -Wmissing-format-attribute -Wall
-Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes
-fno-strict-aliasing -fstack-protector-all -Wempty-body
-Wnested-externs -Wformat-security -Wformat-y2k -Winit-self
-Wignored-qualifiers -Wold-style-declaration -Wold-style-definition
-Wtype-limits
LDFLAGS -Wl,--warn-common -m64 -g
make make
install install
host CPU x86_64
host big endian no
target list i386-softmmu x86_64-softmmu arm-softmmu cris-softmmu
m68k-softmmu microblaze-softmmu mips-softmmu mipsel-softmmu
mips64-softmmu mips64el-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu
sh4-softmmu sh4eb-softmmu sparc-softmmu sparc64-softmmu i386-linux-user
x86_64-linux-user alpha-linux-user arm-linux-user armeb-linux-user
cris-linux-user m68k-linux-user microblaze-linux-user mips-linux-user
mipsel-linux-user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user
sh4-linux-user sh4eb-linux-user sparc-linux-user sparc64-linux-user
sparc32plus-linux-user
tcg debug enabled yes
Mon debug enabled no
gprof enabled no
sparse enabled no
strip binaries yes
profiler no
static build no
-Werror enabled yes
SDL support yes
curses support yes
curl support yes
check support no
mingw32 support no
Audio drivers oss alsa sdl esd pa
Extra audio cards ac97 es1370 sb16 hda
Block whitelist
Mixer emulation no
VNC TLS support no
VNC SASL support no
VNC JPEG support yes
VNC PNG support yes
VNC thread no
xen support no
brlapi support no
bluez support no
Documentation yes
NPTL support yes
GUEST_BASE yes
PIE user targets no
vde support yes
IO thread no
Linux AIO support yes
ATTR/XATTR support yes
Install blobs yes
KVM support yes
fdt support no
preadv support yes
fdatasync yes
madvise yes
posix_madvise yes
uuid support yes
vhost-net support no
Trace backend simple
Trace output file trace-<pid>
spice support no
Regards,
Stefan
The following changes since commit cf2c1839a955482f2e208d7400594bf076c222f2:
add copyright to spiceaudio (2010-11-11 17:59:25 +0300)
are available in the git repository at:
git://git.weilnetz.de/git/qemu for-blueswirl
Stefan Weil (7):
*-dis: Replace fprintf_ftype by fprintf_function (format checking)
target-sparc: Use fprintf_function (format checking)
trace: Use fprintf_function (format checking)
audio: Use GCC_FMT_ATTR (format checking)
darwin-user: Use GCC_FMT_ATTR (format checking)
slirp: Remove unused code for bad sprintf
configure: Add compiler option -Wmissing-format-attribute
HACKING | 3 ---
alpha-dis.c | 3 +++
arm-dis.c | 14 +++++++-------
audio/audio_pt_int.c | 3 ++-
configure | 1 +
darwin-user/machload.c | 2 +-
darwin-user/qemu.h | 2 +-
dis-asm.h | 10 ++--------
m68k-dis.c | 2 +-
microblaze-dis.c | 2 +-
mips-dis.c | 2 --
sh4-dis.c | 16 +++++-----------
simpletrace.h | 6 +++---
slirp/misc.c | 42 ------------------------------------------
slirp/slirp.h | 14 --------------
slirp/slirp_config.h | 6 ------
target-sparc/cpu.h | 4 ++--
17 files changed, 29 insertions(+), 103 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: Add compiler option -Wmissing-format-attribute
2010-11-15 20:22 [Qemu-devel] [PATCH] configure: Add compiler option -Wmissing-format-attribute Stefan Weil
2010-11-15 21:03 ` [Qemu-devel] " Stefan Weil
@ 2010-11-21 14:51 ` Anthony Liguori
2010-11-21 15:06 ` Stefan Weil
1 sibling, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2010-11-21 14:51 UTC (permalink / raw)
To: Stefan Weil; +Cc: Blue Swirl, QEMU Developers
On 11/15/2010 02:22 PM, Stefan Weil wrote:
> With the previous patches, hopefully all functions with
> printf like arguments use gcc's format checking.
>
> This was tested with default build configuration on linux
> and windows hosts (including some cross compilations),
> so chances are good that there remain few (if any) functions
> without format checking.
>
> Cc: Blue Swirl<blauwirbel@gmail.com>
> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
>
This breaks the build for me. disas.c doesn't build.
Regards,
Anthony Liguori
> ---
> HACKING | 3 ---
> configure | 1 +
> 2 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/HACKING b/HACKING
> index 6ba9d7e..3af53fd 100644
> --- a/HACKING
> +++ b/HACKING
> @@ -120,6 +120,3 @@ gcc's printf attribute directive in the prototype.
> This makes it so gcc's -Wformat and -Wformat-security options can do
> their jobs and cross-check format strings with the number and types
> of arguments.
> -
> -Currently many functions in QEMU are not following this rule but
> -patches to add the attribute would be very much appreciated.
> diff --git a/configure b/configure
> index 7025d2b..d4c983a 100755
> --- a/configure
> +++ b/configure
> @@ -140,6 +140,7 @@ windres="${cross_prefix}${windres}"
> QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
> CFLAGS="-g $CFLAGS"
> QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
> +QEMU_CFLAGS="-Wmissing-format-attribute $QEMU_CFLAGS"
> QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
> QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
> QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: Add compiler option -Wmissing-format-attribute
2010-11-21 14:51 ` [Qemu-devel] " Anthony Liguori
@ 2010-11-21 15:06 ` Stefan Weil
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Weil @ 2010-11-21 15:06 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Blue Swirl, QEMU Developers
Am 21.11.2010 15:51, schrieb Anthony Liguori:
> On 11/15/2010 02:22 PM, Stefan Weil wrote:
>> With the previous patches, hopefully all functions with
>> printf like arguments use gcc's format checking.
>>
>> This was tested with default build configuration on linux
>> and windows hosts (including some cross compilations),
>> so chances are good that there remain few (if any) functions
>> without format checking.
>>
>> Cc: Blue Swirl<blauwirbel@gmail.com>
>> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
>
> This breaks the build for me. disas.c doesn't build.
>
> Regards,
>
> Anthony Liguori
Did you apply the "previous patches"? You can pull them here:
git://git.weilnetz.de/git/qemu for-blueswirl
If you did apply them: could you please tell me your build
environment and add the build error messages?
Thanks,
Stefan Weil
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-21 15:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-15 20:22 [Qemu-devel] [PATCH] configure: Add compiler option -Wmissing-format-attribute Stefan Weil
2010-11-15 21:03 ` [Qemu-devel] " Stefan Weil
2010-11-21 14:51 ` [Qemu-devel] " Anthony Liguori
2010-11-21 15:06 ` Stefan Weil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).