File 0723-erts-Silence-CodeChecker-for-FD_ZERO.patch of Package erlang

From 051d62764001510f3897de41b4f388ae7b7db206 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Fri, 19 Feb 2021 21:12:21 +0100
Subject: [PATCH 03/10] erts: Silence CodeChecker for FD_ZERO

---
 erts/emulator/sys/unix/erl_child_setup.c | 6 ++++++
 erts/epmd/src/epmd_srv.c                 | 6 ++++++
 erts/etc/common/heart.c                  | 6 ++++++
 erts/etc/common/inet_gethost.c           | 6 ++++++
 erts/etc/unix/run_erl.c                  | 6 ++++++
 erts/etc/unix/to_erl.c                   | 6 ++++++
 6 files changed, 36 insertions(+)

diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
index 28366964ac..bbe3bb1a60 100644
--- a/erts/epmd/src/epmd_srv.c
+++ b/erts/epmd/src/epmd_srv.c
@@ -26,6 +26,12 @@
 #include "epmd_int.h"
 #include "erl_printf.h" /* erts_snprintf */
 
+#ifdef __clang_analyzer__
+   /* CodeChecker does not seem to understand inline asm in FD_ZERO */
+#  undef FD_ZERO
+#  define FD_ZERO(FD_SET_PTR) memset(FD_SET_PTR, 0, sizeof(fd_set))
+#endif
+
 #ifndef INADDR_NONE
 #  define INADDR_NONE 0xffffffff
 #endif
diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c
index db4e2cfd24..404b5fa52e 100644
--- a/erts/etc/common/heart.c
+++ b/erts/etc/common/heart.c
@@ -113,6 +113,12 @@
 #  endif
 #endif
 
+#ifdef __clang_analyzer__
+   /* CodeChecker does not seem to understand inline asm in FD_ZERO */
+#  undef FD_ZERO
+#  define FD_ZERO(FD_SET_PTR) memset(FD_SET_PTR, 0, sizeof(fd_set))
+#endif
+
 #define HEART_COMMAND_ENV          "HEART_COMMAND"
 #define ERL_CRASH_DUMP_SECONDS_ENV "ERL_CRASH_DUMP_SECONDS"
 #define HEART_KILL_SIGNAL          "HEART_KILL_SIGNAL"
diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c
index 3814cc3387..13b44ed0aa 100644
--- a/erts/etc/common/inet_gethost.c
+++ b/erts/etc/common/inet_gethost.c
@@ -93,6 +93,12 @@
 #endif
 #include <sys/times.h>
 
+#ifdef __clang_analyzer__
+   /* CodeChecker does not seem to understand inline asm in FD_ZERO */
+#  undef FD_ZERO
+#  define FD_ZERO(FD_SET_PTR) memset(FD_SET_PTR, 0, sizeof(fd_set))
+#endif
+
 #ifndef RETSIGTYPE
 #define RETSIGTYPE void
 #endif
diff --git a/erts/etc/unix/run_erl.c b/erts/etc/unix/run_erl.c
index f8d48a8b9d..8731f54be4 100644
--- a/erts/etc/unix/run_erl.c
+++ b/erts/etc/unix/run_erl.c
@@ -91,6 +91,12 @@
 #  include <stropts.h>
 #endif
 
+#ifdef __clang_analyzer__
+   /* CodeChecker does not seem to understand inline asm in FD_ZERO */
+#  undef FD_ZERO
+#  define FD_ZERO(FD_SET_PTR) memset(FD_SET_PTR, 0, sizeof(fd_set))
+#endif
+
 #include "run_erl.h"
 #include "safe_string.h"    /* sn_printf, strn_cpy, strn_cat, etc */
 
diff --git a/erts/etc/unix/to_erl.c b/erts/etc/unix/to_erl.c
index a1a0fde0a2..17b6cfa98b 100644
--- a/erts/etc/unix/to_erl.c
+++ b/erts/etc/unix/to_erl.c
@@ -61,6 +61,12 @@
 #include "run_erl.h"
 #include "safe_string.h"   /* strn_cpy, strn_catf, sn_printf, etc. */
 
+#ifdef __clang_analyzer__
+   /* CodeChecker does not seem to understand inline asm in FD_ZERO */
+#  undef FD_ZERO
+#  define FD_ZERO(FD_SET_PTR) memset(FD_SET_PTR, 0, sizeof(fd_set))
+#endif
+
 #if defined(O_NONBLOCK)
 # define DONT_BLOCK_PLEASE O_NONBLOCK
 #else
-- 
2.26.2

openSUSE Build Service is sponsored by