From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 E1F0821E0BA0F for ; Thu, 1 Feb 2018 18:28:50 -0800 (PST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 18:34:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,445,1511856000"; d="dat'59?scan'59,208,59";a="14860496" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga008.fm.intel.com with ESMTP; 01 Feb 2018 18:34:27 -0800 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Feb 2018 18:34:27 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 1 Feb 2018 18:34:26 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.192]) with mapi id 14.03.0319.002; Fri, 2 Feb 2018 10:34:25 +0800 From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" CC: "Zhu, Yonghong" , "Gao, Liming" Thread-Topic: [PATCH] BaseTools: Fix GCC build PcdValueCommon.c bug Thread-Index: AdObzkv61v3wvWlxS5eqDR6Jgg9Hpg== Date: Fri, 2 Feb 2018 02:34:24 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC4822904@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC4822904@shsmsx102.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: [PATCH] BaseTools: Fix GCC build PcdValueCommon.c bug X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Feb 2018 02:28:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable error message: PcdValueCommon.c: In function '__PcdGetPtr': PcdValueCommon.c:315:11: error: variable 'Byte'=20 set but not used [-Werror=3Dunused-but-set-variable] UINT8 Byte; ^ cc1: all warnings being treated as errors Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/C/Common/PcdValueCommon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/BaseTools/Source/C/Common/PcdValueCommon.c b/BaseTools/Source/= C/Common/PcdValueCommon.c index 210f87b8b5..fa12869eda 100644 --- a/BaseTools/Source/C/Common/PcdValueCommon.c +++ b/BaseTools/Source/C/Common/PcdValueCommon.c @@ -310,11 +310,10 @@ Returns: { int Index; CHAR8 *Value; UINT8 *Buffer; CHAR8 *End; - UINT8 Byte; =20 Index =3D LookupPcdIndex (SkuName, DefaultValueName, TokenSpaceGuidName,= TokenName); if (Index < 0) { fprintf (stderr, "PCD %s.%s.%s.%s is not in database\n", SkuName, Defa= ultValueName, TokenSpaceGuidName, TokenName); exit (EXIT_FAILURE); @@ -328,11 +327,11 @@ Returns: fprintf (stderr, "PCD %s.%s.%s.%s is a value. Use PcdGet()\n", SkuNam= e, DefaultValueName, TokenSpaceGuidName, TokenName); exit (EXIT_FAILURE); break; case PcdDataTypePointer: Value =3D &PcdList[Index].Value[1]; - for (*Size =3D 0, Byte =3D (UINT8) strtoul(Value, &End, 16); Value != =3D End; Byte =3D (UINT8) strtoul(Value, &End, 16), *Size =3D *Size + 1) { + for (*Size =3D 0, strtoul(Value, &End, 16); Value !=3D End; strtoul(Va= lue, &End, 16), *Size =3D *Size + 1) { Value =3D End + 1; } Buffer =3D malloc(*Size + 1); if (Buffer =3D=3D NULL) { *Size =3D 0; --=20 2.12.2.windows.2