From patchwork Sat Oct 16 17:42:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 68049 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 3A16EB70F3 for ; Sun, 17 Oct 2010 04:43:46 +1100 (EST) Received: from localhost ([127.0.0.1]:51442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7AnH-0003Ce-De for incoming@patchwork.ozlabs.org; Sat, 16 Oct 2010 13:43:43 -0400 Received: from [140.186.70.92] (port=58242 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7AmO-0003AI-H4 for qemu-devel@nongnu.org; Sat, 16 Oct 2010 13:42:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P7AmM-0002RG-QU for qemu-devel@nongnu.org; Sat, 16 Oct 2010 13:42:48 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:58150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P7AmM-0002Qq-G6 for qemu-devel@nongnu.org; Sat, 16 Oct 2010 13:42:46 -0400 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate01.web.de (Postfix) with ESMTP id CE24016F3F8DE; Sat, 16 Oct 2010 19:42:43 +0200 (CEST) Received: from [92.74.53.17] (helo=mchn199C.mchp.siemens.de) by smtp03.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #24) id 1P7AmJ-0000pX-00; Sat, 16 Oct 2010 19:42:43 +0200 Message-ID: <4CB9E413.5090400@web.de> Date: Sat, 16 Oct 2010 19:42:43 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Blue Swirl References: <4CB74350.80201@redhat.com> <4CB7AF6F.4010104@redhat.com> In-Reply-To: X-Enigmail-Version: 1.1.2 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1/J3lehyvgZgmnjIzAVFszlWKQ++6J6xL0rP2kU HGn220LAVRm0L9JkhHEmjgOI9StMhusA5BbhWX1emRGJWKqX39 kMwU3g/LY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Paolo Bonzini , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] Silence compiler warning in json test case 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 Am 16.10.2010 18:28, Blue Swirl wrote: > On Sat, Oct 16, 2010 at 12:37 AM, Paolo Bonzini wrote: >> On 10/15/2010 07:41 PM, Blue Swirl wrote: >>> >>> Which functions are optimized away and which aren't? >> >> It's builtins only that are optimized away or otherwise inlined (printf, >> sprintf, etc.). Other calls stay, together with side effects and clock >> cycles. > > Then the warning makes sense (slightly) and should remain on main QEMU side. > From: Jan Kiszka This avoids error: zero-length gnu_printf format string Signed-off-by: Jan Kiszka --- check-qjson.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/check-qjson.c b/check-qjson.c index 0b60e45..64fcdcb 100644 --- a/check-qjson.c +++ b/check-qjson.c @@ -639,7 +639,9 @@ END_TEST START_TEST(empty_input) { - QObject *obj = qobject_from_json(""); + const char *empty = ""; + + QObject *obj = qobject_from_json(empty); fail_unless(obj == NULL); } END_TEST