Re: [PATCH v2] selftests: harness: Mark test fixture objects __maybe_unused
From: Kuniyuki Iwashima
Date: Mon Jul 06 2026 - 14:09:38 EST
On Mon, Jul 6, 2026 at 10:52 AM David Matlack <dmatlack@xxxxxxxxxx> wrote:
>
> Mark global test fixture object pointers __maybe_unused since they may
> not ever be read (e.g. if fixture variants are used instead).
Not very accurate; using fixtures w/ XFAIL_ADD() does not trigger
the warning.
>
> clang made a change to -Wunused-but-set-variable (split out into its own
> subwarning, -Wunused-but-set-global) that causes this warning to be
> emitted for various selftests and can be upgraded to an error in
> selftest that set -Werror.
>
> VFIO selftests have been broken since commit ff556bd98348 ("vfio:
> selftests: Add -Wall and -Werror to the Makefile"), and the net
> selftests builds have been noisy due to -Wall.
>
> Fixes: 24cf65a62266 ("selftests/harness: Share _metadata between forked processes")
> Reported-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
> Reported-by: Aaron Lewis <aaronlewis@xxxxxxxxxx>
> Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx>
Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
Not sure why Shuah didn't pick my patch though :/
https://lore.kernel.org/all/20260530054722.271157-1-kuniyu@xxxxxxxxxx/