[dpdk-stable] [PATCH] eal/windows: vfprintf build warning with clang

Nick Connolly nick.connolly at mayadata.io
Sat Nov 28 23:46:12 CET 2020


Looks good to me!

On 28/11/2020 21:11, Dmitry Kozlyuk wrote:
> On Fri, 27 Nov 2020 12:07:11 +0000, Nick Connolly wrote:
>> [...]
>> +#ifdef __clang__
>> +#pragma clang diagnostic push
>> +#pragma clang diagnostic ignored "-Wformat-nonliteral"
>> +#endif
>> [...]
> How about a more safe approach?
>
> diff --git a/lib/librte_eal/windows/eal_lcore.c b/lib/librte_eal/windows/eal_lcore.c
> index d5ff721e0..ebcd3474e 100644
> --- a/lib/librte_eal/windows/eal_lcore.c
> +++ b/lib/librte_eal/windows/eal_lcore.c
> @@ -37,6 +37,7 @@ struct cpu_map {
>   static struct cpu_map cpu_map = { 0 };
>   
>   /* eal_create_cpu_map() is called before logging is initialized */
> +__rte_format_printf(1, 2)
>   static void
>   log_early(const char *format, ...)
>   {



More information about the stable mailing list