File 0762-erts-Silence-harmless-compiler-warnings.patch of Package erlang
From f12067111a6c6d9006a05ff4d3e5192529058946 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Wed, 26 May 2021 18:09:17 +0200
Subject: [PATCH 2/2] erts: Silence harmless compiler warnings
---
erts/emulator/sys/unix/erl_unix_sys_ddll.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/erts/emulator/sys/unix/erl_unix_sys_ddll.c b/erts/emulator/sys/unix/erl_unix_sys_ddll.c
index 60fc371cd7..82af28385b 100644
--- a/erts/emulator/sys/unix/erl_unix_sys_ddll.c
+++ b/erts/emulator/sys/unix/erl_unix_sys_ddll.c
@@ -188,12 +188,13 @@ int erts_sys_ddll_sym2(void *handle, const char *func_name, void **function,
int erts_sys_ddll_load_driver_init(void *handle, void **function)
{
- void *fn;
+ void *fn = NULL;
int res;
if ((res = erts_sys_ddll_sym2(handle, "driver_init", &fn, NULL)) != ERL_DE_NO_ERROR) {
res = erts_sys_ddll_sym2(handle, "_driver_init", &fn, NULL);
}
if (res == ERL_DE_NO_ERROR) {
+ ASSERT(fn);
*function = fn;
}
return res;
@@ -201,12 +202,13 @@ int erts_sys_ddll_load_driver_init(void *handle, void **function)
int erts_sys_ddll_load_nif_init(void *handle, void **function, ErtsSysDdllError* err)
{
- void *fn;
+ void *fn = NULL;
int res;
if ((res = erts_sys_ddll_sym2(handle, "nif_init", &fn, err)) != ERL_DE_NO_ERROR) {
res = erts_sys_ddll_sym2(handle, "_nif_init", &fn, err);
}
if (res == ERL_DE_NO_ERROR) {
+ ASSERT(fn);
*function = fn;
}
return res;
--
2.26.2