From patchwork Mon Apr 2 10:50:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 150105 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 13AC6B6EE6 for ; Mon, 2 Apr 2012 20:51:50 +1000 (EST) Received: from localhost ([::1]:57307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEerT-0006kz-W9 for incoming@patchwork.ozlabs.org; Mon, 02 Apr 2012 06:51:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEeqM-0003tj-CG for qemu-devel@nongnu.org; Mon, 02 Apr 2012 06:50:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEeqF-0003jt-VA for qemu-devel@nongnu.org; Mon, 02 Apr 2012 06:50:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEeqF-0003jO-NF for qemu-devel@nongnu.org; Mon, 02 Apr 2012 06:50:31 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q32AoUgx014027 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 2 Apr 2012 06:50:30 -0400 Received: from lettuce.camlab.fab.redhat.com (lettuce.camlab.fab.redhat.com [10.33.15.20]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q32AoNxD013508; Mon, 2 Apr 2012 06:50:29 -0400 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Mon, 2 Apr 2012 11:50:14 +0100 Message-Id: <1333363816-1691-8-git-send-email-berrange@redhat.com> In-Reply-To: <1333363816-1691-1-git-send-email-berrange@redhat.com> References: <1333363816-1691-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 7/9] Add -Wmissing-format-attribute & fix problems it finds 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 From: "Daniel P. Berrange" * 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 Signed-off-by: Daniel P. Berrange --- 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];