Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250210103312.21275-2-marcus.haehnel@kernkonzept.com>
Date: Mon, 10 Feb 2025 11:32:42 +0100
From: Marcus Haehnel <marcus.haehnel@...nkonzept.com>
To: musl@...ts.openwall.com
Cc: Marcus Haehnel <marcus.haehnel@...nkonzept.com>
Subject: [RESEND PATCH] Avoid compiler warning for dead code

When compiling with -Wunreachable-code using clang the code after the
return in the __GNUC__ case triggers a warning. Use #else to avoid the
warning since the code is only useful in non __GNUC__ cases.
---
 src/string/memcpy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/string/memcpy.c b/src/string/memcpy.c
index 06e88742..f7a6fcd9 100644
--- a/src/string/memcpy.c
+++ b/src/string/memcpy.c
@@ -117,8 +117,8 @@ void *memcpy(void *restrict dest, const void *restrict src, size_t n)
 		*d = *s;
 	}
 	return dest;
-#endif
-
+#else
 	for (; n; n--) *d++ = *s++;
 	return dest;
+#endif
 }
-- 
2.47.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.