Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20241126103640.27246-1-marcus.haehnel@kernkonzept.com>
Date: Tue, 26 Nov 2024 11:36:18 +0100
From: Marcus Haehnel <marcus.haehnel@...nkonzept.com>
To: musl@...ts.openwall.com
Cc: Marcus Haehnel <marcus.haehnel@...nkonzept.com>
Subject: [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.46.0

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.