From patchwork Mon Apr 23 19:40:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 154530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C3062B6FBB for ; Tue, 24 Apr 2012 05:40:26 +1000 (EST) Received: from localhost ([::1]:60589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMP7Y-00062O-Mc for incoming@patchwork.ozlabs.org; Mon, 23 Apr 2012 15:40:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMP7R-00060h-L1 for qemu-devel@nongnu.org; Mon, 23 Apr 2012 15:40:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMP7M-00025n-Pq for qemu-devel@nongnu.org; Mon, 23 Apr 2012 15:40:17 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:42651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMP7M-00023N-Ju for qemu-devel@nongnu.org; Mon, 23 Apr 2012 15:40:12 -0400 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id 4B67872800B4; Mon, 23 Apr 2012 21:40:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PUqoZ5hWnQIo; Mon, 23 Apr 2012 21:40:08 +0200 (CEST) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id C84A972800B8; Mon, 23 Apr 2012 21:40:08 +0200 (CEST) From: Stefan Weil To: qemu-devel@nongnu.org Date: Mon, 23 Apr 2012 21:40:08 +0200 Message-Id: <1335210008-22777-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.9 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 78.47.199.172 Cc: Blue Swirl , Stefan Weil Subject: [Qemu-devel] [PATCH] qtest: Fix more format errors with qtest_sendf X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org After adding GCC_FMT_ATTR to qtest_sendf, more format errors are reported by the compiler. These are fixed here. Signed-off-by: Stefan Weil --- tests/libqtest.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index 1ce6fa1..295c6d4 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -26,6 +26,7 @@ #include #include +#include "compiler.h" #include "osdep.h" #define MAX_IRQ 256 @@ -130,7 +131,7 @@ void qtest_quit(QTestState *s) } } -static void qtest_sendf(QTestState *s, const char *fmt, ...) +static void GCC_FMT_ATTR(2, 3) qtest_sendf(QTestState *s, const char *fmt, ...) { va_list ap; gchar *str; @@ -356,7 +357,7 @@ void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size) gchar **args; size_t i; - qtest_sendf(s, "read 0x%" PRIx64 " 0x%x\n", addr, size); + qtest_sendf(s, "read 0x%" PRIx64 " 0x%zx\n", addr, size); args = qtest_rsp(s, 2); for (i = 0; i < size; i++) { @@ -378,7 +379,7 @@ void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size) const uint8_t *ptr = data; size_t i; - qtest_sendf(s, "write 0x%" PRIx64 " 0x%x 0x", addr, size); + qtest_sendf(s, "write 0x%" PRIx64 " 0x%zx 0x", addr, size); for (i = 0; i < size; i++) { qtest_sendf(s, "%02x", ptr[i]); }