public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] memccpy: fix pointer assignment
@ 2024-01-19 10:52 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2024-01-19 10:52 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=422c4f0451ccaff9aa38ee86d5d860f41c7bf9ef

commit 422c4f0451ccaff9aa38ee86d5d860f41c7bf9ef
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Fri Jan 19 11:28:11 2024 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Fri Jan 19 11:51:01 2024 +0100

    memccpy: fix pointer assignment
    
    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 ‘char *’ to ‘unsigned char *’
    differ in signedness [-Wpointer-sign]" in case of -Wall.
    
    Fix the cast.
    
    Fixes: d254189b38bb ("2002-07-23  Jeff Johnston  <jjohnstn@redhat.com>")
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

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,
         }
 
        /* Pick up any residual with a byte copier.  */
-      dst = (char*)aligned_dst;
-      src = (char*)aligned_src;
+      dst = (unsigned char*)aligned_dst;
+      src = (unsigned char*)aligned_src;
     }
 
   while (len0--)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-19 10:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-19 10:52 [newlib-cygwin/main] memccpy: fix pointer assignment Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).