From nobody Sun May 19 10:14:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39881+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39881+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556660024; cv=none; d=zoho.com; s=zohoarc; b=EwV0zyDPe8fXcDa3WGcFpYDmsVysdeEWj9U7GWHE3esBPN+SDC7NlbiYJh/QOEDXtTjsygvQhLoGe4hV1Vuh6bMKXHN0GD6HNMKdzPhvb587/hDURjv9CkBA5AGfS1DsUDE63x7YCApT5Fb3Uicel2fd8IIzn6qbKf9D6CctiuA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556660024; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=9OQQkj/DkuO5Dz65gDfsGGiO6CwwR3cFh4QBWDYZrKw=; b=eAXB6vvShIwRZD8WtBz6VmYtahq1oO6jNYUgq5QJOAqZ611g3qM6rlwqDyB6bPvvu7tTI5uwDhgE9ekfBjGN6Jdh4GwYdqQZJ/ceLtvIcrDf90vPA9MM5Ue/IH2b9LwR9jEAzWX+gelW3LA7Oy5JZ29Ov97Oxvr/1x44BobthLo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39881+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 1556660024417698.6829484598768; Tue, 30 Apr 2019 14:33:44 -0700 (PDT) Return-Path: X-Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 30 Apr 2019 14:33:43 -0700 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B34853082B15; Tue, 30 Apr 2019 21:33:42 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-42.rdu2.redhat.com [10.10.121.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id B641B7C825; Tue, 30 Apr 2019 21:33:41 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Jordan Justen Subject: [edk2-devel] [PATCH] OvmfPkg/EnrollDefaultKeys: suppress incorrect compiler warning Date: Tue, 30 Apr 2019 23:33:39 +0200 Message-Id: <20190430213339.23769-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 30 Apr 2019 21:33:42 +0000 (UTC) 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,lersek@redhat.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556660023; bh=EiwBY4ztvUaO3FyrfOfTRMeZRMIfRe2zPWZ6K0zoJPs=; h=Cc:Date:From:Reply-To:Subject:To; b=PUr1a/p0hqTk/pwrttbblnG/QgDILl+W1vfVcmIz9oWWoWmHJPUBUKbfJ+G7IYx05Xg A46NlnFJLHoT8L8GIR2K/Ad1A+2iNIvMU5nn1MPtwisiShCsVVafAEGEG8k4DCHIsgi/a NL4Y66I6J9x1bi7turNaRzSAMQ9p1FJp/iU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" When building OvmfPkg/EnrollDefaultKeys for IA32 with gcc-4.8 for the DEBUG target (and possibly under other build configurations too), the compiler incorrectly reports, > OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c: In function > 'ShellAppMain': > OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c:631:10: error: > 'SizeOfPkKek1' may be used uninitialized in this function > [-Werror=3Dmaybe-uninitialized] > Status =3D EnrollListOfCerts ( > ^ > OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c:703:12: error: 'PkKek1' > may be used uninitialized in this function [-Werror=3Dmaybe-uninitialized] > FreePool (PkKek1); > ^ > cc1: all warnings being treated as errors Suppress this warning, in the style suggested under . Cc: Ard Biesheuvel Cc: Jordan Justen Reported-by: Ard Biesheuvel Fixes: be9470b3c91fc50436c15a76c85cdde940355b9f Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c b/OvmfPkg/Enroll= DefaultKeys/EnrollDefaultKeys.c index b7b2e424c59e..75f2749dc84a 100644 --- a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c +++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c @@ -554,14 +554,21 @@ ShellAppMain ( PrintSettings (&Settings); =20 if (Settings.SetupMode !=3D 1) { AsciiPrint ("error: already in User Mode\n"); return RetVal; } =20 + // + // Set PkKek1 and SizeOfPkKek1 to suppress incorrect compiler/analyzer + // warnings. + // + PkKek1 =3D NULL; + SizeOfPkKek1 =3D 0; + // // Fetch the X509 certificate (to be used as Platform Key and first Key // Exchange Key) from SMBIOS. // Status =3D GetPkKek1 (&PkKek1, &SizeOfPkKek1); if (EFI_ERROR (Status)) { return RetVal; --=20 2.19.1.3.g30247aa5d201 -=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 (#39881): https://edk2.groups.io/g/devel/message/39881 Mute This Topic: https://groups.io/mt/31425619/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-