From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2] iplink/can: fix format string warnings
Date: Mon, 24 Aug 2026 09:49:22 -0700 [thread overview]
Message-ID: <20260824164922.575038-1-stephen@networkplumber.org> (raw)
Clang complains about non-literal format string
iplink_can.c:531:36: warning: format string is not a string literal
[-Wformat-nonliteral]
531 | can_print_timing_min_max("tdcv", tdcv, *tdcv_min, *...
| ^~~~
Small change to use "%s" in can_print_timing_min_max.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
ip/iplink_can.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ip/iplink_can.c b/ip/iplink_can.c
index f631aab8..450a19b9 100644
--- a/ip/iplink_can.c
+++ b/ip/iplink_can.c
@@ -448,11 +448,11 @@ static void can_print_nl_indent(void)
print_string(PRINT_FP, NULL, "%s", "\t ");
}
-static void __attribute__((format(printf, 2, 0)))
+static void
can_print_timing_min_max(const char *json_attr, const char *fp_attr,
int min, int max)
{
- print_null(PRINT_FP, NULL, fp_attr, NULL);
+ print_string(PRINT_FP, NULL, "%s", fp_attr);
open_json_object(json_attr);
print_uint(PRINT_ANY, "min", " %d", min);
print_uint(PRINT_ANY, "max", "..%d", max);
--
2.53.0
next reply other threads:[~2026-08-24 16:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 16:49 Stephen Hemminger [this message]
2026-08-25 4:10 ` [PATCH iproute2] iplink/can: fix format string warnings patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260824164922.575038-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.