Skip to contentSkip to conversation

ss: fix format string warnings

PATCH Applied Stephen Hemminger 2 participants 2 messages Jun 27, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ss: fix format string warnings

Clang complains that format string is not a string literal unless the functions are annotated.

---
 misc/ss.c | 2 ++
 1 file changed, 2 insertions(+)
misc/ss.c +2 -0
index 8ff6e100..eb68e506 100644
@@ -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);
Signature · 1 line
2.43.0
#1 lore raw
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 7 lines · 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.

---
 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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html