From nobody Fri Apr 26 14:46:57 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+43343+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+43343+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1562313099; cv=none; d=zoho.com; s=zohoarc; b=oTtuBmrw+UGGcroy7S/AzIFlMbsxrNP7wOaz5ShWM4KYFTPtTHArL/STCK9Yp9jXzsKErEOicIvm5442iwjoPTljxMTKgaZrnjttyKRm95NlxgEjTp2cxrpBgPXJ0OA8XA4Xmulu/+Q89KkL8K2nD91FKvjlZYqp3BSSunn+0Fk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562313099; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=k7Ww19UbSmuMjKKAXkWzWHVO2FBUW0EKZlImWjtPT78=; b=il5U4Kj53vwl/mmY6fT1e8GUS7wzxXiDjNoJZjsBQ8zNmjzE6dC0pQhsmUM88fMCpvJ1yQZxZN8PWUJJTLVrbdKq5jQQFQHedX6JFmTtYxSUGMPPawAoOCRqVSv21LEwFuQ76wB51i5nuG+hBalG5zkKjlQ2jNl237ypj80hkEI= 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+43343+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 1562313099908929.8448965888782; Fri, 5 Jul 2019 00:51:39 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Fri, 05 Jul 2019 00:51:39 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2019 00:51:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,454,1557212400"; d="scan'208";a="172591281" X-Received: from shwde7172.ccr.corp.intel.com ([10.239.158.22]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jul 2019 00:51:37 -0700 From: "Liming Gao" To: devel@edk2.groups.io Cc: gaozhic , Bob Feng Subject: [edk2-devel] [Patch] BaseTools: Fix GCC compiler failure in new added tools. Date: Fri, 5 Jul 2019 15:51:32 +0800 Message-Id: <1562313092-8576-1-git-send-email-liming.gao@intel.com> 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,liming.gao@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1562313099; bh=tLVRajvtY5HmokL9ZqrDNhNKVsMufupBRgh8XEW5dvQ=; h=Cc:Date:From:Reply-To:Subject:To; b=NiHo82JmqjAPwo4tc6y12LOFlJe+PCx0pi5JU3666atq6PhOW4+WP1c2cNeVIyTvRr9 KxijprJeLjwxoD/FSfyuUN7i1kKM7r6HtoFUV8iMfuJhQS/+dZHmeGXSw3Tqh4xRzbcg+ nQaZHldsuyefQIuKUGj2yDFoIDy4b/pcYIs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: gaozhic GCC 7 or 8 reports some warnings in new added FCE/FMMT/BlmLib. Signed-off-by: Liming Gao Cc: Bob Feng --- BaseTools/Source/C/BfmLib/BfmLib.c | 2 +- BaseTools/Source/C/FCE/BinaryParse.c | 2 +- BaseTools/Source/C/FMMT/FirmwareModuleManagement.c | 2 +- BaseTools/Source/C/FMMT/FmmtLib.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/C/BfmLib/BfmLib.c b/BaseTools/Source/C/BfmLib= /BfmLib.c index 9dedda3da2..5b7d5859fd 100644 --- a/BaseTools/Source/C/BfmLib/BfmLib.c +++ b/BaseTools/Source/C/BfmLib/BfmLib.c @@ -116,7 +116,7 @@ LibInitializeFvStruct ( =20 for (Index =3D 0; Index < MAX_NUMBER_OF_FILES_IN_FV; Index ++) { memset (Fv->FfsAttuibutes[Index].FfsName, '\0', _MAX_PATH); - memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH); + memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH * sizeof (CHA= R16)); =20 Fv->FfsAttuibutes[Index].IsLeaf =3D TRUE; Fv->FfsAttuibutes[Index].TotalSectionNum =3D 0; diff --git a/BaseTools/Source/C/FCE/BinaryParse.c b/BaseTools/Source/C/FCE/= BinaryParse.c index e9f8ee6826..3321963cb8 100644 --- a/BaseTools/Source/C/FCE/BinaryParse.c +++ b/BaseTools/Source/C/FCE/BinaryParse.c @@ -1240,7 +1240,7 @@ Done: ) { continue; } - sprintf (FileNameArry, "%s%c%s", FolderName, OS_SEP, pDirent->d_name= ); + snprintf (FileNameArry, MAX_FILENAME_LEN, FolderName, OS_SEP, pDiren= t->d_name); FfsFile =3D fopen (FileNameArry, "rb"); Status =3D ReadFfsHeader (FfsFile, (UINT32 *)&FileSize); if (EFI_ERROR (Status)) { diff --git a/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c b/BaseTools= /Source/C/FMMT/FirmwareModuleManagement.c index 63ae3c45a4..6648fbd54f 100644 --- a/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c +++ b/BaseTools/Source/C/FMMT/FirmwareModuleManagement.c @@ -1572,7 +1572,7 @@ FmmtImageDelete ( // If decrease operation executed, we should adjust th= e ffs list. It will bring in more complex. // //FvInFd->FfsNumbers -=3D 1; - memset(FvInFd->FfsAttuibutes[Index].UiName, '\0', _MAX= _PATH); + memset(FvInFd->FfsAttuibutes[Index].UiName, '\0', _MAX= _PATH * sizeof (CHAR16)); if (FvInFd->FfsAttuibutes[Index].FvLevel > 1) { for (j =3D Index - 1; j >=3D 0; j--) { if (FvInFd->FfsAttuibutes[j].FvLevel =3D=3D FvI= nFd->FfsAttuibutes[Index].FvLevel - 1) { diff --git a/BaseTools/Source/C/FMMT/FmmtLib.c b/BaseTools/Source/C/FMMT/Fm= mtLib.c index f87042114b..e477a52987 100644 --- a/BaseTools/Source/C/FMMT/FmmtLib.c +++ b/BaseTools/Source/C/FMMT/FmmtLib.c @@ -155,7 +155,7 @@ LibInitializeFvStruct ( =20 for (Index =3D 0; Index < MAX_NUMBER_OF_FILES_IN_FV; Index ++) { memset (Fv->FfsAttuibutes[Index].FfsName, '\0', _MAX_PATH); - memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH); + memset (Fv->FfsAttuibutes[Index].UiName, '\0', _MAX_PATH * sizeof (CHA= R16)); memset (&Fv->FfsAttuibutes[Index].GuidName, '\0', sizeof(EFI_GUID)); Fv->FfsAttuibutes[Index].UiNameSize =3D 0; Fv->FfsAttuibutes[Index].IsLeaf =3D TRUE; --=20 2.13.0.windows.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 (#43343): https://edk2.groups.io/g/devel/message/43343 Mute This Topic: https://groups.io/mt/32315476/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-