From: Stephen Hemminger Date: Tue, 11 Jan 2022 17:54:28 +0000 (-0800) Subject: tc: add format attribute to tc_print_rate X-Git-Tag: v5.18.0~62^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=343c4f52b698d284bb95f6a9f215e0cbfbcc2f97;p=thirdparty%2Fiproute2.git tc: add format attribute to tc_print_rate This catches future errors and silences warning from Clang. Signed-off-by: Stephen Hemminger Signed-off-by: David Ahern --- diff --git a/tc/tc_util.c b/tc/tc_util.c index 48065897c..6d5eb7548 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -247,7 +247,8 @@ int get_percent_rate64(__u64 *rate, const char *str, const char *dev) return get_rate64(rate, r_str); } -void tc_print_rate(enum output_type t, const char *key, const char *fmt, +void __attribute__((format(printf, 3, 0))) +tc_print_rate(enum output_type t, const char *key, const char *fmt, unsigned long long rate) { print_rate(use_iec, t, key, fmt, rate);