From: Yonghong Song <yonghong.song@linux.dev>
To: Ilya Leoshkevich <iii@linux.ibm.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>
Cc: bpf@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [PATCH bpf-next v4 1/1] selftests/bpf: Fix "expression result unused" warnings with icecc
Date: Thu, 28 Aug 2025 21:47:13 -0700 [thread overview]
Message-ID: <e008e5d4-8a38-407e-a90b-eb960e6cc4d9@linux.dev> (raw)
In-Reply-To: <20250829030017.102615-2-iii@linux.ibm.com>
On 8/28/25 7:53 PM, Ilya Leoshkevich wrote:
> icecc is a compiler wrapper that distributes compile jobs over a build
> farm [1]. It works by sending toolchain binaries and preprocessed
> source code to remote machines.
>
> Unfortunately using it with BPF selftests causes build failures due to
> a clang bug [2]. The problem is that clang suppresses the
> -Wunused-value warning if the unused expression comes from a macro
> expansion. Since icecc compiles preprocessed source code, this
> information is not available. This leads to -Wunused-value false
> positives.
>
> obj_new_no_struct() and obj_new_acq() use the bpf_obj_new() macro and
> discard the result. arena_spin_lock_slowpath() uses two macros that
> produce values and ignores the results. Add (void) casts to explicitly
> indicate that this is intentional and suppress the warning.
>
> An alternative solution is to change the macros to not produce values.
> This would work today for the arena_spin_lock_slowpath() issue, but in
> the future there may appear users who need them. Another potential
> solution is to replace these macros with functions. Unfortunately this
> would not work, because these macros work with unknown types and
> control flow.
>
> [1] https://github.com/icecc/icecream
> [2] https://github.com/llvm/llvm-project/issues/142614
>
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
next prev parent reply other threads:[~2025-08-29 4:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 2:53 [PATCH bpf-next v4 0/1] selftests/bpf: Fix "expression result unused" warnings with icecc Ilya Leoshkevich
2025-08-29 2:53 ` [PATCH bpf-next v4 1/1] " Ilya Leoshkevich
2025-08-29 4:47 ` Yonghong Song [this message]
2025-08-29 18:30 ` [PATCH bpf-next v4 0/1] " patchwork-bot+netdevbpf
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=e008e5d4-8a38-407e-a90b-eb960e6cc4d9@linux.dev \
--to=yonghong.song@linux.dev \
--cc=agordeev@linux.ibm.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=iii@linux.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).