From patchwork Mon Sep 27 16:45:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 65882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5ABAFB70D9 for ; Tue, 28 Sep 2010 02:46:46 +1000 (EST) Received: from localhost ([127.0.0.1]:50977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0Gqg-0006Ng-DJ for incoming@patchwork.ozlabs.org; Mon, 27 Sep 2010 12:46:42 -0400 Received: from [140.186.70.92] (port=37844 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0Gq3-0006NU-Jr for qemu-devel@nongnu.org; Mon, 27 Sep 2010 12:46:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0Gq2-0005IW-Ea for qemu-devel@nongnu.org; Mon, 27 Sep 2010 12:46:03 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:50294) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0Gq2-0005Fz-3g for qemu-devel@nongnu.org; Mon, 27 Sep 2010 12:46:02 -0400 Received: from flocke.weilnetz.de (p54ADB5D9.dip.t-dialin.net [84.173.181.217]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MHrmH-1P3qGh3pt7-003mMX; Mon, 27 Sep 2010 18:45:51 +0200 Received: from stefan by flocke.weilnetz.de with local (Exim 4.72) (envelope-from ) id 1P0Gpp-0000RJ-3C; Mon, 27 Sep 2010 18:45:49 +0200 From: Stefan Weil To: QEMU Developers Date: Mon, 27 Sep 2010 18:45:47 +0200 Message-Id: <1285605947-1553-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-Provags-ID: V02:K0:m+Xu4kXh0UgjcuD3iholHiFi+NzOwXzbs7zJoz98Dar MAclv/LykAs/UUVjoAFxDXn9QLUOofiy3fMqaVSNAoWkGPvSOE GlFvps4HjK3tJc+MrQ4rJ/gLZAthOYTYBdsB7xhurjHTTLhKFD bbT0Mrpme2T/D/8Edbz8WT1rhBJrbabl03K4pbwoUYRu0OnFUG oxWovlalrDL/PQTCnKpIgMJhtj8vX5QN+P0LH4LcCjpC7SIy+9 W0/wJw7yE5HIa X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Blue Swirl Subject: [Qemu-devel] [PATCH] virtio-9p: Use GCC_FMT_ATTR and fix a format warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org With the new gcc format warnings, gcc detected this: /qemu/hw/virtio-9p.c:1040: error: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘__nlink_t’ Cc: Blue Swirl Signed-off-by: Stefan Weil --- hw/virtio-9p.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c index 32fa3bc..3b2d49c 100644 --- a/hw/virtio-9p.c +++ b/hw/virtio-9p.c @@ -333,7 +333,8 @@ static int number_to_string(void *arg, char type) return ret; } -static int v9fs_string_alloc_printf(char **strp, const char *fmt, va_list ap) +static int GCC_FMT_ATTR(2, 0) +v9fs_string_alloc_printf(char **strp, const char *fmt, va_list ap) { va_list ap2; char *iter = (char *)fmt; @@ -387,7 +388,8 @@ alloc_print: return vsprintf(*strp, fmt, ap); } -static void v9fs_string_sprintf(V9fsString *str, const char *fmt, ...) +static void GCC_FMT_ATTR(2, 3) +v9fs_string_sprintf(V9fsString *str, const char *fmt, ...) { va_list ap; int err; @@ -1034,8 +1036,8 @@ static int stat_to_v9stat(V9fsState *s, V9fsString *name, S_ISCHR(stbuf->st_mode) ? 'c' : 'b', major(stbuf->st_rdev), minor(stbuf->st_rdev)); } else if (S_ISDIR(stbuf->st_mode) || S_ISREG(stbuf->st_mode)) { - v9fs_string_sprintf(&v9stat->extension, "%s %u", - "HARDLINKCOUNT", stbuf->st_nlink); + v9fs_string_sprintf(&v9stat->extension, "%s %lu", + "HARDLINKCOUNT", (unsigned long)stbuf->st_nlink); } str = strrchr(name->data, '/');