[PATCH bpf-next v3 0/2] selftests/bpf: Fix "expression result unused" warnings with icecc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



v2: https://lore.kernel.org/bpf/20250827130519.411700-1-iii@xxxxxxxxxxxxx/
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@xxxxxxxxxxxxx/
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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux