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 <andre...@linux.microsoft.com>
---
 drivers/mempool/dpaa/dpaa_mempool.h           | 20 ++++++-------
 drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h | 30 +++++++++----------
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/mempool/dpaa/dpaa_mempool.h 
b/drivers/mempool/dpaa/dpaa_mempool.h
index 135520922f..0877068fdd 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.h
+++ b/drivers/mempool/dpaa/dpaa_mempool.h
@@ -65,15 +65,15 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info;
 
 #define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
 
-#define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
-       RTE_LOG_DP(DEBUG, DPAA_MEMPOOL, fmt, ## args)
-#define DPAA_MEMPOOL_DEBUG(fmt, args...) \
-       DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
-#define DPAA_MEMPOOL_ERR(fmt, args...) \
-       DPAA_MEMPOOL_LOG(ERR, fmt, ## args)
-#define DPAA_MEMPOOL_INFO(fmt, args...) \
-       DPAA_MEMPOOL_LOG(INFO, fmt, ## args)
-#define DPAA_MEMPOOL_WARN(fmt, args...) \
-       DPAA_MEMPOOL_LOG(WARNING, fmt, ## args)
+#define DPAA_MEMPOOL_DPDEBUG(fmt, ...) \
+       RTE_LOG_DP(DEBUG, DPAA_MEMPOOL, fmt, ## __VA_ARGS__)
+#define DPAA_MEMPOOL_DEBUG(fmt, ...) \
+       DPAA_MEMPOOL_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define DPAA_MEMPOOL_ERR(fmt, ...) \
+       DPAA_MEMPOOL_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA_MEMPOOL_INFO(fmt, ...) \
+       DPAA_MEMPOOL_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA_MEMPOOL_WARN(fmt, ...) \
+       DPAA_MEMPOOL_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h 
b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
index d69ef17a04..1ba7983206 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool_logs.h
@@ -15,22 +15,22 @@ extern int dpaa2_logtype_mempool;
 #define DPAA2_MEMPOOL_DEBUG(...) \
        RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_MEMPOOL, "%s(): ", __func__, 
__VA_ARGS__)
 
-#define DPAA2_MEMPOOL_INFO(fmt, args...) \
-       DPAA2_MEMPOOL_LOG(INFO, fmt, ## args)
-#define DPAA2_MEMPOOL_ERR(fmt, args...) \
-       DPAA2_MEMPOOL_LOG(ERR, fmt, ## args)
-#define DPAA2_MEMPOOL_WARN(fmt, args...) \
-       DPAA2_MEMPOOL_LOG(WARNING, fmt, ## args)
+#define DPAA2_MEMPOOL_INFO(fmt, ...) \
+       DPAA2_MEMPOOL_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA2_MEMPOOL_ERR(fmt, ...) \
+       DPAA2_MEMPOOL_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA2_MEMPOOL_WARN(fmt, ...) \
+       DPAA2_MEMPOOL_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 /* DP Logs, toggled out at compile time if level lower than current level */
-#define DPAA2_MEMPOOL_DP_LOG(level, fmt, args...) \
-       RTE_LOG_DP(level, DPAA2_MEMPOOL, fmt, ## args)
-
-#define DPAA2_MEMPOOL_DP_DEBUG(fmt, args...) \
-       DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## args)
-#define DPAA2_MEMPOOL_DP_INFO(fmt, args...) \
-       DPAA2_MEMPOOL_DP_LOG(INFO, fmt, ## args)
-#define DPAA2_MEMPOOL_DP_WARN(fmt, args...) \
-       DPAA2_MEMPOOL_DP_LOG(WARNING, fmt, ## args)
+#define DPAA2_MEMPOOL_DP_LOG(level, fmt, ...) \
+       RTE_LOG_DP(level, DPAA2_MEMPOOL, fmt, ## __VA_ARGS__)
+
+#define DPAA2_MEMPOOL_DP_DEBUG(fmt, ...) \
+       DPAA2_MEMPOOL_DP_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define DPAA2_MEMPOOL_DP_INFO(fmt, ...) \
+       DPAA2_MEMPOOL_DP_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA2_MEMPOOL_DP_WARN(fmt, ...) \
+       DPAA2_MEMPOOL_DP_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif /* _DPAA2_HW_MEMPOOL_LOGS_H_ */
-- 
2.47.0.vfs.0.3

Reply via email to