From nobody Thu Oct 9 08:31:47 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1582635090; cv=none; d=zohomail.com; s=zohoarc; b=Wqhj3bo2mP7OuQwUYli81QVpY465Ws8Wb9iqktb92CWWM8S3h/xsVFVtlRRmL+YqTkPWIhujuR6qwIykD3e77exGsx4v4Z3rd8QaOZCWV3g+cXCmtlkzdKBP+HO3ZYrTatgr8ivHlEcE6P9YHmjkUlDeEOrVPru7hZPSGNOqbv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582635090; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PR3MIDvz3PtDDaollGFXmkX1Ue3lMr6ulNQeQQNdSxU=; b=CFN/Dm82pG/OnHyeRGvnxRB1CuNgn3eFkmsqTEIi0JOb29ldzyD7UixPN10kbyzIy7PN7//tjyySXa0OALM07BOZQWEE4WBLmvnhsOKvr6l1OWbimum/gcUyEEimfAdw/H7bYwvUfAljVplPpzGfqCsWzFe5WoMvzJfHb4erSb8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15826350898712.379858592656319; Tue, 25 Feb 2020 04:51:29 -0800 (PST) Received: from localhost ([::1]:54826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ZgO-0004H8-E1 for importer@patchew.org; Tue, 25 Feb 2020 07:51:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59293) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ZcZ-0005fR-Qv for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6ZcY-0007IE-Lr for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:31 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:35448) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6ZcY-0007Ho-F2 for qemu-devel@nongnu.org; Tue, 25 Feb 2020 07:47:30 -0500 Received: by mail-wr1-x444.google.com with SMTP id w12so14596305wrt.2 for ; Tue, 25 Feb 2020 04:47:30 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b10sm23808377wrt.90.2020.02.25.04.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 04:47:22 -0800 (PST) Received: from zen.home.arpa (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 59D041FF9C; Tue, 25 Feb 2020 12:47:11 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PR3MIDvz3PtDDaollGFXmkX1Ue3lMr6ulNQeQQNdSxU=; b=pGw8Lg/xVnYtr0lrehL9FkVN/2n4/Ho6Ly0xoHVrpuo6Ee8DMdaUtWxc46FTb6iSGE akC3scEjRjW0s0Kezy746JiTmHNAftymMKbX3FUmkCPP867woLwwyF29iksFsB/n5Ygs gAlw/Fbvbx99QUzjRbBpY/3/3EIhpSjLKLEUTtiy2kbPtvVlt52YyCD9rvu4TOiuNF5k 1UG2cbC/xJrGSM9lkuT23xERBK8A8haCSSRLohDJNmLOiAhaxzSoPAXTqS8lJKkDNe9M yggpwwqoTR6MqoNYq+cFLwq6p3XeHE0PL2DUGrN269B1KdC1MFXO2go1rZcyjiRdI3FA qDLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PR3MIDvz3PtDDaollGFXmkX1Ue3lMr6ulNQeQQNdSxU=; b=oQ8ZUcmudiXn7HExImOUYFpv1OQQw54QXI/vafxUPfknFAlfEoPH/8JmF4ecbv4NW5 jfjtCw0uAkKr26QrA1rTsKfv5jG/br5fNe2iHgudIUISb14wDbYzUTiTjVaUSQ5rSal8 z41C43B4eZWhprjKH+iuxLGHOwFOSCCBZWwOmVxgPVPj1J7BRM7VRWD+dFfju2P/EWpt YRsCRmAx9Q8NsRCmc1/vM58b0imMZpPgpiadnT7RAoJIhVce4d46JaLX7eLmMFjYZngk oiuDf/JAwCVaEdjtLuA71iCv4jU4oFJ/4kxiJcAIAzxiUU8bgh+iDYc38Cl+D3rUqBwf vINQ== X-Gm-Message-State: APjAAAVLuOvgnI0zv/2mQOv/++nSdNZn5H2QTIcAVsNo5XPWm/q54Oqa GY/3OKSojfHHbA2mbrjYobZsEjVnQdU= X-Google-Smtp-Source: APXvYqxTsLyZjePFmAeRk1az1RrY49/ZVZXDsGSwO3uOWeBdohO77zItX9s3F1smAZfWNPk4Fe3kIQ== X-Received: by 2002:adf:ee86:: with SMTP id b6mr13478800wro.282.1582634849473; Tue, 25 Feb 2020 04:47:29 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 12/19] tests/plugin: prevent uninitialized warning Date: Tue, 25 Feb 2020 12:47:03 +0000 Message-Id: <20200225124710.14152-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200225124710.14152-1-alex.bennee@linaro.org> References: <20200225124710.14152-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , berrange@redhat.com, robert.foley@linaro.org, pbonzini@redhat.com, stefanb@linux.vnet.ibm.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Euler Robot , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, marcandre.lureau@redhat.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Chen Qun According to the glibc function requirements, we need initialise the variable. Otherwise there will be compilation warnings: glib-autocleanups.h:28:3: warning: =E2=80=98out=E2=80=99 may be used uninitialized in this function [-Wmaybe-uninitialized] g_free (*pp); ^~~~~~~~~~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Thomas Huth Message-Id: <20200206093238.203984-1-kuhn.chenqun@huawei.com> [AJB: uses Thomas's single line allocation] Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- tests/plugin/bb.c | 6 +++--- tests/plugin/insn.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index f30bea08dcc..df19fd359df 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -22,9 +22,9 @@ static bool do_inline; =20 static void plugin_exit(qemu_plugin_id_t id, void *p) { - g_autofree gchar *out; - out =3D g_strdup_printf("bb's: %" PRIu64", insns: %" PRIu64 "\n", - bb_count, insn_count); + g_autofree gchar *out =3D g_strdup_printf( + "bb's: %" PRIu64", insns: %" PRIu64 "\n", + bb_count, insn_count); qemu_plugin_outs(out); } =20 diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index 0a8f5a0000e..a9a6e412373 100644 --- a/tests/plugin/insn.c +++ b/tests/plugin/insn.c @@ -44,8 +44,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qem= u_plugin_tb *tb) =20 static void plugin_exit(qemu_plugin_id_t id, void *p) { - g_autofree gchar *out; - out =3D g_strdup_printf("insns: %" PRIu64 "\n", insn_count); + g_autofree gchar *out =3D g_strdup_printf("insns: %" PRIu64 "\n", insn= _count); qemu_plugin_outs(out); } =20 --=20 2.20.1