From: Bastien Nocera <hadess@hadess.net>
To: ell@lists.linux.dev
Cc: Bastien Nocera <hadess@hadess.net>
Subject: [PATCH 2/4] ell: Fix rawmemchr implementation warning in Alpine/clang
Date: Tue, 17 Mar 2026 15:28:55 +0100 [thread overview]
Message-ID: <20260317143018.628844-3-hadess@hadess.net> (raw)
In-Reply-To: <20260317143018.628844-1-hadess@hadess.net>
rawmemchr() is not available under Alpine, it's a glibc function, which
means our local implementation is used. That implementation tried to
disable GCC specific warnings which aren't available under clang, so
disable the pragma statements to disable the warnings when run under
clang.
In file included from ../ell/random.c:20:
../ell/missing.h:61:1: warning: unknown warning group '-Wstringop-overflow=', ignored [-Wunknown-warning-option]
61 | _Pragma("GCC diagnostic ignored \"-Wstringop-overflow=\"")
| ^
<scratch space>:20:25: note: expanded from here
20 | GCC diagnostic ignored "-Wstringop-overflow="
| ^
1 warning generated.
[repeated many times]
---
ell/missing.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ell/missing.h b/ell/missing.h
index b1ee0f147538..5b4f31675361 100644
--- a/ell/missing.h
+++ b/ell/missing.h
@@ -56,9 +56,13 @@ static inline void explicit_bzero(void *s, size_t n)
#ifndef HAVE_RAWMEMCHR
static inline void *rawmemchr(const void *s, int c)
{
+#if defined(__GNUC__) && !defined(__clang__)
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wstringop-overflow=\"")
+#endif /* gcc && !clang */
return memchr(s, c, PTRDIFF_MAX);
+#if defined(__GNUC__) && !defined(__clang__)
_Pragma("GCC diagnostic pop")
+#endif /* gcc && !clang */
}
#endif
--
2.53.0
next prev parent reply other threads:[~2026-03-17 14:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 14:28 [PATCH 0/4] More build fixes Bastien Nocera
2026-03-17 14:28 ` [PATCH 1/4] unit: Fix incorrect basename usage Bastien Nocera
[not found] ` <D98F0DC1-9621-4E61-887A-CCA145F16AFF@bluewin.ch>
2026-03-18 16:17 ` Bastien Nocera
2026-03-17 14:28 ` Bastien Nocera [this message]
2026-03-17 14:28 ` [PATCH 3/4] ell: Fix cert_pkcs12_pbkdf() warning under Alpine/clang Bastien Nocera
2026-03-17 14:28 ` [PATCH 4/4] unit: Skip hwdb test when hwdb isn't available Bastien Nocera
2026-04-16 9:18 ` [PATCH 0/4] More build fixes Bastien Nocera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260317143018.628844-3-hadess@hadess.net \
--to=hadess@hadess.net \
--cc=ell@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox