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/bus/cdx/cdx_logs.h               | 12 ++++++------
 drivers/bus/dpaa/include/fman.h          |  4 ++--
 drivers/bus/dpaa/rte_dpaa_logs.h         | 18 +++++++++---------
 drivers/bus/fslmc/fslmc_logs.h           | 12 ++++++------
 drivers/bus/fslmc/qbman/include/compat.h | 14 +++++++-------
 drivers/bus/ifpga/ifpga_logs.h           | 16 ++++++++--------
 drivers/bus/uacce/uacce.c                |  8 ++++----
 7 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/bus/cdx/cdx_logs.h b/drivers/bus/cdx/cdx_logs.h
index 18b4010746..2d5c213417 100644
--- a/drivers/bus/cdx/cdx_logs.h
+++ b/drivers/bus/cdx/cdx_logs.h
@@ -15,11 +15,11 @@ extern int cdx_logtype_bus;
 #define CDX_BUS_DEBUG(...) \
        RTE_LOG_LINE_PREFIX(DEBUG, CDX_BUS, "%s(): ", __func__, __VA_ARGS__)
 
-#define CDX_BUS_INFO(fmt, args...) \
-       CDX_BUS_LOG(INFO, fmt, ## args)
-#define CDX_BUS_ERR(fmt, args...) \
-       CDX_BUS_LOG(ERR, fmt, ## args)
-#define CDX_BUS_WARN(fmt, args...) \
-       CDX_BUS_LOG(WARNING, fmt, ## args)
+#define CDX_BUS_INFO(fmt, ...) \
+       CDX_BUS_LOG(INFO, fmt, ## __VA_ARGS__)
+#define CDX_BUS_ERR(fmt, ...) \
+       CDX_BUS_LOG(ERR, fmt, ## __VA_ARGS__)
+#define CDX_BUS_WARN(fmt, ...) \
+       CDX_BUS_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif /* CDX_LOGS_H */
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index 01ef503117..134f0dc8ff 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -477,10 +477,10 @@ extern int fman_ccsr_map_fd;
 #define fman_if_for_each_bpool(bp, __if) \
        list_for_each_entry(bp, &(__if)->bpool_list, node)
 
-#define FMAN_ERR(rc, fmt, args...) \
+#define FMAN_ERR(rc, fmt, ...) \
        do { \
                _errno = (rc); \
-               RTE_LOG_LINE(ERR, DPAA_BUS, fmt "(%d)", ##args, errno); \
+               RTE_LOG_LINE(ERR, DPAA_BUS, fmt "(%d)", ##__VA_ARGS__, errno); \
        } while (0)
 
 #define FMAN_IP_REV_1  0xC30C4
diff --git a/drivers/bus/dpaa/rte_dpaa_logs.h b/drivers/bus/dpaa/rte_dpaa_logs.h
index 1e61b4e76b..235c617edd 100644
--- a/drivers/bus/dpaa/rte_dpaa_logs.h
+++ b/drivers/bus/dpaa/rte_dpaa_logs.h
@@ -16,13 +16,13 @@ extern int dpaa_logtype_bus;
        RTE_LOG_LINE(level, DPAA_BUS, __VA_ARGS__)
 
 #ifdef RTE_LIBRTE_DPAA_DEBUG_BUS
-#define DPAA_BUS_HWWARN(cond, fmt, args...) \
+#define DPAA_BUS_HWWARN(cond, fmt, ...) \
        do {\
                if (cond) \
-                       DPAA_BUS_LOG(DEBUG, "WARN: " fmt, ##args); \
+                       DPAA_BUS_LOG(DEBUG, "WARN: " fmt, ##__VA_ARGS__); \
        } while (0)
 #else
-#define DPAA_BUS_HWWARN(cond, fmt, args...) do { } while (0)
+#define DPAA_BUS_HWWARN(cond, fmt, ...) do { } while (0)
 #endif
 
 #define DPAA_BUS_DEBUG(...) \
@@ -30,11 +30,11 @@ extern int dpaa_logtype_bus;
 
 #define BUS_INIT_FUNC_TRACE() DPAA_BUS_DEBUG(" >>")
 
-#define DPAA_BUS_INFO(fmt, args...) \
-       DPAA_BUS_LOG(INFO, fmt, ## args)
-#define DPAA_BUS_ERR(fmt, args...) \
-       DPAA_BUS_LOG(ERR, fmt, ## args)
-#define DPAA_BUS_WARN(fmt, args...) \
-       DPAA_BUS_LOG(WARNING, fmt, ## args)
+#define DPAA_BUS_INFO(fmt, ...) \
+       DPAA_BUS_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA_BUS_ERR(fmt, ...) \
+       DPAA_BUS_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA_BUS_WARN(fmt, ...) \
+       DPAA_BUS_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif /* _DPAA_LOGS_H_ */
diff --git a/drivers/bus/fslmc/fslmc_logs.h b/drivers/bus/fslmc/fslmc_logs.h
index ac0cd3dc29..412d160d11 100644
--- a/drivers/bus/fslmc/fslmc_logs.h
+++ b/drivers/bus/fslmc/fslmc_logs.h
@@ -17,11 +17,11 @@ extern int dpaa2_logtype_bus;
 #define DPAA2_BUS_DEBUG(...) \
        RTE_LOG_LINE_PREFIX(DEBUG, DPAA2_BUS, "%s(): ", __func__, __VA_ARGS__)
 
-#define DPAA2_BUS_INFO(fmt, args...) \
-       DPAA2_BUS_LOG(INFO, fmt, ## args)
-#define DPAA2_BUS_ERR(fmt, args...) \
-       DPAA2_BUS_LOG(ERR, fmt, ## args)
-#define DPAA2_BUS_WARN(fmt, args...) \
-       DPAA2_BUS_LOG(WARNING, fmt, ## args)
+#define DPAA2_BUS_INFO(fmt, ...) \
+       DPAA2_BUS_LOG(INFO, fmt, ## __VA_ARGS__)
+#define DPAA2_BUS_ERR(fmt, ...) \
+       DPAA2_BUS_LOG(ERR, fmt, ## __VA_ARGS__)
+#define DPAA2_BUS_WARN(fmt, ...) \
+       DPAA2_BUS_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif /* _FSLMC_LOGS_H_ */
diff --git a/drivers/bus/fslmc/qbman/include/compat.h 
b/drivers/bus/fslmc/qbman/include/compat.h
index 4ac3254bc7..f3d61bb4a0 100644
--- a/drivers/bus/fslmc/qbman/include/compat.h
+++ b/drivers/bus/fslmc/qbman/include/compat.h
@@ -30,15 +30,15 @@
 typedef uint64_t       dma_addr_t;
 
 /* Debugging */
-#define prflush(fmt, args...) \
+#define prflush(fmt, ...) \
        do { \
-               printf(fmt, ##args); \
+               printf(fmt, ##__VA_ARGS__); \
                fflush(stdout); \
        } while (0)
-#define pr_crit(fmt, args...)   prflush("CRIT:" fmt, ##args)
-#define pr_err(fmt, args...)    prflush("ERR:" fmt, ##args)
-#define pr_warn(fmt, args...)   prflush("WARN:" fmt, ##args)
-#define pr_info(fmt, args...)   prflush(fmt, ##args)
+#define pr_crit(fmt, ...)       prflush("CRIT:" fmt, ##__VA_ARGS__)
+#define pr_err(fmt, ...)        prflush("ERR:" fmt, ##__VA_ARGS__)
+#define pr_warn(fmt, ...)       prflush("WARN:" fmt, ##__VA_ARGS__)
+#define pr_info(fmt, ...)       prflush(fmt, ##__VA_ARGS__)
 
 #ifdef RTE_LIBRTE_DPAA2_DEBUG_BUS
 
@@ -54,7 +54,7 @@ typedef uint64_t      dma_addr_t;
 #ifdef pr_debug
 #undef pr_debug
 #endif
-#define pr_debug(fmt, args...) printf(fmt, ##args)
+#define pr_debug(fmt, ...)     printf(fmt, ##__VA_ARGS__)
 #define QBMAN_BUG_ON(c) \
 do { \
        static int warned_##__LINE__; \
diff --git a/drivers/bus/ifpga/ifpga_logs.h b/drivers/bus/ifpga/ifpga_logs.h
index 154405a590..4289d9774b 100644
--- a/drivers/bus/ifpga/ifpga_logs.h
+++ b/drivers/bus/ifpga/ifpga_logs.h
@@ -15,13 +15,13 @@ extern int ifpga_bus_logtype;
 
 #define IFPGA_BUS_FUNC_TRACE() IFPGA_BUS_LOG(DEBUG, ">>")
 
-#define IFPGA_BUS_DEBUG(fmt, args...) \
-       IFPGA_BUS_LOG(DEBUG, fmt, ## args)
-#define IFPGA_BUS_INFO(fmt, args...) \
-       IFPGA_BUS_LOG(INFO, fmt, ## args)
-#define IFPGA_BUS_ERR(fmt, args...) \
-       IFPGA_BUS_LOG(ERR, fmt, ## args)
-#define IFPGA_BUS_WARN(fmt, args...) \
-       IFPGA_BUS_LOG(WARNING, fmt, ## args)
+#define IFPGA_BUS_DEBUG(fmt, ...) \
+       IFPGA_BUS_LOG(DEBUG, fmt, ## __VA_ARGS__)
+#define IFPGA_BUS_INFO(fmt, ...) \
+       IFPGA_BUS_LOG(INFO, fmt, ## __VA_ARGS__)
+#define IFPGA_BUS_ERR(fmt, ...) \
+       IFPGA_BUS_LOG(ERR, fmt, ## __VA_ARGS__)
+#define IFPGA_BUS_WARN(fmt, ...) \
+       IFPGA_BUS_LOG(WARNING, fmt, ## __VA_ARGS__)
 
 #endif /* _IFPGA_BUS_LOGS_H_ */
diff --git a/drivers/bus/uacce/uacce.c b/drivers/bus/uacce/uacce.c
index c1529c38c0..9ca048122d 100644
--- a/drivers/bus/uacce/uacce.c
+++ b/drivers/bus/uacce/uacce.c
@@ -62,10 +62,10 @@ extern int uacce_bus_logtype;
 #define RTE_LOGTYPE_UACCE_BUS uacce_bus_logtype
 #define UACCE_BUS_LOG(level, ...) \
        RTE_LOG_LINE(level, UACCE_BUS, __VA_ARGS__)
-#define UACCE_BUS_ERR(fmt, args...) UACCE_BUS_LOG(ERR, fmt, ##args)
-#define UACCE_BUS_WARN(fmt, args...) UACCE_BUS_LOG(WARNING, fmt, ##args)
-#define UACCE_BUS_INFO(fmt, args...) UACCE_BUS_LOG(INFO, fmt, ##args)
-#define UACCE_BUS_DEBUG(fmt, args...) UACCE_BUS_LOG(DEBUG, fmt, ##args)
+#define UACCE_BUS_ERR(fmt, ...) UACCE_BUS_LOG(ERR, fmt, ##__VA_ARGS__)
+#define UACCE_BUS_WARN(fmt, ...) UACCE_BUS_LOG(WARNING, fmt, ##__VA_ARGS__)
+#define UACCE_BUS_INFO(fmt, ...) UACCE_BUS_LOG(INFO, fmt, ##__VA_ARGS__)
+#define UACCE_BUS_DEBUG(fmt, ...) UACCE_BUS_LOG(DEBUG, fmt, ##__VA_ARGS__)
 
 
 static struct rte_devargs *
-- 
2.47.0.vfs.0.3

Reply via email to