From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id B7A2D38582AE; Fri, 19 Jan 2024 10:52:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7A2D38582AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1705661536; bh=g4O5doTjmW3NWrOAFE5GhdULUjQZ7QSrjRY4TMdtjy0=; h=From:To:Subject:Date:From; b=cZzAD9s3cpzrR2OmUSDtj7NOxZ64keqcTEdUPzPegIugL8sHT2Sf9MKSZ/Yia2Ebr 3GR81ieLeL3mg+1sYLYpb1f8iHV25xeo6S0WiKNwyOdhdsFs7VAMtehqiiXpuNtyHH F+c0wK0Lsl93Y2g9HBXNf10mzTlpeDu4PpLITg/o= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] memccpy: fix pointer assignment X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 29ec33360da9171f1df27ef59ea4576fda4065ff X-Git-Newrev: 422c4f0451ccaff9aa38ee86d5d860f41c7bf9ef Message-Id: <20240119105216.B7A2D38582AE@sourceware.org> Date: Fri, 19 Jan 2024 10:52:15 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D422c4f0451c= caff9aa38ee86d5d860f41c7bf9ef commit 422c4f0451ccaff9aa38ee86d5d860f41c7bf9ef Author: Corinna Vinschen AuthorDate: Fri Jan 19 11:28:11 2024 +0100 Commit: Corinna Vinschen CommitDate: Fri Jan 19 11:51:01 2024 +0100 memccpy: fix pointer assignment =20 The local vars dst and src are unsigned pointers, but two assignments cast their value to signed explicitely. This results in the warning "pointer targets in assignment from =E2=80=98char *=E2=80=99 to =E2=80= =98unsigned char *=E2=80=99 differ in signedness [-Wpointer-sign]" in case of -Wall. =20 Fix the cast. =20 Fixes: d254189b38bb ("2002-07-23 Jeff Johnston ") Signed-off-by: Corinna Vinschen Diff: --- newlib/libc/string/memccpy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newlib/libc/string/memccpy.c b/newlib/libc/string/memccpy.c index 6757cb34cb2d..d6b2f8beabe1 100644 --- a/newlib/libc/string/memccpy.c +++ b/newlib/libc/string/memccpy.c @@ -118,8 +118,8 @@ memccpy (void *__restrict dst0, } =20 /* Pick up any residual with a byte copier. */ - dst =3D (char*)aligned_dst; - src =3D (char*)aligned_src; + dst =3D (unsigned char*)aligned_dst; + src =3D (unsigned char*)aligned_src; } =20 while (len0--)