Re: [PATCH v3] selftests: harness: Mark test fixture objects __maybe_unused
David Matlack <[email protected]>
| Newsgroups | dev.linux.lists.llvm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest |
|---|---|
| Message-ID | <CALzav=f3KaNQd2NgCTxU=VSXWujV+qjyQuNJp_hy1-U36RMPpg@mail.gmail.com> |
On Mon, Jul 6, 2026 at 11:32 AM David Matlack <[email protected]> wrote: > > Mark _##fixture_name##_##test_name##_object __maybe_unused since it may > not ever be read. This pointer is only read in XFAIL_ADD(), which tests > are not required to use. > > 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 <[email protected]> > Reported-by: Aaron Lewis <[email protected]> > Reviewed-by: Alex Williamson <[email protected]> > Reviewed-by: Kuniyuki Iwashima <[email protected]> > Signed-off-by: David Matlack <[email protected]> Kees and Shuah, is it ok if Alex takes this through the VFIO tree? [1] This fixes a bug exposed by recent VFIO selftests commit ff556bd98348 ("vfio: selftests: Add -Wall and -Werror to the Makefile"). [1] https://lore.kernel.org/linux-kselftest/[email protected]/