[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240309113051.649f1de4@hermes.local>
Date: Sat, 9 Mar 2024 11:30:51 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: David Ahern <dsahern@...nel.org>
Cc: Denis Kirjanov <kirjanov@...il.com>, netdev@...r.kernel.org, Denis
Kirjanov <dkirjanov@...e.de>
Subject: Re: [PATCH iproute2-next] ss: fix the compiler warning
On Sat, 9 Mar 2024 11:22:34 -0700
David Ahern <dsahern@...nel.org> wrote:
> On 3/7/24 3:53 AM, Denis Kirjanov wrote:
> > the patch fixes the following compiler warning:
> >
> > ss.c:1064:53: warning: format string is not a string literal [-Wformat-nonliteral]
> > len = vsnprintf(pos, buf_chunk_avail(buffer.tail), fmt, _args);
> > ^~~
> > 1 warning generated.
> > LINK ss
> >
> > Fixes: e3ecf0485 ("ss: pretty-print BPF socket-local storage")
> > Signed-off-by: Denis Kirjanov <dkirjanov@...e.de>
> > ---
> > misc/ss.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/misc/ss.c b/misc/ss.c
> > index 87008d7c..038905f3 100644
> > --- a/misc/ss.c
> > +++ b/misc/ss.c
> > @@ -1042,6 +1042,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;
>
> The error message does not align with the change - and it does not fix
> the warning.
Think you need to add attribute to out_bpf_sk_storage_print_fn as well,
or better yet get rid of it since it could just be vout()
Powered by blists - more mailing lists