From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute] ss: fix format string warnings
Date: Thu, 27 Jun 2024 10:00:18 -0700 [thread overview]
Message-ID: <20240627170029.7346-1-stephen@networkplumber.org> (raw)
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(+)
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);
--
2.43.0
next reply other threads:[~2024-06-27 17:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 17:00 Stephen Hemminger [this message]
2024-06-27 17:10 ` [PATCH iproute] ss: 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=20240627170029.7346-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.