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.93; helo=mga11.intel.com; envelope-from=qin.long@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 2013F20359A90 for ; Wed, 22 Nov 2017 00:06:24 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 00:10:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,436,1505804400"; d="scan'208";a="5102232" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 22 Nov 2017 00:10:40 -0800 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Nov 2017 00:10:40 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Nov 2017 00:10:40 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Wed, 22 Nov 2017 16:10:38 +0800 From: "Long, Qin" To: Gary Lin , "edk2-devel@lists.01.org" CC: "Ye, Ting" Thread-Topic: [PATCH] CryptoPkg/IntrinsicLib: Fix the warning on memset Thread-Index: AQHTY0yVTY/zQor4DUWcRLfWR8GU/aMgCrmQ Date: Wed, 22 Nov 2017 08:10:37 +0000 Message-ID: References: <20171122044356.10258-1-glin@suse.com> In-Reply-To: <20171122044356.10258-1-glin@suse.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] CryptoPkg/IntrinsicLib: Fix the warning on memset X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 08:06:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Long Qin (Thanks, Gary.=20 I cannot recall why we used "char" instead of "int" here. Obviously, the pr= ototype of CRT memset should use "int"). Best Regards & Thanks, LONG, Qin -----Original Message----- From: Gary Lin [mailto:glin@suse.com]=20 Sent: Wednesday, November 22, 2017 12:44 PM To: edk2-devel@lists.01.org Cc: Long, Qin ; Ye, Ting Subject: [PATCH] CryptoPkg/IntrinsicLib: Fix the warning on memset Gcc issued the warning when compiling CryptoPkg: CryptoPkg/Library/Include/CrtLibSupport.h:135:17: warning: type of 'memset'= does not match original declaration [-Wlto-type-mismatch] void *memset (void *, int, size_t); ^ CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c:27:8: note: type mismatch= in parameter 2 void * memset (void *dest, char ch, size_t count) ^ This commit changes the type of ch from char to int to match the declaratio= n. Cc: Qin Long Cc: Ting Ye Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Gary Lin --- CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c b/CryptoPkg/= Library/IntrinsicLib/MemoryIntrinsics.c index bf485d680d..e095f9aa0d 100644 --- a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c +++ b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c @@ -24,7 +24,7 @@ typedef UINTN size_t; int _fltused =3D 1; =20 /* Sets buffers to a specified character */ -void * memset (void *dest, ch= ar ch, size_t count) +void * memset (void *dest, int ch, size_t count) { // // NOTE: Here we use one base implementation for memset, instead of the = direct @@ -42,7 +42,7 @@ void * memset (void *dest, char ch, size_t count) =20 Pointer =3D (UINT8 *)dest; while (count-- !=3D 0) { - *(Pointer++) =3D ch; + *(Pointer++) =3D (UINT8)ch; } =20 return dest; -- 2.15.0