From nobody Fri Apr 26 18:17:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56260+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56260+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1585127564; cv=none; d=zohomail.com; s=zohoarc; b=HtvsZ3QBAYM6Q1+ecYdYY2w1w5ur7ODeWbNN5yJy0E+S3xJzXlDpnql/3u+az8gQB2Z2T/L/2TBGndTyr/l+Nd9PlM+LzdKW4oy7Wr/sVNLrEoTeEX+DNC1qIKo/nilQMDyaSHznqyQkuEHoH/8ecl/BOxSV/HMiPSlTxzT8x2w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585127564; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=3HoiIII5lAsmNuxtqy+jkE/0Yj5RGOw37uPmTs38Pd8=; b=h8NReqklJt5RR3bH0pY/VhR3BLRTOaTqTvZLqLE8nKDcz00BjnwnmgGpwriPYL8/DBHocnG7Xp00rrQ/Y0G+INbg7w82n/K9Q2FG+uKxS6LlvwwEzhpfrv97YgJLLA2xAWVzOE+O1foG+4V94Xzd3IaHW/TJ44iecADhLfOnwGc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56260+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585127564486828.4381367537576; Wed, 25 Mar 2020 02:12:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id G7vIYY1788612xf7S2hKMG5m; Wed, 25 Mar 2020 02:12:43 -0700 X-Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.groups.io with SMTP id smtpd.web11.7587.1585127562957410587 for ; Wed, 25 Mar 2020 02:12:43 -0700 X-Received: by mail-wm1-f68.google.com with SMTP id l20so1585418wmi.3 for ; Wed, 25 Mar 2020 02:12:42 -0700 (PDT) X-Gm-Message-State: Rh0b2M2NdnREAbZAY7pTKoSQx1787277AA= X-Google-Smtp-Source: ADFU+vuimoV/W0HEM24uR7eZIrlZF+DefWtkh0JIUj3VLP6W/EodbYJtnGXhOW4DIhVVji+L0wg/wg== X-Received: by 2002:a05:600c:2dcf:: with SMTP id e15mr2349006wmh.101.1585127561232; Wed, 25 Mar 2020 02:12:41 -0700 (PDT) X-Received: from e123331-lin.home (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr. [109.210.65.247]) by smtp.gmail.com with ESMTPSA id z12sm34359717wrt.27.2020.03.25.02.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 02:12:40 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: lersek@redhat.com, Ard Biesheuvel Subject: [edk2-devel] [PATCH] OvmfPkg/X86QemuLoadImageLib: add dummy assignment to work around GCC Date: Wed, 25 Mar 2020 10:12:38 +0100 Message-Id: <20200325091238.24048-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1585127563; bh=O3SV0BU+R+5DIqkf3brZ7pV+AeMUkx+gJ2OsJ5jWScY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=mciw15W67aqztQfaRiIH4j2Zttid6Y0gzqyqaYWPO+WUKrlQd+vyjUhvESAVwUIT7X2 wMhzZ8S3+4VTtaZhtvBQ53btyh+8pOOV4+5EvfVo+ax6VBy3fmH5P4bOoU7nJpmIiqWhY fyRPtCQlXYL9ajl0yZh7eokRpJEfmXFB4D8= X-ZohoMail-DKIM: pass (identity @groups.io) GCC 4.8 or 4.9 may throw the following error when building OVMF: Edk2/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c: In function =E2=80=98QemuLoadKernelImage=E2=80=99: Edk2/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c:416:30: error: =E2=80=98CommandLine=E2=80=99 may be used uninitialized in thi= s function [-Werror=3Dmaybe-uninitializ= ed] UnicodeSPrintAsciiFormat ( cc1: all warnings being treated as errors This is due to the fact that older GCCs fail to infer that CommandLine is never actually used unless it has been assigned. So add a redundant NULL assignment to help these older GCCs understand this. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2630 Fixes: 7c47d89003a6f ("OvmfPkg: implement QEMU loader library for X86 with = ...") Signed-off-by: Ard Biesheuvel Reviewed-by: Laszlo Ersek --- OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c b/Ov= mfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c index c5bd6862b265..52b14a4462d8 100644 --- a/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c +++ b/OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.c @@ -291,6 +291,11 @@ QemuLoadKernelImage ( CHAR8 *CommandLine; UINTN InitrdSize; =20 + // + // Redundant assignment to work around GCC48/GCC49 limitations. + // + CommandLine =3D NULL; + // // Load the image. This should call back into the QEMU EFI loader file s= ystem. // --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56260): https://edk2.groups.io/g/devel/message/56260 Mute This Topic: https://groups.io/mt/72537049/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-