qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 7/9] Add -Wmissing-format-attribute & fix proble


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 7/9] Add -Wmissing-format-attribute & fix problems it finds
Date: Mon, 02 Apr 2012 14:49:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0

Am 02.04.2012 12:50, schrieb Daniel P. Berrange:
> From: "Daniel P. Berrange" <address@hidden>
> 
> * configure: Add -Wmissing-format-attribute
> * hw/qxl.c: Add missing format attribute to qxl_guest_bug
>   and fix format specifiers in a caller of it
> * qtest.c: Add missing format attribute to qtest_send

There were patches for both of these on the list already:

http://patchwork.ozlabs.org/patch/149983/
http://patchwork.ozlabs.org/patch/149835/

Andreas

> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
>  configure |    1 +
>  hw/qxl.c  |    4 ++--
>  qtest.c   |    2 +-
>  3 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/configure b/configure
> index 8ee6cdb..3d47440 100755
> --- a/configure
> +++ b/configure
> @@ -1193,6 +1193,7 @@ gcc_flags="$gcc_flags -Wtrampolines"
>  gcc_flags="$gcc_flags -Wmissing-parameter-type"
>  gcc_flags="$gcc_flags -Wuninitialized"
>  gcc_flags="$gcc_flags -Wlogical-op"
> +gcc_flags="$gcc_flags -Wmissing-format-attribute"
>  
>  cat > $TMPC << EOF
>  int main(void) { return 0; }
> diff --git a/hw/qxl.c b/hw/qxl.c
> index 47a162e..33b2288 100644
> --- a/hw/qxl.c
> +++ b/hw/qxl.c
> @@ -124,7 +124,7 @@ static void qxl_reset_memslots(PCIQXLDevice *d);
>  static void qxl_reset_surfaces(PCIQXLDevice *d);
>  static void qxl_ring_set_dirty(PCIQXLDevice *qxl);
>  
> -void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
> +GCC_FMT_ATTR(2, 3) void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, 
> ...)
>  {
>      qxl_send_events(qxl, QXL_INTERRUPT_ERROR);
>      if (qxl->guestdebug) {
> @@ -1370,7 +1370,7 @@ async_common:
>      case QXL_IO_DESTROY_SURFACE_WAIT:
>          if (val >= NUM_SURFACES) {
>              qxl_guest_bug(d, "QXL_IO_DESTROY_SURFACE (async=%d):"
> -                             "%d >= NUM_SURFACES", async, val);
> +                             "%"PRIx64" >= NUM_SURFACES", async, val);
>              goto cancel_async;
>          }
>          qxl_spice_destroy_surface_wait(d, val, async);
> diff --git a/qtest.c b/qtest.c
> index cd7186c..2b71de3 100644
> --- a/qtest.c
> +++ b/qtest.c
> @@ -156,7 +156,7 @@ static void qtest_send_prefix(CharDriverState *chr)
>              tv.tv_sec, tv.tv_usec);
>  }
>  
> -static void qtest_send(CharDriverState *chr, const char *fmt, ...)
> +GCC_FMT_ATTR(2, 3) static void qtest_send(CharDriverState *chr, const char 
> *fmt, ...)
>  {
>      va_list ap;
>      char buffer[1024];

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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