From nobody Wed Nov 19 13:56:30 2025 Delivered-To: importer@patchew.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=de.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1616082618; cv=none; d=zohomail.com; s=zohoarc; b=dgAy4HSLyxgybbJixZvuyOy2i/3t+WIOCpPyCo5VwiKZUrMbHEfz6/KLd3QQm3QSiEqtAgCzgis0mM6BBYxWeaSKj9rkAB2FIbrjOWhL2E7zwL24BkWtuLhtI5pE6ZrGWD05OffcRK+8rc3wo/f+HbxQZD+unUTmIX6MqrsoJxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616082618; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=s0gLlBJoVf6477OJA1zTzebYykL2NkKmyZgrCxLfazU=; b=GvBMBvRmr+kX+pHoGzU+F32Mgcfa9BgAPqN46cCXeUNbhgX8uBXFGIH2fNwd6ifd0xdnvcP/lL7dqsUFTs4kmXBlbEwdQ0smxMsBBrKBGqxpMxc+1GXE55wRKE7ZPEU4ToJhlfyzZZrBMjGeij3TVaQRz808Ad5dXUN8XE698g4= 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 1616082616530900.999585977319; Thu, 18 Mar 2021 08:50:16 -0700 (PDT) Received: from localhost ([::1]:37094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMuuI-0003aI-61 for importer@patchew.org; Thu, 18 Mar 2021 11:49:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMusG-0002iF-Lt; Thu, 18 Mar 2021 11:47:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:3612 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMusE-0001Xe-Vl; Thu, 18 Mar 2021 11:47:48 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12IFYUCK105120; Thu, 18 Mar 2021 11:47:44 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 37by16brsr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Mar 2021 11:47:44 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 12IFZ2Hj109306; Thu, 18 Mar 2021 11:47:44 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 37by16brrr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Mar 2021 11:47:43 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 12IFWGht016183; Thu, 18 Mar 2021 15:47:41 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 378n18mwkj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Mar 2021 15:47:41 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 12IFlMBl34406674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Mar 2021 15:47:22 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 27C4B11C052; Thu, 18 Mar 2021 15:47:39 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15F1211C04C; Thu, 18 Mar 2021 15:47:39 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 18 Mar 2021 15:47:39 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id AC451E165E; Thu, 18 Mar 2021 16:47:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=pp1; bh=s0gLlBJoVf6477OJA1zTzebYykL2NkKmyZgrCxLfazU=; b=s0AGUt53IZvL9WRbaDxcBZ217Z7b+HxkBG845+dBAEYnt9IBPl3MSEadqXc9cz37Cw9C XGrK4AfSJFphjVErlQ2gnrnUgn+1mt2vG6l/I6f32yp2dVPQYRLKNYkk3QGrLJ4r0g65 +ynnHzCIaBVCTAmW2X/9N62hYczSktltVly+AhUYMO/ezF9v45tXTJ9ZdPsC/JIAHyEF 9ZV1T1hj0gL+465AEJ3ny2ro0eHM3zVWtAMwKAvGrN2Vn37CEH06d2mApTAjC3Vv7k2C IKOvfi5rygzQtPY8JxYWO9AC5oG4wdayB0qY4ZgMQ6QqUpg0aLXsJwHVoyGnoJsgCjo0 Dg== From: Christian Borntraeger To: "Michael S . Tsirkin" , Paolo Bonzini Subject: [PATCH] intc/i8259: avoid (false positive) gcc warning Date: Thu, 18 Mar 2021 16:47:38 +0100 Message-Id: <20210318154738.27094-1-borntraeger@de.ibm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-18_09:2021-03-17, 2021-03-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 impostorscore=0 suspectscore=0 mlxlogscore=969 clxscore=1015 mlxscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103180111 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=148.163.158.5; envelope-from=borntraeger@de.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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: , Cc: Thomas Huth , Christian Borntraeger , qemu-s390x , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) some copiler versions are smart enough to detect a potentially uninitialized variable, but are not smart enough to detect that this cannot happen due to the code flow: ../hw/intc/i8259.c: In function =E2=80=98pic_read_irq=E2=80=99: ../hw/intc/i8259.c:203:13: error: =E2=80=98irq2=E2=80=99 may be used uninit= ialized in this function [-Werror=3Dmaybe-uninitialized] 203 | irq =3D irq2 + 8; | ~~~~^~~~~~~~~~ Let us initialize irq2 to -1 to avoid this warning as the most simple solution. Signed-off-by: Christian Borntraeger --- hw/intc/i8259.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c index 344fd04db14d..ade6fb726faf 100644 --- a/hw/intc/i8259.c +++ b/hw/intc/i8259.c @@ -176,7 +176,7 @@ static void pic_intack(PICCommonState *s, int irq) int pic_read_irq(DeviceState *d) { PICCommonState *s =3D PIC_COMMON(d); - int irq, irq2, intno; + int irq, irq2 =3D -1, intno; =20 irq =3D pic_get_irq(s); if (irq >=3D 0) { --=20 2.30.2