From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 952182035D32C for ; Mon, 8 Jan 2018 17:12:45 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 17:17:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,333,1511856000"; d="scan'208";a="8181503" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga007.fm.intel.com with ESMTP; 08 Jan 2018 17:17:54 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 17:17:54 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 17:17:54 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Tue, 9 Jan 2018 09:17:52 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Kinney, Michael D" Thread-Topic: [Patch] NetworkPkg/HttpDxe: Fix build warning error if CHAR8 is unsigned. Thread-Index: AQHTg3qB2gFPRdeU1Ue95cYWUWhHF6NqyFmA Date: Tue, 9 Jan 2018 01:17:52 +0000 Message-ID: References: <1514864025-12536-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1514864025-12536-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjQ3MzVmNzctNzM2OC00NGIxLTk5MjEtNDI1Nzc0MGZmOGI5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJuMkhvSjRDNHU0ZEpQZzU5QmhEeE1BV3NCQkpza0RMSXhYenNOVmdBWmgyN0IralpVb2JFdHFxVnJTS0RvQUtjIn0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg/HttpDxe: Fix build warning error if CHAR8 is unsigned. 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: Tue, 09 Jan 2018 01:12:46 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: Wu, Jiaxin > Sent: Tuesday, January 2, 2018 11:34 AM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Kinne= y, > Michael D ; Wu, Jiaxin > Subject: [Patch] NetworkPkg/HttpDxe: Fix build warning error if CHAR8 is > unsigned. >=20 > This patch is to fix the compiler warning error: C4245. The issue will > happen > if the below build option is enabled: > *_*_*_CC_FLAGS =3D -J. >=20 > That's because the value of ('A' - 'a') is a negative value, which will > be converted to an unsigned type if CHAR8 is treated as unsigned: > Src -=3D ('A' - 'a'); >=20 > The above issue is also recorded at: > https://bugzilla.tianocore.org/show_bug.cgi?id=3D815. >=20 > Cc: Ye Ting > Cc: Fu Siyuan > Cc: Michael Kinney > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wu Jiaxin > --- > NetworkPkg/HttpDxe/HttpsSupport.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c > b/NetworkPkg/HttpDxe/HttpsSupport.c > index e6f4d5a..6aed61a 100644 > --- a/NetworkPkg/HttpDxe/HttpsSupport.c > +++ b/NetworkPkg/HttpDxe/HttpsSupport.c > @@ -65,15 +65,15 @@ AsciiStrCaseStr ( > && (*String !=3D '\0')) { > Src =3D *String; > Dst =3D *SearchStringTmp; >=20 > if ((Src >=3D 'A') && (Src <=3D 'Z')) { > - Src -=3D ('A' - 'a'); > + Src +=3D ('a' - 'A'); > } >=20 > if ((Dst >=3D 'A') && (Dst <=3D 'Z')) { > - Dst -=3D ('A' - 'a'); > + Dst +=3D ('a' - 'A'); > } >=20 > if (Src !=3D Dst) { > break; > } > -- > 1.9.5.msysgit.1