Skip to contentSkip to conversation

acpi: Add missing GCC_FMT_ATTR to local function

PATCH In review Stefan Weil 3 participants 3 messages Mar 20, 2015 – Mar 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: Add missing GCC_FMT_ATTR to local function

This fixes these gcc warnings (not enabled in default build):

hw/acpi/aml-build.c:83:5: warning:
function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
hw/acpi/aml-build.c:88:5: warning:
function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

Cc Michael S. Tsirkin <[email protected]>
---
 hw/acpi/aml-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/acpi/aml-build.c +1 -1
index 6242908..d7945f6 100644
@@ -68,7 +68,7 @@ build_append_nameseg(GArray *array, const char *seg)
     g_array_append_vals(array, "____", ACPI_NAMESEG_LEN - len);
 }
 
-static void
+static void GCC_FMT_ATTR(2, 0)
 build_append_namestringv(GArray *array, const char *format, va_list ap)
 {
     /* It would be nicer to use g_string_vprintf but it's only there in 2.22 */
Signature · 1 line
2.1.4
#1 lore raw
Quoted 6 lines · Stefan Weil

This fixes these gcc warnings (not enabled in default build):

hw/acpi/aml-build.c:83:5: warning:
function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
hw/acpi/aml-build.c:88:5: warning:
function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

Not very important but does not hurt, applied to -trivial, thanks!

/mjt

#2 lore raw
Quoted 11 lines · Michael Tokarev
Quoted 6 lines · Stefan Weil

This fixes these gcc warnings (not enabled in default build):

hw/acpi/aml-build.c:83:5: warning:
function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
hw/acpi/aml-build.c:88:5: warning:
function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

Not very important but does not hurt, applied to -trivial, thanks!

/mjt

I'm preparing a pull request with this one, it's already signed and testing is going to complete soon. So I think you needn't bother.