public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zhu, Yonghong" <yonghong.zhu@intel.com>
To: "Feng, YunhuaX" <yunhuax.feng@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>,
	"Zhu, Yonghong" <yonghong.zhu@intel.com>
Subject: Re: [PATCH] BaseTools: Fix GCC build PcdValueCommon.c bug
Date: Fri, 2 Feb 2018 03:21:27 +0000	[thread overview]
Message-ID: <B9726D6DCCFB8B4CA276A9169B02216D51F7F393@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <47C64442C08CCD4089DC43B6B5E46BC4822904@shsmsx102.ccr.corp.intel.com>

Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> 

Best Regards,
Zhu Yonghong

-----Original Message-----
From: Feng, YunhuaX 
Sent: Friday, February 02, 2018 10:34 AM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong <yonghong.zhu@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH] BaseTools: Fix GCC build PcdValueCommon.c bug

error message:
PcdValueCommon.c: In function '__PcdGetPtr':
PcdValueCommon.c:315:11: error: variable 'Byte' 
set but not used [-Werror=unused-but-set-variable]
   UINT8   Byte;
           ^
cc1: all warnings being treated as errors

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1

Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
---
 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;
 
   Index = LookupPcdIndex (SkuName, DefaultValueName, TokenSpaceGuidName, TokenName);
   if (Index < 0) {
     fprintf (stderr, "PCD %s.%s.%s.%s is not in database\n", SkuName, DefaultValueName, TokenSpaceGuidName, TokenName);
     exit (EXIT_FAILURE);
@@ -328,11 +327,11 @@ Returns:
     fprintf (stderr, "PCD %s.%s.%s.%s is a value.  Use PcdGet()\n", SkuName, DefaultValueName, TokenSpaceGuidName, TokenName);
     exit (EXIT_FAILURE);
     break;
   case PcdDataTypePointer:
     Value = &PcdList[Index].Value[1];
-    for (*Size = 0, Byte = (UINT8) strtoul(Value, &End, 16); Value != End; Byte = (UINT8) strtoul(Value, &End, 16), *Size = *Size + 1) {
+    for (*Size = 0, strtoul(Value, &End, 16); Value != End; strtoul(Value, &End, 16), *Size = *Size + 1) {
       Value = End + 1;
     }
     Buffer = malloc(*Size + 1);
     if (Buffer == NULL) {
       *Size = 0;
-- 
2.12.2.windows.2



      reply	other threads:[~2018-02-02  3:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02  2:34 [PATCH] BaseTools: Fix GCC build PcdValueCommon.c bug Feng, YunhuaX
2018-02-02  3:21 ` Zhu, Yonghong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B9726D6DCCFB8B4CA276A9169B02216D51F7F393@SHSMSX103.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox