From: Vladimír Čunát Date: Mon, 17 Sep 2018 10:24:36 +0000 (+0200) Subject: main: locally disable a gcc warning since !672 X-Git-Tag: v3.1.0~13^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f41ae54333e7bb2dee4e773005a32f0b182df445;p=thirdparty%2Fknot-resolver.git main: locally disable a gcc warning since !672 I see no use to handle write() return codes in *this* function. --- diff --git a/daemon/main.c b/daemon/main.c index a414b2627..3981c8c9b 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -311,6 +311,9 @@ static void sigbus_handler(int sig, siginfo_t *siginfo, void *ptr) */ #define WRITE_ERR(err_charray) \ (void)write(STDERR_FILENO, err_charray, sizeof(err_charray)) + /* Unfortunately, void-cast on the write isn't enough to avoid the warning. */ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-result" const char msg_typical[] = "\nSIGBUS received; this is most likely due to filling up the filesystem where cache resides.\n", msg_unknown[] = "\nSIGBUS received, cause unknown.\n", @@ -332,6 +335,7 @@ end: WRITE_ERR(msg_final); _exit(128 - sig); /*< regular return from OS-raised SIGBUS can't work anyway */ #undef WRITE_ERR + #pragma GCC diagnostic pop } /** Split away port from the address. */