qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH for 1.7] acpi-build: Fix compiler warning (mis


From: Michael Tokarev
Subject: Re: [Qemu-trivial] [PATCH for 1.7] acpi-build: Fix compiler warning (missing gnu_printf format attribute)
Date: Wed, 20 Nov 2013 15:53:18 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10

17.11.2013 22:00, Stefan Weil wrote:
> gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):
> 
>   CC    m68k-softmmu/hw/m68k/mcf5206.o
> hw/i386/acpi-build.c: In function ‘build_append_nameseg’:
> hw/i386/acpi-build.c:294:5: error:
>  function might be possible candidate for ‘gnu_printf’ format attribute 
> [-Werror=suggest-attribute=format]
>      g_string_vprintf(s, format, args);
>      ^
> 
> When this warning is fixed, there is a new compiler warning:
> 
>   CC    i386-softmmu/hw/i386/acpi-build.o
> hw/i386/acpi-build.c: In function ‘build_append_notify’:
> hw/i386/acpi-build.c:632:5: error:
>  format not a string literal and no format arguments [-Werror=format-security]
>      build_append_nameseg(method, name);
>      ^
> 
> This is fixed here, too.

Thanks, applied to the trivial-patches queue.

Note this patch also triggers checkpatch.pl error:

> +static void GCC_FMT_ATTR(2, 3)
> +build_append_nameseg(GArray *array, const char *format, ...)
                               ^
ERROR: need consistent spacing around '*' (ctx:WxV)
#40: FILE: hw/i386/acpi-build.c:289:

It looks like checkpatch.pl needs some tweaking here, because
the spacing here is really consistent, as far as I can see.

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]