diff --git a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c index 2094a567..87583dc1 100644 --- a/ntfsprogs/mkntfs.c +++ b/ntfsprogs/mkntfs.c @@ -212,6 +212,7 @@ struct { /** * Dprintf - debugging output (-vv); overriden by quiet (-q) */ +static void Dprintf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); static void Dprintf(const char *fmt, ...) { va_list ap; @@ -247,7 +248,9 @@ GEN_PRINTF(Qprintf, stdout, &opts.quiet, FALSE) /** * err_exit - error output and terminate; ignores quiet (-q) */ -static void err_exit(const char *fmt, ...) __attribute__((noreturn)); +static void err_exit(const char *fmt, ...) + __attribute__((noreturn)) + __attribute__((format(printf, 1, 2))); static void err_exit(const char *fmt, ...) { va_list ap; diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index fd795939..0cc3d3a0 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -142,7 +142,8 @@ GEN_PRINTF(Vprintf, msg_out, &opt.verbose, TRUE) GEN_PRINTF(Qprintf, msg_out, &opt.quiet, FALSE) static GEN_PRINTF(Printf, msg_out, NULL, FALSE) - +static void perr_printf(const char *fmt, ...) + __attribute__((format(printf, 1, 2))); static void perr_printf(const char *fmt, ...) { va_list ap; @@ -156,6 +157,8 @@ static void perr_printf(const char *fmt, ...) fflush(msg_out); } +static void err_printf(const char *fmt, ...) + __attribute__((format(printf, 1, 2))); static void err_printf(const char *fmt, ...) { va_list ap; @@ -167,6 +170,9 @@ static void err_printf(const char *fmt, ...) fflush(msg_out); } +static int err_exit(const char *fmt, ...) + __attribute__((noreturn)) + __attribute__((format(printf, 1, 2))); static int err_exit(const char *fmt, ...) { va_list ap; @@ -179,7 +185,9 @@ static int err_exit(const char *fmt, ...) exit(1); } - +static int perr_exit(const char *fmt, ...) + __attribute__((noreturn)) + __attribute__((format(printf, 1, 2))); static int perr_exit(const char *fmt, ...) { va_list ap; @@ -195,6 +203,7 @@ static int perr_exit(const char *fmt, ...) } +static void usage(void) __attribute__((noreturn)); static void usage(void) { Eprintf("\nUsage: %s [options] source\n" diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index 6b1e8edb..430fca67 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -178,6 +178,8 @@ static s64 rounded_up_division(s64 numer, s64 denom) * * Print an error message. */ +static void perr_printf(const char *fmt, ...) + __attribute__((format(printf, 1, 2))); static void perr_printf(const char *fmt, ...) { va_list ap; @@ -192,6 +194,8 @@ static void perr_printf(const char *fmt, ...) fflush(stderr); } +static void err_printf(const char *fmt, ...) + __attribute__((format(printf, 1, 2))); static void err_printf(const char *fmt, ...) { va_list ap; @@ -209,6 +213,9 @@ static void err_printf(const char *fmt, ...) * * Print and error message and exit the program. */ +static int err_exit(const char *fmt, ...) + __attribute__((noreturn)) + __attribute__((format(printf, 1, 2))); static int err_exit(const char *fmt, ...) { va_list ap; @@ -227,6 +234,9 @@ static int err_exit(const char *fmt, ...) * * Print and error message and exit the program */ +static int perr_exit(const char *fmt, ...) + __attribute__((noreturn)) + __attribute__((format(printf, 1, 2))); static int perr_exit(const char *fmt, ...) { va_list ap; @@ -249,6 +259,7 @@ static int perr_exit(const char *fmt, ...) * * Return: none */ +static void usage(void) __attribute__((noreturn)); static void usage(void) { diff --git a/ntfsprogs/ntfstruncate.c b/ntfsprogs/ntfstruncate.c index 6c4efa31..4c4d1d49 100644 --- a/ntfsprogs/ntfstruncate.c +++ b/ntfsprogs/ntfstruncate.c @@ -95,6 +95,7 @@ struct { /** * Dprintf - debugging output (-vv); overriden by quiet (-q) */ +static void Dprintf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); static void Dprintf(const char *fmt, ...) { va_list ap; @@ -130,6 +131,9 @@ GEN_PRINTF(Qprintf, stdout, &opts.quiet, FALSE) /** * err_exit - error output and terminate; ignores quiet (-q) */ +static void err_exit(const char *fmt, ...) + __attribute__((noreturn)) + __attribute__((format(printf, 1, 2))); static void err_exit(const char *fmt, ...) { va_list ap;