selftests/rseq: avoid an ordered comparison of function pointers
Subsystems (2)
PATCH 1/1 selftests/rseq: avoid an ordered comparison of function pointers
ASSERT_NE() compares its arguments with the relational operators when printing a failure, which clang flags for function pointers:
legacy_check.c:41:2: warning: ordered comparison of function pointers [-Wordered-compare-function-pointers]
Check the result of signal() with ASSERT_TRUE() instead.
--- tools/testing/selftests/rseq/legacy_check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rseq/legacy_check.c +1 -1
@@ -38,7 +38,7 @@ FIXTURE_SETUP(legacy)ASSERT_EQ (res,0 ); } -ASSERT_NE (signal (SIGUSR1 , sigfn),SIG_ERR ); +ASSERT_TRUE (signal (SIGUSR1 , sigfn) !=SIG_ERR ); }FIXTURE_TEARDOWN (legacy)
Signature · 1 line
2.53.0
[tip: core/rseq] selftests/rseq: Avoid an ordered comparison of function pointers
The following commit has been merged into the core/rseq branch of tip:
The following commit has been merged into the core/rseq branch of tip:
Commit-ID: f99b08f3e685e6276ea899a51f00d0d1f2cad4ca Gitweb: https://git.kernel.org/tip/f99b08f3e685e6276ea899a51f00d0d1f2cad4ca Author: Sasha Levin <[email protected]> AuthorDate: Sun, 11 Oct 2026 18:33:36 -04:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Sun, 08 Nov 2026 13:41:53 +01:00
selftests/rseq: Avoid an ordered comparison of function pointers
ASSERT_NE() compares its arguments with the relational operators when printing a failure, which clang flags for function pointers:
legacy_check.c:41:2: warning: ordered comparison of function pointers [-Wordered-compare-function-pointers]
Check the result of signal() with ASSERT_TRUE() instead.
--- tools/testing/selftests/rseq/legacy_check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rseq/legacy_check.c +1 -1
@@ -38,7 +38,7 @@ FIXTURE_SETUP(legacy)ASSERT_EQ (res,0 ); } -ASSERT_NE (signal (SIGUSR1 , sigfn),SIG_ERR ); +ASSERT_TRUE (signal (SIGUSR1 , sigfn) !=SIG_ERR ); }FIXTURE_TEARDOWN (legacy)