From: "Zhu, Yonghong" <yonghong.zhu@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
"edk2-devel@ml01.01.org" <edk2-devel@ml01.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>,
"Zhu, Yonghong" <yonghong.zhu@intel.com>
Subject: Re: [PATCH] VfrCompile: fix invalid comparison between pointer and integer
Date: Mon, 13 Feb 2017 13:55:26 +0000 [thread overview]
Message-ID: <B9726D6DCCFB8B4CA276A9169B02216D51E109F8@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20170213125400.27421-1-pbonzini@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]
Hi Paolo Bonzini,
We already had another patch for this issue. Please help to check the attachment. Thanks.
Best Regards,
Zhu Yonghong
-----Original Message-----
From: Paolo Bonzini [mailto:pbonzini@redhat.com]
Sent: Monday, February 13, 2017 8:54 PM
To: edk2-devel@ml01.01.org
Cc: Zhu, Yonghong <yonghong.zhu@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH] VfrCompile: fix invalid comparison between pointer and integer
This would be valid C but is not valid C++, so change the comparison to do what it has always been doing.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
index 3ca57ed..2f97975 100644
--- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
@@ -3372,7 +3372,7 @@ CVfrStringDB::GetVarStoreNameFormStringId (
UINT8 BlockType;
EFI_HII_STRING_PACKAGE_HDR *PkgHeader;
- if (mStringFileName == '\0' ) {
+ if (mStringFileName == NULL) {
return NULL;
}
--
2.9.3
[-- Attachment #2: Type: message/rfc822, Size: 4223 bytes --]
From: "Zhu, Yonghong" <yonghong.zhu@intel.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Nikolai SAOUKH <nms@otdel-1.org>
Subject: [edk2] [Patch] BaseTools: NULL pointer comparison to a char literal should be to NULL
Date: Fri, 10 Feb 2017 09:26:03 +0000
Message-ID: <1486718763-4596-1-git-send-email-yonghong.zhu@intel.com>
From: Nikolai SAOUKH <nms@otdel-1.org>
GCC7 complaint -- error: ISO C++ forbids comparison between pointer and
integer.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nikolai SAOUKH <nms@otdel-1.org>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
index 3ca57ed..b81fc7b 100644
--- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
@@ -3370,11 +3370,11 @@ CVfrStringDB::GetVarStoreNameFormStringId (
EFI_STATUS Status;
CHAR8 LineBuf[EFI_IFR_MAX_LENGTH];
UINT8 BlockType;
EFI_HII_STRING_PACKAGE_HDR *PkgHeader;
- if (mStringFileName == '\0' ) {
+ if (mStringFileName == NULL || *mStringFileName == '\0' ) {
return NULL;
}
if ((pInFile = fopen (LongFilePath (mStringFileName), "rb")) == NULL) {
return NULL;
--
2.6.1.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
next prev parent reply other threads:[~2017-02-13 13:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-13 12:54 [PATCH] VfrCompile: fix invalid comparison between pointer and integer Paolo Bonzini
2017-02-13 13:55 ` Zhu, Yonghong [this message]
2017-02-13 14:18 ` Paolo Bonzini
2017-02-15 8:46 ` Zhu, Yonghong
2017-02-15 9:11 ` Paolo Bonzini
2017-02-16 9:03 ` Zhu, Yonghong
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=B9726D6DCCFB8B4CA276A9169B02216D51E109F8@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