From patchwork Wed Mar 5 21:11:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 327195 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 79D2C2C00AA for ; Thu, 6 Mar 2014 08:57:05 +1100 (EST) Received: from localhost ([::1]:54781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLJoE-0002ym-Kv for incoming@patchwork.ozlabs.org; Wed, 05 Mar 2014 16:57:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLJnu-0002xm-Es for qemu-devel@nongnu.org; Wed, 05 Mar 2014 16:56:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLJnp-0007Kf-HB for qemu-devel@nongnu.org; Wed, 05 Mar 2014 16:56:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLJnp-0007KS-8O for qemu-devel@nongnu.org; Wed, 05 Mar 2014 16:56:37 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s25LuXuN031171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Mar 2014 16:56:33 -0500 Received: from [10.3.113.4] ([10.3.113.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s25LB4k3011181; Wed, 5 Mar 2014 16:11:04 -0500 Message-ID: <531792E8.5080901@redhat.com> Date: Wed, 05 Mar 2014 14:11:04 -0700 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Stefan Weil , qemu-devel@nongnu.org, Peter Maydell References: <1394053327-27964-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1394053327-27964-1-git-send-email-sw@weilnetz.de> X-Enigmail-Version: 1.6 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Subject: Re: [Qemu-devel] [PATCH] qjson.h: Remove GCC_FMT_ATTR markup from qobject_from_jsonv() declaration 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 On 03/05/2014 02:02 PM, Stefan Weil wrote: > Commit aa830cdc28edb69c1fe81c8fd9471ab288ad0926 removed that attribute > from qobject_from_json. Now gcc suggests to add it again when compiler > flag -Wmissing-format-attribute is used: > > qobject/qjson.c: In function ‘qobject_from_json’: > qobject/qjson.c:53:5: error: > function might be possible candidate for ‘gnu_printf’ format attribute > [-Werror=suggest-attribute=format] > > Fix this by removing the flag from qobject_from_jsonv, too. NAK. qobject_from_jsonv needs the attribute. Maybe this is a better approach (untested): /* diff --git i/qobject/qjson.c w/qobject/qjson.c index 6cf2511..f9616f8 100644 --- i/qobject/qjson.c +++ w/qobject/qjson.c @@ -50,7 +50,7 @@ QObject *qobject_from_jsonv(const char *string, va_list *ap) QObject *qobject_from_json(const char *string) { - return qobject_from_jsonv(string, NULL); + return qobject_from_jsonf("%s", string); }