All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] iplink/can: fix format string warnings
@ 2026-08-24 16:49 Stephen Hemminger
  2026-08-25  4:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2026-08-24 16:49 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2] iplink/can: fix format string warnings
  2026-08-24 16:49 [PATCH iproute2] iplink/can: fix format string warnings Stephen Hemminger
@ 2026-08-25  4:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-25  4:10 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Mon, 24 Aug 2026 09:49:22 -0700 you wrote:
> 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, *...
>         |                                                  ^~~~
> 
> [...]

Here is the summary with links:
  - [iproute2] iplink/can: fix format string warnings
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=4766edf1462e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-25  4:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 16:49 [PATCH iproute2] iplink/can: fix format string warnings Stephen Hemminger
2026-08-25  4:10 ` patchwork-bot+netdevbpf

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.