]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
main: locally disable a gcc warning since !672
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 17 Sep 2018 10:24:36 +0000 (12:24 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 17 Sep 2018 10:24:36 +0000 (12:24 +0200)
I see no use to handle write() return codes in *this* function.

daemon/main.c

index a414b2627c2180cbfe3945e203d266e7de9e52fa..3981c8c9b93864626ffb23da5a90c8c42634ce32 100644 (file)
@@ -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. */