bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] bcopy: fix signature


From: Grisha Levit
Subject: [PATCH] bcopy: fix signature
Date: Tue, 14 Oct 2025 22:40:17 -0400

On Android, bcopy is a function-like macro so we get this warning:

lib/sh/oslib.c:164:1: warning: incompatible redeclaration of library function 
'bcopy' [-Wincompatible-library-redeclaration]
  164 | bcopy (void *s, void *d, size_t n)
      | ^
lib/sh/oslib.c:164:1: note: 'bcopy' is a builtin with type 'void (const void *, 
void *, unsigned long)'

I'm not sure this code is needed at all. We provide this definition if
HAVE_BCOPY is not defined but no declaration in our headers. But in any
case, should use the POSIX signature if we are going to keep it.
---
 lib/sh/oslib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/sh/oslib.c b/lib/sh/oslib.c
index 3cb39808..f24bb879 100644
--- a/lib/sh/oslib.c
+++ b/lib/sh/oslib.c
@@ -161,7 +161,7 @@ getdtablesize (void)
 #    undef bcopy
 #  endif
 void
-bcopy (void *s, void *d, size_t n)
+bcopy (const void *s, void *d, size_t n)
 {
   FASTCOPY (s, d, n);
 }
-- 
2.51.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]