[PATCH v2 04/14] app/test-pmd: use portable variadic macros
Andre Muezerie
andremue at linux.microsoft.com
Wed Dec 11 23:07:14 CET 2024
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__.
Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
---
app/test-pmd/testpmd.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 314482e69c..260e4761bd 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -1311,7 +1311,7 @@ RTE_INIT(__##c) \
#endif
#endif /* __GCC__ */
-#define TESTPMD_LOG(level, fmt, args...) \
- rte_log(RTE_LOG_ ## level, testpmd_logtype, "testpmd: " fmt, ## args)
+#define TESTPMD_LOG(level, fmt, ...) \
+ rte_log(RTE_LOG_ ## level, testpmd_logtype, "testpmd: " fmt, ## __VA_ARGS__)
#endif /* _TESTPMD_H_ */
--
2.47.0.vfs.0.3
More information about the dev
mailing list