diff mbox series

[iproute] ss: fix format string warnings

Message ID 20240627170029.7346-1-stephen@networkplumber.org (mailing list archive)
State Accepted
Commit 357808abd3a67bcf4d1444a25268c45dda62e87f
Delegated to: Stephen Hemminger
Headers show
Series [iproute] ss: fix format string warnings | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger June 27, 2024, 5 p.m. UTC
Clang complains that format string is not a string literal
unless the functions are annotated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 misc/ss.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org June 27, 2024, 5:10 p.m. UTC | #1
Hello:

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

On Thu, 27 Jun 2024 10:00:18 -0700 you wrote:
> Clang complains that format string is not a string literal
> unless the functions are annotated.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  misc/ss.c | 2 ++
>  1 file changed, 2 insertions(+)

Here is the summary with links:
  - [iproute] ss: fix format string warnings
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=357808abd3a6

You are awesome, thank you!
diff mbox series

Patch

diff --git a/misc/ss.c b/misc/ss.c
index 8ff6e100..eb68e506 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -1043,6 +1043,7 @@  static int buf_update(int len)
 }
 
 /* Append content to buffer as part of the current field */
+__attribute__((format(printf, 1, 0)))
 static void vout(const char *fmt, va_list args)
 {
 	struct column *f = current_field;
@@ -3460,6 +3461,7 @@  static int bpf_maps_opts_load_btf(struct bpf_map_info *info, struct btf **btf)
 	return 0;
 }
 
+__attribute__((format(printf, 2, 0)))
 static void out_bpf_sk_storage_print_fn(void *ctx, const char *fmt, va_list args)
 {
 	vout(fmt, args);