bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v3 0/2] selftests/bpf: Fix "expression result unused" warnings with icecc
@ 2025-08-27 19:46 Ilya Leoshkevich
  2025-08-27 19:46 ` [PATCH bpf-next v3 1/2] selftests/bpf: Annotate bpf_obj_new_impl() with __must_check Ilya Leoshkevich
  2025-08-27 19:46 ` [PATCH bpf-next v3 2/2] selftests/bpf: Fix "expression result unused" warnings with icecc Ilya Leoshkevich
  0 siblings, 2 replies; 6+ messages in thread
From: Ilya Leoshkevich @ 2025-08-27 19:46 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: bpf, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Ilya Leoshkevich

v2: https://lore.kernel.org/bpf/20250827130519.411700-1-iii@linux.ibm.com/
v2 -> v3: Do not touch libbpf, explain how having two function
          declarations works (Andrii).
          Fix bpf-gcc build (CI).

v1: https://lore.kernel.org/bpf/20250508113804.304665-1-iii@linux.ibm.com/
v1 -> v2: Annotate bpf_obj_new_impl() with __must_check (Alexei).
          Add an explanation about icecc.

Hi,

I took another look at the "expression result unused" warnings I've
been seeing, and it turned out that the root cause was the icecc
compiler wrapper and what I consider a clang bug. Back then I've
reported that the problem was reproducible with plain clang, but now
I see that it was clearly a mixup, sorry about that.

In this series I implement Alexei's suggestion to annotate
bpf_obj_new_impl() with __must_check and add (void) casts to the
respective testcase.

There remain two awkward (void) casts and I'm not sure if I can somehow
make them look nicer. But I've added a detailed explanation how they
are helpful to the commit message.

Best regards,
Ilya


Ilya Leoshkevich (2):
  selftests/bpf: Annotate bpf_obj_new_impl() with __must_check
  selftests/bpf: Fix "expression result unused" warnings with icecc

 .../testing/selftests/bpf/bpf_experimental.h  |  6 ++++-
 .../selftests/bpf/progs/bpf_arena_spin_lock.h |  4 ++--
 .../selftests/bpf/progs/linked_list_fail.c    | 23 +++++++++++++++----
 3 files changed, 26 insertions(+), 7 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-28  0:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-27 19:46 [PATCH bpf-next v3 0/2] selftests/bpf: Fix "expression result unused" warnings with icecc Ilya Leoshkevich
2025-08-27 19:46 ` [PATCH bpf-next v3 1/2] selftests/bpf: Annotate bpf_obj_new_impl() with __must_check Ilya Leoshkevich
2025-08-27 21:37   ` Yonghong Song
2025-08-28  0:50     ` Alexei Starovoitov
2025-08-27 19:46 ` [PATCH bpf-next v3 2/2] selftests/bpf: Fix "expression result unused" warnings with icecc Ilya Leoshkevich
2025-08-27 21:46   ` Yonghong Song

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).