[PATCH 3/4] ell: Fix cert_pkcs12_pbkdf() warning under Alpine/clang
Bastien Nocera <[email protected]> Tue, 17 Mar 2026 15:28:56 +0100
| Newsgroups | dev.linux.lists.ell |
|---|---|
| Message-ID | <[email protected]> |
Disable GCC specific warning under clang.
../ell/cert-crypto.c:235:1: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-warning-option]
235 | _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
| ^
<scratch space>:28:25: note: expanded from here
28 | GCC diagnostic ignored "-Wmaybe-uninitialized"
| ^
1 warning generated.
../ell/cert-crypto.c:235:1: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-warning-option]
235 | _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
| ^
<scratch space>:28:25: note: expanded from here
28 | GCC diagnostic ignored "-Wmaybe-uninitialized"
| ^
1 warning generated.
---
ell/cert-crypto.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ell/cert-crypto.c b/ell/cert-crypto.c
index d6babe007d1c..de416050bfb5 100644
--- a/ell/cert-crypto.c
+++ b/ell/cert-crypto.c
@@ -231,8 +231,10 @@ uint8_t *cert_pkcs12_pbkdf(const char *password,
ptr += s_len + salt_len - j;
}
+#if defined(__GNUC__) && !defined(__clang__)
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+#endif /* gcc && !clang */
if (p_len) {
for (j = passwd_len; j < p_len;
j += passwd_len, ptr += passwd_len)
@@ -243,7 +245,9 @@ _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
explicit_bzero(bmpstring, passwd_len);
l_free(bmpstring);
}
+#if defined(__GNUC__) && !defined(__clang__)
_Pragma("GCC diagnostic pop")
+#endif /* gcc && !clang */
key = l_malloc(key_len + hash->len);
--
2.53.0