Re: [PATCH v2 1/1] audit: Mark audit_log_vformat() with __printf() attribute

From: Paul Moore
Date: Fri Apr 11 2025 - 14:04:20 EST


On Thu, Mar 20, 2025 at 6:02 PM Paul Moore <paul@xxxxxxxxxxxxxx> wrote:
> On Mar 13, 2025 Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> >
> > audit_log_vformat() is using printf() type of format, and GCC compiler
> > (Debian 14.2.0-17) is not happy about this:
> >
> > kernel/audit.c:1978:9: error: function ‘audit_log_vformat’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
> > kernel/audit.c:1987:17: error: function ‘audit_log_vformat’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
> >
> > Fix the compilation errors (`make W=1` when CONFIG_WERROR=y, which is default)
> > by adding __printf() attribute.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > ---
> > v2: added necessary technical information to the commit message (Paul)
> >
> > kernel/audit.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Merged into audit/dev-staging, this will move to audit/dev after the
> upcoming merge window.

... and now it is in audit/dev, thanks.

--
paul-moore.com