From nobody Fri May 3 05:35:02 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1505386434209478.28798120548436; Thu, 14 Sep 2017 03:53:54 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2D74721E2BE3E; Thu, 14 Sep 2017 03:50:54 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4858820945C16 for ; Thu, 14 Sep 2017 03:50:52 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 14 Sep 2017 03:53:51 -0700 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.31]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 03:53:49 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,392,1500966000"; d="scan'208";a="151765277" From: Star Zeng To: edk2-devel@lists.01.org Date: Thu, 14 Sep 2017 18:53:47 +0800 Message-Id: <1505386427-9048-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [edk2] [PATCH] MdeModulePkg UdfDxe: Fix VS2010/VS2012 build failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Eric Dong , Liming Gao , Dandan Bi , Laszlo Ersek , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" VS2010/VS2012 build failure with below info: warning C4701: potentially uninitialized local variable 'DataOffset' used potentially uninitialized local variable 'FilePosition' used potentially uninitialized local variable 'FinishedSeeking' used potentially uninitialized local variable 'Data' used warning C4703: potentially uninitialized local pointer variable 'Data' used In fact, DataOffset, FilePosition and FinishedSeeking are initialized and then used if (ReadFileInfo->Flags =3D=3D READ_FILE_SEEK_AND_READ). DoFreeAed will be set to TRUE when Data is allocated and returned from GetAedAdsData(), and Data will be freed if (DoFreeAed) when exiting. Use same method at 5afa5b815936e2b45a375b6521764195bed68680 to fix the build failure. There is related discussion at https://lists.01.org/pipermail/edk2-devel/2017-September/014641.html Cc: Laszlo Ersek Cc: Eric Dong Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Liming Gao Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Paulo Alcantara --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 9ec81a6cdcb4..4609580b3016 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -897,6 +897,10 @@ ReadFile ( // set BytesLeft to suppress incorrect compiler/analyzer warnings // BytesLeft =3D 0; + DataOffset =3D 0; + FilePosition =3D 0; + FinishedSeeking =3D FALSE; + Data =3D NULL; =20 switch (ReadFileInfo->Flags) { case READ_FILE_GET_FILESIZE: --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel