From: George Thessalonikefs Date: Sun, 4 Jul 2021 13:19:24 +0000 (+0200) Subject: - Fix Wunused-result compile warnings. X-Git-Tag: release-1.13.2rc1~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6fc7adeb181ba134034f6fe4558a544e253a209;p=thirdparty%2Funbound.git - Fix Wunused-result compile warnings. --- diff --git a/dnstap/unbound-dnstap-socket.c b/dnstap/unbound-dnstap-socket.c index 17c29e971..3de8ab3f0 100644 --- a/dnstap/unbound-dnstap-socket.c +++ b/dnstap/unbound-dnstap-socket.c @@ -1171,7 +1171,8 @@ static RETSIGTYPE main_sigh(int sig) char str[] = "exit on signal \n"; str[15] = '0' + (sig/10)%10; str[16] = '0' + sig%10; - write(STDERR_FILENO, str, strlen(str)); + /* simple cast to void will not silence Wunused-result */ + (void)!write(STDERR_FILENO, str, strlen(str)); } if(sig_base) { ub_event_base_loopexit(sig_base); diff --git a/doc/Changelog b/doc/Changelog index 384491920..b8f65cf7a 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +4 July 2021: George + - Fix Wunused-result compile warnings. + 2 July 2021: Tom - Merge PR #491: Add SVCB and HTTPS types and handling according to draft-ietf-dnsop-svcb-https diff --git a/testcode/delayer.c b/testcode/delayer.c index 0c8f2a45d..e915961f5 100644 --- a/testcode/delayer.c +++ b/testcode/delayer.c @@ -350,7 +350,8 @@ static RETSIGTYPE delayer_sigh(int sig) char str[] = "exit on signal \n"; str[15] = '0' + (sig/10)%10; str[16] = '0' + sig%10; - write(STDOUT_FILENO, str, strlen(str)); + /* simple cast to void will not silence Wunused-result */ + (void)!write(STDOUT_FILENO, str, strlen(str)); do_quit = 1; } diff --git a/testcode/streamtcp.c b/testcode/streamtcp.c index 3fbb792e5..2bd076ee5 100644 --- a/testcode/streamtcp.c +++ b/testcode/streamtcp.c @@ -400,12 +400,14 @@ static RETSIGTYPE sigh(int sig) char str[] = "Got unhandled signal \n"; if(sig == SIGPIPE) { char* strpipe = "got SIGPIPE, remote connection gone\n"; - write(STDOUT_FILENO, strpipe, strlen(strpipe)); + /* simple cast to void will not silence Wunused-result */ + (void)!write(STDOUT_FILENO, strpipe, strlen(strpipe)); exit(1); } str[21] = '0' + (sig/10)%10; str[22] = '0' + sig%10; - write(STDOUT_FILENO, str, strlen(str)); + /* simple cast to void will not silence Wunused-result */ + (void)!write(STDOUT_FILENO, str, strlen(str)); exit(1); } #endif /* SIGPIPE */