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.43; helo=mga05.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 60F9421CB2E54 for ; Mon, 1 Jan 2018 19:28:46 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jan 2018 19:33:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,494,1508828400"; d="scan'208";a="20649591" Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.175]) by orsmga001.jf.intel.com with ESMTP; 01 Jan 2018 19:33:46 -0800 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Michael Kinney , Wu Jiaxin Date: Tue, 2 Jan 2018 11:33:45 +0800 Message-Id: <1514864025-12536-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [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, 02 Jan 2018 03:28:46 -0000 This patch is to fix the compiler warning error: C4245. The issue will happen if the below build option is enabled: *_*_*_CC_FLAGS = -J. 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 -= ('A' - 'a'); The above issue is also recorded at: https://bugzilla.tianocore.org/show_bug.cgi?id=815. 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(-) 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 != '\0')) { Src = *String; Dst = *SearchStringTmp; if ((Src >= 'A') && (Src <= 'Z')) { - Src -= ('A' - 'a'); + Src += ('a' - 'A'); } if ((Dst >= 'A') && (Dst <= 'Z')) { - Dst -= ('A' - 'a'); + Dst += ('a' - 'A'); } if (Src != Dst) { break; } -- 1.9.5.msysgit.1