From nobody Sun Feb 8 22:35:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616347291; cv=none; d=zohomail.com; s=zohoarc; b=iaJPQngDDcmyZ5EuTewFjyUZPYjfFlHail8f2GnFEu2n1/qdYx5HWbxM4e+d6J6mRvIWb+rft8pFIRCLW9G7EL6H2SVOlfsZwY3HO7gG/u6DxqYhN9vPHHvg/mHtg3oVAgg/z9PDWAZd37z79liisw8f96UIzwwEMBATazUYppA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616347291; h=Content-Type:Content-Transfer-Encoding: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=02DGbrUqtjcx+KvCxlPP539DjQ82K7xeYKUDqDDUnwQ=; b=LbpNm8GqOiRt6MFDt0B3QPwfQ58+/8cbw6gSFlhJ6ld0OdTVYTI/zhTB4skBYL9xtl8W95E5kgaokIExGZ2w6xys03SJ1Onr15Bra9W+Z7taMzTWHbsJqmMpYsAO7gDIyj2mJm5s+yKaf35VLlzSAOrMTKoXtmP/O4jAMRZNx14= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 16163472911997.145705546225372; Sun, 21 Mar 2021 10:21:31 -0700 (PDT) Received: from localhost ([::1]:43096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lO1lZ-0000oG-Nu for importer@patchew.org; Sun, 21 Mar 2021 13:21:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lO1j0-0007NK-SS for qemu-devel@nongnu.org; Sun, 21 Mar 2021 13:18:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29814) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lO1it-0005Ra-LX for qemu-devel@nongnu.org; Sun, 21 Mar 2021 13:18:49 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-575-L7VOJT2MNpyeMny5xQV1Kg-1; Sun, 21 Mar 2021 13:18:40 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E97CD108BD06; Sun, 21 Mar 2021 17:18:38 +0000 (UTC) Received: from thuth.com (ovpn-112-125.ams2.redhat.com [10.36.112.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C14C295D8; Sun, 21 Mar 2021 17:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616347122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=02DGbrUqtjcx+KvCxlPP539DjQ82K7xeYKUDqDDUnwQ=; b=W3QBrI8RyDVOISSqiAcJa6u/qCyeyNfcLBkRtL+C0DpQApSCnT7OCORbfmgdx87YW0IcgS elJSQugap47NItVHKSYdlfuLsoUGyttqAtXdvbjwzpzzpe/M3x4VJTNcIcDzVRe6P77IRx QxZLdfexWX4zNPfdFVqQzz7vBPCYQGU= X-MC-Unique: L7VOJT2MNpyeMny5xQV1Kg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 2/5] tests/unit/test-block-iothread: fix maybe-uninitialized error on GCC 11 Date: Sun, 21 Mar 2021 18:18:30 +0100 Message-Id: <20210321171833.20736-3-thuth@redhat.com> In-Reply-To: <20210321171833.20736-1-thuth@redhat.com> References: <20210321171833.20736-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Emanuele Giuseppe Esposito When building qemu with GCC 11, test-block-iothread produces the following warning: ../tests/unit/test-block-iothread.c:148:11: error: =E2=80=98buf=E2=80=99 ma= y be used uninitialized [-Werror=3Dmaybe-uninitialized] This is caused by buf[512] left uninitialized and passed to bdrv_save_vmstate() that expects a const uint8_t *, so the compiler assumes it will be read and expects the parameter to be initialized. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Paolo Bonzini Message-Id: <20210319112218.49609-1-eesposit@redhat.com> Signed-off-by: Thomas Huth --- tests/unit/test-block-iothread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-block-iothread.c b/tests/unit/test-block-iothr= ead.c index 3f866a35c6..8cf172cb7a 100644 --- a/tests/unit/test-block-iothread.c +++ b/tests/unit/test-block-iothread.c @@ -89,7 +89,7 @@ static void test_sync_op_pread(BdrvChild *c) =20 static void test_sync_op_pwrite(BdrvChild *c) { - uint8_t buf[512]; + uint8_t buf[512] =3D { 0 }; int ret; =20 /* Success */ @@ -117,7 +117,7 @@ static void test_sync_op_blk_pread(BlockBackend *blk) =20 static void test_sync_op_blk_pwrite(BlockBackend *blk) { - uint8_t buf[512]; + uint8_t buf[512] =3D { 0 }; int ret; =20 /* Success */ @@ -141,7 +141,7 @@ static void test_sync_op_load_vmstate(BdrvChild *c) =20 static void test_sync_op_save_vmstate(BdrvChild *c) { - uint8_t buf[512]; + uint8_t buf[512] =3D { 0 }; int ret; =20 /* Error: Driver does not support snapshots */ --=20 2.27.0