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

From: Paul Moore
Date: Thu Mar 20 2025 - 18:02:43 EST


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.

--
paul-moore.com