From 73908f1218e190861be5b1f1d7f3bdac55cedfe3 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sat, 31 Aug 2024 13:16:51 -0500 Subject: [PATCH] fish_test_helper: Fix warnings about intentionally unused results Warnings were appearing under GCC 13.2 (void) alone is insufficient under modern compilers, workaround with logical negation taken from GCC bug tracker. --- src/fish_test_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fish_test_helper.c b/src/fish_test_helper.c index 675f873b7..f1af29447 100644 --- a/src/fish_test_helper.c +++ b/src/fish_test_helper.c @@ -162,11 +162,11 @@ static void print_ignored_signals() { } static void sigtstp_handler(int x) { - write(STDOUT_FILENO, "SIGTSTP\n", strlen("SIGTSTP\n")); + (void)!write(STDOUT_FILENO, "SIGTSTP\n", strlen("SIGTSTP\n")); kill(getpid(), SIGSTOP); } static void sigcont_handler(int x) { - write(STDOUT_FILENO, "SIGCONT\n", strlen("SIGCONT\n")); + (void)!write(STDOUT_FILENO, "SIGCONT\n", strlen("SIGCONT\n")); } static void print_stop_cont() { signal(SIGTSTP, &sigtstp_handler);