[newlib-cygwin/main] libc: string: Fix warning in memrchr.c

Corinna Vinschen corinna@sourceware.org
Mon Mar 23 08:51:22 GMT 2026


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

commit 61360fd1e58ce6529b2145d36403029456b9f559
Author:     Terraneo Federico <fede.tft@miosix.org>
AuthorDate: Sun Mar 22 12:12:19 2026 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Mon Mar 23 09:48:19 2026 +0100

    libc: string: Fix warning in memrchr.c

Diff:
---
 newlib/libc/string/local.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/string/local.h b/newlib/libc/string/local.h
index 8cb43f8e3418..012a30d16ca0 100644
--- a/newlib/libc/string/local.h
+++ b/newlib/libc/string/local.h
@@ -21,7 +21,7 @@ int __wcwidth (wint_t);
  * This macro is used to skip a few bytes to find an aligned pointer.
  * It's better to keep it as is even if _HAVE_HW_MISALIGNED_ACCESS is enabled,
  * to avoid small performance penalties (if they are not zero).  */
-#define UNALIGNED_X(X) ((long)X & (sizeof (long) - 1))
+#define UNALIGNED_X(X) ((long)(X) & (sizeof (long) - 1))
 
 #ifdef _HAVE_HW_MISALIGNED_ACCESS
 /* Hardware performs unaligned operations with little


More information about the Newlib-cvs mailing list