File 1160-tools-Fix-clang-warnings.patch of Package erlang

From a8891c0325ecaa215973efce3b1bf7909e53786f Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Mon, 8 Mar 2021 17:01:10 +0100
Subject: [PATCH] tools: Fix clang warnings

* return in noreturn function

* (void) cast not enough to suppress -Wunused-result
---
 erts/etc/common/inet_gethost.c | 6 +++---
 lib/tools/c_src/erl_memory.c   | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c
index 164b773178..0e4ec402ab 100644
--- a/erts/etc/common/inet_gethost.c
+++ b/erts/etc/common/inet_gethost.c
@@ -2586,7 +2586,7 @@ static void debugf(char *format, ...)
 	WriteFile(debug_console_allocated,buff,strlen(buff),&res,NULL);
     }
 #else
-    (void) write(2,buff,strlen(buff));
+    (void)! write(2,buff,strlen(buff));
 #endif
     va_end(ap);
 }
@@ -2608,7 +2608,7 @@ static void warning(char *format, ...)
 	WriteFile(GetStdHandle(STD_ERROR_HANDLE),buff,strlen(buff),&res,NULL);
     }
 #else
-    (void) write(2,buff,strlen(buff));
+    (void)! write(2,buff,strlen(buff));
 #endif
     va_end(ap);
 }
@@ -2630,7 +2630,7 @@ static IMPL_NORETURN__ fatal(char *format, ...)
 	WriteFile(GetStdHandle(STD_ERROR_HANDLE),buff,strlen(buff),&res,NULL);
     }
 #else
-    (void) write(2,buff,strlen(buff));
+    (void)! write(2,buff,strlen(buff));
 #endif
     va_end(ap);
 #ifndef WIN32
diff --git a/lib/tools/c_src/erl_memory.c b/lib/tools/c_src/erl_memory.c
index b5e45e3702..f84be98ed2 100644
--- a/lib/tools/c_src/erl_memory.c
+++ b/lib/tools/c_src/erl_memory.c
@@ -117,13 +117,12 @@ typedef int socklen_t;
 
 /* Our own assert() ... */
 #ifdef DEBUG
-#define ASSERT(A) ((void) ((A) ? 1 : assert_failed(__FILE__, __LINE__, #A)))
+#define ASSERT(A) ((A) ? (void)1 : assert_failed(__FILE__, __LINE__, #A))
 #include <stdio.h>
-__decl_noreturn static int __noreturn assert_failed(char *f, int l, char *a)
+__decl_noreturn static void __noreturn assert_failed(char *f, int l, char *a)
 {
     fprintf(stderr, "%s:%d: Assertion failed: %s\n", f, l, a);
     abort();
-    return 0;
 }
 
 #else
-- 
2.26.2

openSUSE Build Service is sponsored by