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.

Fixes: fdf4eb632683b ("selftests/rseq: Validate legacy behavior")
Assisted-by: LLM
Signed-off-by: Sasha Levin <[email protected]>
---
 tools/testing/selftests/rseq/legacy_check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/rseq/legacy_check.c 
b/tools/testing/selftests/rseq/legacy_check.c
index 3f7de4e283033..b59c4cb874ea1 100644
--- a/tools/testing/selftests/rseq/legacy_check.c
+++ b/tools/testing/selftests/rseq/legacy_check.c
@@ -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)
-- 
2.53.0


Reply via email to