From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
kernel test robot <lkp@intel.com>
Cc: Petr Mladek <pmladek@suse.com>,
oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: lib/vsprintf.c:1528:9: warning: function 'va_format' might be a candidate for 'gnu_printf' format attribute
Date: Tue, 13 Feb 2024 13:05:29 +0100 [thread overview]
Message-ID: <6e776c69-12fd-470f-b3ce-dd9f91bacde5@prevas.dk> (raw)
In-Reply-To: <Za0iLa7akcaML096@smile.fi.intel.com>
On 21/01/2024 14.54, Andy Shevchenko wrote:
> On Thu, Jan 11, 2024 at 10:33:09AM +0800, kernel test robot wrote:
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head: acc657692aed438e9931438f8c923b2b107aebf9
>> commit: 45c3e93d751ea50861c796da3cbfc848fa6ddf55 vsprintf: Factor out %pV handler as va_format()
>> date: 4 years, 9 months ago
>
> Blast from the past?!
>
> ..
>
>> lib/vsprintf.c: In function 'va_format':
>>>> lib/vsprintf.c:1528:9: warning: function 'va_format' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
>> 1528 | buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va);
>> | ^~~
>
> This might be still valid, but I have no idea how to properly fix it.
>
It's a bogus warning, and the fix belongs in the compiler. When
vsnprintf() is called, but neither the format arg nor the va_list arg
are direct arguments to the caller (and the va_list is not built from
actual varargs using va_start()), there's absolutely no way a __printf
attribute could be appropriate.
IDK if we can shut up the test robot by locally disabling the
Wsuggest-attribute with some pragma.
Rasmus
next prev parent reply other threads:[~2024-02-13 12:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 2:33 kernel test robot
2024-01-21 13:54 ` Andy Shevchenko
2024-02-13 12:05 ` Rasmus Villemoes [this message]
2024-02-07 13:42 kernel test robot
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=6e776c69-12fd-470f-b3ce-dd9f91bacde5@prevas.dk \
--to=rasmus.villemoes@prevas.dk \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pmladek@suse.com \
--cc=sergey.senozhatsky@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®