Gcc toolchain generates the following warning in signal.c
signal.c:98:26: warning: cast between incompatible function types from ‘void (*)(int, siginfo_t *, void *)’ {aka ‘void (*) (int, struct siginfo *, void *)’} to ‘void (*)(int)’ [-Wcast-function-type] sa->sa_handler = (sighandler_t)sigusr1_handler;
Fix the above by using (void *) as the intermediate typecast.
Signed-off-by: Amit Daniel Kachhap amit.kachhap@arm.com --- tools/testing/selftests/arm64/morello/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/arm64/morello/signal.c b/tools/testing/selftests/arm64/morello/signal.c index 50b1d623bacb..3dcea434275c 100644 --- a/tools/testing/selftests/arm64/morello/signal.c +++ b/tools/testing/selftests/arm64/morello/signal.c @@ -95,7 +95,7 @@ static void sigusr1_handler(int n, siginfo_t *si, static void setup_sigusr1_handler(struct sigaction *sa, int mask_how) { ASSERT_EQ(sigemptyset(&sa->sa_mask), 0); - sa->sa_handler = (sighandler_t)sigusr1_handler; + sa->sa_handler = (sighandler_t)(void *)sigusr1_handler; sa->sa_flags = SA_SIGINFO; ASSERT_EQ(sigaction(SIGUSR1, sa, NULL), 0); ASSERT_EQ(sigaddset(&sa->sa_mask, SIGUSR1), 0); @@ -229,7 +229,7 @@ TEST(test_signal_basic) }; sigaltstack(&ss, 0); sigemptyset(&sa.sa_mask); - sa.sa_handler = (sighandler_t)basic_handler; + sa.sa_handler = (sighandler_t)(void *)basic_handler; sa.sa_flags = SA_SIGINFO | SA_ONSTACK; sigaction(SIGALRM, &sa, NULL); sigaction(SIGILL, &sa, NULL);