All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: [Qemu-devel] [PATCH 01/11] trace: Fix format string for the struct timeval members casted to size_t
Date: Thu, 21 Jun 2018 14:12:47 -0300	[thread overview]
Message-ID: <20180621171257.14897-2-f4bug@amsat.org> (raw)
In-Reply-To: <20180621171257.14897-1-f4bug@amsat.org>

This fixes when using GCC with -Wformat-signedness:

    migration/trace.h: In function ‘_nocheck__trace_dirty_bitmap_load_success’:
    migration/trace.h:6368:24: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘long unsigned int’ [-Werror=format=]
      qemu_log("%d@%zd.%06zd:dirty_bitmap_load_success " "" "\n",
                   ~~^
                   %ld
    migration/trace.h:6370:18:
               (size_t)_now.tv_sec, (size_t)_now.tv_usec
               ~~~~~~~~~~~~~~~~~~~
    migration/trace.h:6368:30: error: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 4 has type ‘long unsigned int’ [-Werror=format=]
      qemu_log("%d@%zd.%06zd:dirty_bitmap_load_success " "" "\n",
                       ~~~~^
                       %06ld
    migration/trace.h:6370:39:
               (size_t)_now.tv_sec, (size_t)_now.tv_usec
                                    ~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 scripts/tracetool/backend/log.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/log.py
index 78933d03ad..6751f41bc5 100644
--- a/scripts/tracetool/backend/log.py
+++ b/scripts/tracetool/backend/log.py
@@ -38,7 +38,7 @@ def generate_h(event, group):
     out('    if (%(cond)s && qemu_loglevel_mask(LOG_TRACE)) {',
         '        struct timeval _now;',
         '        gettimeofday(&_now, NULL);',
-        '        qemu_log("%%d@%%zd.%%06zd:%(name)s " %(fmt)s "\\n",',
+        '        qemu_log("%%d@%%zu.%%06zu:%(name)s " %(fmt)s "\\n",',
         '                 getpid(),',
         '                 (size_t)_now.tv_sec, (size_t)_now.tv_usec',
         '                 %(argnames)s);',
-- 
2.18.0.rc2

  reply	other threads:[~2018-06-21 17:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21 17:12 [Qemu-devel] [PATCH 00/11] hw: various conversions to trace-events Philippe Mathieu-Daudé
2018-06-21 17:12 ` Philippe Mathieu-Daudé [this message]
2018-06-21 17:12 ` [Qemu-devel] [PATCH 02/11] sdcard: Reduce sdcard_set_blocklen() trace digits Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 03/11] hw/char/serial: Convert from DPRINTF macro to trace events Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 04/11] hw/char/parallel: Convert from pdebug() " Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 06/11] hw/input/tsc2005: Convert a fprintf() call " Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 07/11] hw/net/ne2000: Add " Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 08/11] hw/net/ne2000: Convert printf() calls to " Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 09/11] hw/net/etraxfs_eth: " Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 10/11] hw/block/fdc: Convert from FLOPPY_DPRINTF() macro " Philippe Mathieu-Daudé
2018-06-21 17:41   ` John Snow
2018-06-21 18:07     ` Philippe Mathieu-Daudé
2018-06-21 17:12 ` [Qemu-devel] [PATCH 11/11] hw/block/pflash_cfi: Convert from DPRINTF() " Philippe Mathieu-Daudé
2018-06-24 16:43   ` Philippe Mathieu-Daudé
     [not found] ` <20180621171257.14897-6-f4bug@amsat.org>
2018-06-22  6:22   ` [Qemu-devel] [PATCH 05/11] hw/display/cirrus: Convert printf() calls " Gerd Hoffmann
2018-06-22 12:07     ` Philippe Mathieu-Daudé
2018-06-22 12:31       ` Gerd Hoffmann
2018-06-30 16:57         ` Philippe Mathieu-Daudé
2018-06-28 12:50 ` [Qemu-devel] [PATCH 00/11] hw: various conversions to trace-events Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180621171257.14897-2-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.