From 7508c9cda0b841eeaa657e34f2cfae2cdf3715d2 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 23 Aug 2022 07:44:05 +0200 Subject: [PATCH] Add format check macro to printf-style functions --- cmirror.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmirror.c b/cmirror.c index 1e1f5d5..5e6b97b 100644 --- a/cmirror.c +++ b/cmirror.c @@ -36,7 +36,7 @@ static const char *log_prefix; static int noisy_abort; -static void warn(const char *restrict fmt, ...) { +static G_GNUC_PRINTF(1, 2) void warn(const char *restrict fmt, ...) { if (log_prefix) fprintf(stderr, "%s: ", log_prefix); va_list ap; @@ -45,7 +45,7 @@ static void warn(const char *restrict fmt, ...) { va_end(ap); } -static G_NORETURN void die(const char *restrict fmt, ...) { +static G_NORETURN G_GNUC_PRINTF(1, 2) void die(const char *restrict fmt, ...) { if (fmt) { if (log_prefix) fprintf(stderr, "%s: ", log_prefix);