From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH v2 02/28] clang-tidy: Suppress warning about unchecked error in logfn macro Date: Thu, 29 Sep 2022 13:38:06 +1000 Message-ID: <20220929033832.923149-3-david@gibson.dropbear.id.au> In-Reply-To: <20220929033832.923149-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0971782925272277755==" --===============0971782925272277755== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit clang-tidy complains that we're not checking the result of vfprintf in logfn(). There's not really anything we can do if this fails here, so just suppress the error with a cast to void. Signed-off-by: David Gibson --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index 8d26561..6b86ead 100644 --- a/util.c +++ b/util.c @@ -57,7 +57,7 @@ void name(const char *format, ...) { \ if (setlogmask(0) & LOG_MASK(LOG_DEBUG) || \ setlogmask(0) == LOG_MASK(LOG_EMERG)) { \ va_start(args, format); \ - vfprintf(stderr, format, args); \ + (void)vfprintf(stderr, format, args); \ va_end(args); \ if (format[strlen(format)] != '\n') \ fprintf(stderr, "\n"); \ -- 2.37.3 --===============0971782925272277755==--