LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0470-crypto-Fix-gcc-8-warning.patch of Package erlang (Project home:Ledest:erlang:20)

From d8c407e2baede7654a580250a08f58d5f1662bcc Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Mon, 5 Nov 2018 16:51:05 +0100
Subject: [PATCH] crypto: Fix gcc 8 warning

"division 'sizeof (...)' does not compute the number of array elements
[-Wsizeof-pointer-div]"
---
 lib/crypto/c_src/crypto_callback.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/crypto/c_src/crypto_callback.c b/lib/crypto/c_src/crypto_callback.c
index 23d2bed057..0cc7dd609d 100644
--- a/lib/crypto/c_src/crypto_callback.c
+++ b/lib/crypto/c_src/crypto_callback.c
@@ -179,6 +179,10 @@ DLLEXPORT struct crypto_callbacks* get_crypto_callbacks(int nlocks)
 /* This is not really a NIF library, but we use ERL_NIF_INIT in order to
  * get access to the erl_nif API (on Windows).
  */
-ERL_NIF_INIT(dummy, (ErlNifFunc*)NULL , NULL, NULL, NULL, NULL)
+static struct {
+    int dummy__;
+    ErlNifFunc funcv[0];
+} empty;
+ERL_NIF_INIT(dummy, empty.funcv, NULL, NULL, NULL, NULL)
 #endif
 
-- 
2.16.4