[PATCH 13/21] drivers/net: use portable variadic macros

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Mon Dec 16 10:02:23 CET 2024


On 12/11/24 05:05, Andre Muezerie wrote:
> 1) Use portable variadic macros
> 
> Many places are using a GCC extension related to variadic macros,
> where a name prepends the ellipsis. This results in a warning like
> the one below when compiling the code with MSVC:
> 
> app\test-pmd\testpmd.h(1314): error C2608:
>      invalid token '...' in macro parameter list
> 
> Variadic macros became a standard part of the C language with C99.
> GCC, Clang and MSVC handle them properly.
> 
> The fix is to remove the prefix name (args... becomes ...) and use
> __VA_ARGS__.
> 
> 2) Add "do { } while (0)" to macros used to remove logging calls, to
> ensure there's no code structure change when enabling/disabling
> logging.
> 
> Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>

For sfc,

Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>



More information about the dev mailing list