From ea75960d6c5cae773d4d990d4ed8f87b48e356c4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 18 Jun 2021 16:35:33 +0200 Subject: [PATCH] findmnt: add __format__ attribute Reported-by: Jan Pazdziora Signed-off-by: Karel Zak --- misc-utils/findmnt-verify.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/misc-utils/findmnt-verify.c b/misc-utils/findmnt-verify.c index 2ef7ecff32..164c6589ba 100644 --- a/misc-utils/findmnt-verify.c +++ b/misc-utils/findmnt-verify.c @@ -32,7 +32,8 @@ struct verify_context { no_fsck : 1; }; -static void verify_mesg(struct verify_context *vfy, char type, const char *fmt, va_list ap) +static void __attribute__ ((__format__ (__printf__, 3, 0))) + verify_mesg(struct verify_context *vfy, char type, const char *fmt, va_list ap) { if (!vfy->target_printed) { fprintf(stdout, "%s\n", mnt_fs_get_target(vfy->fs)); @@ -44,7 +45,8 @@ static void verify_mesg(struct verify_context *vfy, char type, const char *fmt, fputc('\n', stdout); } -static int verify_warn(struct verify_context *vfy, const char *fmt, ...) +static int __attribute__ ((__format__ (__printf__, 2, 3))) + verify_warn(struct verify_context *vfy, const char *fmt, ...) { va_list ap; vfy->nwarnings++; @@ -54,7 +56,8 @@ static int verify_warn(struct verify_context *vfy, const char *fmt, ...) return 0; } -static int verify_err(struct verify_context *vfy, const char *fmt, ...) +static int __attribute__ ((__format__ (__printf__, 2, 3))) + verify_err(struct verify_context *vfy, const char *fmt, ...) { va_list ap; vfy->nerrors++; @@ -64,7 +67,8 @@ static int verify_err(struct verify_context *vfy, const char *fmt, ...) return 0; } -static int verify_ok(struct verify_context *vfy __attribute__((unused)), +static int __attribute__ ((__format__ (__printf__, 2, 3))) + verify_ok(struct verify_context *vfy __attribute__((unused)), const char *fmt, ...) { va_list ap; -- 2.47.2