Skip to content

selftests/bpf: Fix "expression result unused" warnings with icecc

Ilya Leoshkevich bpf 4 versions – Applied

Status from this message: This patch was applied to bpf/bpf.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest1 patch 1 replyApplied 1/1
  2. v32 patches 3 repliesSuperseded
  3. v22 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch14 repliesSuperseded

Patches in v4 All 1 applied

#Subject and filesSizeRepliesApplied
1/1selftests/bpf: Fix "expression result unused" warnings with icecctools/testing/selftests/bpf/progs/bpf_arena_spin_lock.h tools/testing/selftests/bpf/progs/linked_list_fail.c+4 -51 replyApplied

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchYonghong Song
1/1A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH bpf-next v4 0/1] selftests/bpf: Fix "expression result unused" warnings with icecc

v3: https://lore.kernel.org/bpf/[email protected]/
v3 -> v4: Go back to the original solution (Yonghong, Alexei).

v2: https://lore.kernel.org/bpf/[email protected]/
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/[email protected]/
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.

The solution is to add a few awkward (void) casts. I've added a detailed explanation of why they are helpful to the commit message.

Best regards,
Ilya

Ilya Leoshkevich (1):
selftests/bpf: Fix "expression result unused" warnings with icecc

 tools/testing/selftests/bpf/progs/bpf_arena_spin_lock.h | 4 ++--
 tools/testing/selftests/bpf/progs/linked_list_fail.c    | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)
Signature · 1 line
2.51.0