bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: 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>,
	Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH bpf-next v3 0/2] selftests/bpf: Fix "expression result unused" warnings with icecc
Date: Wed, 27 Aug 2025 21:46:44 +0200	[thread overview]
Message-ID: <20250827194929.416969-1-iii@linux.ibm.com> (raw)

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


             reply	other threads:[~2025-08-27 19:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 19:46 Ilya Leoshkevich [this message]
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

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=20250827194929.416969-1-iii@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --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 \
    /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).