From ea9358e1270ab2c3ba6f36bd9bdda68617665516 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Sat, 26 Sep 2026 13:38:35 +0200 Subject: [PATCH] selftests/bpf: Fix gcc -Wreturn-type error in the tail call subprog test gcc's C front end warns for a static function returning non-void that has no return statement at all, regardless of the for (;;) {} it ends in, and BPF CI builds test_progs-bpf_gcc with -Werror: progs/verifier_cfg.c: In function 'tail_call_or_throw_subprog': error: no return statement in function returning non-void [-Werror=return-type] Add an unreachable return after the loop. # LDLIBS=-static PKG_CONFIG='pkg-config --static' ./vmtest.sh -- ./test_progs -t verifier_cfg [...] #626/21 verifier_cfg/tail call in a subprogram without an exit:OK #626 verifier_cfg:OK Summary: 1/21 PASSED, 0 SKIPPED, 0/0 FAILED Fixes: 5add2c64f474 ("selftests/bpf: Add a test for a tail call in a subprogram without an exit") Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/r/20260926113835.1193471-1-daniel@iogearbox.net Signed-off-by: Kumar Kartikeya Dwivedi --- tools/testing/selftests/bpf/progs/verifier_cfg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/bpf/progs/verifier_cfg.c b/tools/testing/selftests/bpf/progs/verifier_cfg.c index 07388a922e5b..6379dfc9389b 100644 --- a/tools/testing/selftests/bpf/progs/verifier_cfg.c +++ b/tools/testing/selftests/bpf/progs/verifier_cfg.c @@ -196,6 +196,7 @@ static int tail_call_or_throw_subprog(void *ctx) bpf_tail_call(ctx, &map_array, idx); bpf_throw(0); for (;;) {} + return 0; } SEC("tc")