eal/windows: fix vfprintf warning with clang
authorNick Connolly <nick.connolly@mayadata.io>
Sun, 29 Nov 2020 13:00:47 +0000 (13:00 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 7 Dec 2020 20:24:57 +0000 (21:24 +0100)
When building with clang (11.0,--buildtype=debug), eal_lcore.c
produces a -Wformat-nonliteral warning from the vfprintf call
in log_early.

Add __rte_format_printf annotation.

Fixes: b8a36b086625 ("eal/windows: improve CPU and NUMA node detection")
Cc: stable@dpdk.org
Suggested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
lib/librte_eal/windows/eal_lcore.c

index d5ff721..a85149b 100644 (file)
@@ -38,6 +38,7 @@ static struct cpu_map cpu_map = { 0 };
 
 /* eal_create_cpu_map() is called before logging is initialized */
 static void
+__rte_format_printf(1, 2)
 log_early(const char *format, ...)
 {
        va_list va;