From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 30DE182100 for ; Mon, 13 Feb 2017 05:55:31 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2017 05:55:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,156,1484035200"; d="scan'208";a="43719407" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 13 Feb 2017 05:55:30 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 13 Feb 2017 05:55:29 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 13 Feb 2017 05:55:29 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Mon, 13 Feb 2017 21:55:27 +0800 From: "Zhu, Yonghong" To: Paolo Bonzini , "edk2-devel@ml01.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH] VfrCompile: fix invalid comparison between pointer and integer Thread-Index: AQHShfhHs2KVxYenWkmU9nFgQ9pRCaFm9Iog Date: Mon, 13 Feb 2017 13:55:26 +0000 Message-ID: References: <20170213125400.27421-1-pbonzini@redhat.com> In-Reply-To: <20170213125400.27421-1-pbonzini@redhat.com> Accept-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] VfrCompile: fix invalid comparison between pointer and integer X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 13:55:31 -0000 X-Groupsio-MsgNum: 7442 Content-Language: en-US Content-Type: multipart/mixed; boundary="_002_B9726D6DCCFB8B4CA276A9169B02216D51E109F8SHSMSX103ccrcor_" --_002_B9726D6DCCFB8B4CA276A9169B02216D51E109F8SHSMSX103ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Paolo Bonzini, We already had another patch for this issue. Please help to check the atta= chment. Thanks. Best Regards, Zhu Yonghong -----Original Message----- From: Paolo Bonzini [mailto:pbonzini@redhat.com]=20 Sent: Monday, February 13, 2017 8:54 PM To: edk2-devel@ml01.01.org Cc: Zhu, Yonghong ; Gao, Liming Subject: [PATCH] VfrCompile: fix invalid comparison between pointer and int= eger 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 --- 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/So= urce/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; =20 - if (mStringFileName =3D=3D '\0' ) { + if (mStringFileName =3D=3D NULL) { return NULL; } =20 -- 2.9.3 --_002_B9726D6DCCFB8B4CA276A9169B02216D51E109F8SHSMSX103ccrcor_ Content-Type: message/rfc822 Content-Disposition: attachment; creation-date="Mon, 13 Feb 2017 13:55:24 GMT"; modification-date="Mon, 13 Feb 2017 13:55:24 GMT" Received: from fmsmsx107.amr.corp.intel.com (10.18.124.205) by SHSMSX101.ccr.corp.intel.com (10.239.4.153) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 10 Feb 2017 17:27:20 +0800 Received: from orsmga004.jf.intel.com (10.7.209.38) by FMSMSX107-1.cps.intel.com (10.18.124.205) with Microsoft SMTP Server id 14.3.248.2; Fri, 10 Feb 2017 01:26:22 -0800 Received: from orsmga104.jf.intel.com ([10.7.208.13]) by orsmga004-1.jf.intel.com with ESMTP; 10 Feb 2017 01:26:14 -0800 Received: from ml01.01.org ([198.145.21.10]) by mga06.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Feb 2017 01:26:09 -0800 Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8F91D82081; Fri, 10 Feb 2017 01:26:08 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 D0BCF8207E for ; Fri, 10 Feb 2017 01:26:06 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP; 10 Feb 2017 01:26:06 -0800 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga005.jf.intel.com with ESMTP; 10 Feb 2017 01:26:05 -0800 From: "Zhu, Yonghong" To: "edk2-devel@lists.01.org" CC: Nikolai SAOUKH Subject: [edk2] [Patch] BaseTools: NULL pointer comparison to a char literal should be to NULL Thread-Topic: [edk2] [Patch] BaseTools: NULL pointer comparison to a char literal should be to NULL Thread-Index: AQHSg3/hjE2rZixptU6YyoMFqkeOUA== Sender: edk2-devel Date: Fri, 10 Feb 2017 09:26:03 +0000 Message-ID: <1486718763-4596-1-git-send-email-yonghong.zhu@intel.com> List-Help: List-Subscribe: , List-Unsubscribe: , Content-Language: en-US X-MS-Exchange-Organization-AuthSource: fmsmsx107.amr.corp.intel.com X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-TNEF-Correlator: x-ironport-av: E=Sophos;i="5.35,140,1484035200"; d="scan'208";a="63070698" x-extloop1: 1 delivered-to: edk2-devel@lists.01.org x-ironport-anti-spam-result: A0A5AADdhZ1YmAoVkcZdGgEBAQECAQEBAQgBAQEBFQEBAQECAQEBAQgBAQEBgmWBIwOBBrcmKQuIa1cBAQEBAQEBAQIBEgEBAQEBCAsLCB0vgjMEAgMQB4IYAgQBATcMCh4LAwMBAgYCHyEEBAgDASMBSAWJcwEECbF1Gos+AQEIAQEBAQEBHQWGTIkTfIUZBZBAizKBf4RwhguFGgKKPYZGlGofEx1RhHqBVWiHP1aBZgEBAQ x-ironport-anti-spam-filtered: true list-post: Content-Type: text/plain; charset="us-ascii" Content-ID: <5F87E80FE3821B4D89C44767E096B4BA@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: Nikolai SAOUKH GCC7 complaint -- error: ISO C++ forbids comparison between pointer and integer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nikolai SAOUKH Reviewed-by: Yonghong Zhu --- 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/So= urce/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 =3D=3D '\0' ) { + if (mStringFileName =3D=3D NULL || *mStringFileName =3D=3D '\0' ) { return NULL; } if ((pInFile =3D fopen (LongFilePath (mStringFileName), "rb")) =3D=3D NU= LL) { return NULL; -- 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel --_002_B9726D6DCCFB8B4CA276A9169B02216D51E109F8SHSMSX103ccrcor_--