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/dma/dpaa/dpaa_qdma_logs.h | 24 ++++++++++++------------ drivers/dma/dpaa2/dpaa2_qdma_logs.h | 24 ++++++++++++------------ drivers/dma/idxd/idxd_internal.h | 8 ++++---- drivers/dma/ioat/ioat_internal.h | 8 ++++---- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/dma/dpaa/dpaa_qdma_logs.h b/drivers/dma/dpaa/dpaa_qdma_logs.h index 2d77255fd8..cbed89485f 100644 --- a/drivers/dma/dpaa/dpaa_qdma_logs.h +++ b/drivers/dma/dpaa/dpaa_qdma_logs.h @@ -16,22 +16,22 @@ extern int dpaa_qdma_logtype; #define DPAA_QDMA_FUNC_TRACE() DPAA_QDMA_DEBUG(">>") -#define DPAA_QDMA_INFO(fmt, args...) \ - DPAA_QDMA_LOG(INFO, fmt, ## args) -#define DPAA_QDMA_ERR(fmt, args...) \ - DPAA_QDMA_LOG(ERR, fmt, ## args) -#define DPAA_QDMA_WARN(fmt, args...) \ - DPAA_QDMA_LOG(WARNING, fmt, ## args) +#define DPAA_QDMA_INFO(fmt, ...) \ + DPAA_QDMA_LOG(INFO, fmt, ## __VA_ARGS__) +#define DPAA_QDMA_ERR(fmt, ...) \ + DPAA_QDMA_LOG(ERR, fmt, ## __VA_ARGS__) +#define DPAA_QDMA_WARN(fmt, ...) \ + DPAA_QDMA_LOG(WARNING, fmt, ## __VA_ARGS__) /* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA_QDMA_DP_LOG(level, ...) \ RTE_LOG_DP_LINE(level, DPAA_QDMA, __VA_ARGS__) -#define DPAA_QDMA_DP_DEBUG(fmt, args...) \ - DPAA_QDMA_DP_LOG(DEBUG, fmt, ## args) -#define DPAA_QDMA_DP_INFO(fmt, args...) \ - DPAA_QDMA_DP_LOG(INFO, fmt, ## args) -#define DPAA_QDMA_DP_WARN(fmt, args...) \ - DPAA_QDMA_DP_LOG(WARNING, fmt, ## args) +#define DPAA_QDMA_DP_DEBUG(fmt, ...) \ + DPAA_QDMA_DP_LOG(DEBUG, fmt, ## __VA_ARGS__) +#define DPAA_QDMA_DP_INFO(fmt, ...) \ + DPAA_QDMA_DP_LOG(INFO, fmt, ## __VA_ARGS__) +#define DPAA_QDMA_DP_WARN(fmt, ...) \ + DPAA_QDMA_DP_LOG(WARNING, fmt, ## __VA_ARGS__) #endif /* __DPAA_QDMA_LOGS_H__ */ diff --git a/drivers/dma/dpaa2/dpaa2_qdma_logs.h b/drivers/dma/dpaa2/dpaa2_qdma_logs.h index 62ef60bcf2..50a865a56a 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma_logs.h +++ b/drivers/dma/dpaa2/dpaa2_qdma_logs.h @@ -20,23 +20,23 @@ extern int dpaa2_qdma_logtype; #define DPAA2_QDMA_FUNC_TRACE() DPAA2_QDMA_DEBUG(">>") -#define DPAA2_QDMA_INFO(fmt, args...) \ - DPAA2_QDMA_LOG(INFO, fmt, ## args) -#define DPAA2_QDMA_ERR(fmt, args...) \ - DPAA2_QDMA_LOG(ERR, fmt, ## args) -#define DPAA2_QDMA_WARN(fmt, args...) \ - DPAA2_QDMA_LOG(WARNING, fmt, ## args) +#define DPAA2_QDMA_INFO(fmt, ...) \ + DPAA2_QDMA_LOG(INFO, fmt, ## __VA_ARGS__) +#define DPAA2_QDMA_ERR(fmt, ...) \ + DPAA2_QDMA_LOG(ERR, fmt, ## __VA_ARGS__) +#define DPAA2_QDMA_WARN(fmt, ...) \ + DPAA2_QDMA_LOG(WARNING, fmt, ## __VA_ARGS__) /* DP Logs, toggled out at compile time if level lower than current level */ #define DPAA2_QDMA_DP_LOG(level, ...) \ RTE_LOG_DP_LINE(level, DPAA2_QDMA, __VA_ARGS__) -#define DPAA2_QDMA_DP_DEBUG(fmt, args...) \ - DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## args) -#define DPAA2_QDMA_DP_INFO(fmt, args...) \ - DPAA2_QDMA_DP_LOG(INFO, fmt, ## args) -#define DPAA2_QDMA_DP_WARN(fmt, args...) \ - DPAA2_QDMA_DP_LOG(WARNING, fmt, ## args) +#define DPAA2_QDMA_DP_DEBUG(fmt, ...) \ + DPAA2_QDMA_DP_LOG(DEBUG, fmt, ## __VA_ARGS__) +#define DPAA2_QDMA_DP_INFO(fmt, ...) \ + DPAA2_QDMA_DP_LOG(INFO, fmt, ## __VA_ARGS__) +#define DPAA2_QDMA_DP_WARN(fmt, ...) \ + DPAA2_QDMA_DP_LOG(WARNING, fmt, ## __VA_ARGS__) #ifdef __cplusplus } diff --git a/drivers/dma/idxd/idxd_internal.h b/drivers/dma/idxd/idxd_internal.h index 99dc2b367e..b80a113455 100644 --- a/drivers/dma/idxd/idxd_internal.h +++ b/drivers/dma/idxd/idxd_internal.h @@ -25,10 +25,10 @@ extern int idxd_pmd_logtype; #define IDXD_PMD_LOG(level, ...) \ RTE_LOG_LINE_PREFIX(level, IDXD_PMD, "%s(): ", __func__, __VA_ARGS__) -#define IDXD_PMD_DEBUG(fmt, args...) IDXD_PMD_LOG(DEBUG, fmt, ## args) -#define IDXD_PMD_INFO(fmt, args...) IDXD_PMD_LOG(INFO, fmt, ## args) -#define IDXD_PMD_ERR(fmt, args...) IDXD_PMD_LOG(ERR, fmt, ## args) -#define IDXD_PMD_WARN(fmt, args...) IDXD_PMD_LOG(WARNING, fmt, ## args) +#define IDXD_PMD_DEBUG(fmt, ...) IDXD_PMD_LOG(DEBUG, fmt, ## __VA_ARGS__) +#define IDXD_PMD_INFO(fmt, ...) IDXD_PMD_LOG(INFO, fmt, ## __VA_ARGS__) +#define IDXD_PMD_ERR(fmt, ...) IDXD_PMD_LOG(ERR, fmt, ## __VA_ARGS__) +#define IDXD_PMD_WARN(fmt, ...) IDXD_PMD_LOG(WARNING, fmt, ## __VA_ARGS__) struct idxd_pci_common { rte_spinlock_t lk; diff --git a/drivers/dma/ioat/ioat_internal.h b/drivers/dma/ioat/ioat_internal.h index 2da26b616f..a5b25701a4 100644 --- a/drivers/dma/ioat/ioat_internal.h +++ b/drivers/dma/ioat/ioat_internal.h @@ -40,9 +40,9 @@ extern int ioat_pmd_logtype; #define IOAT_PMD_LOG(level, ...) \ RTE_LOG_LINE_PREFIX(level, IOAT_PMD, "%s(): ", __func__, __VA_ARGS__) -#define IOAT_PMD_DEBUG(fmt, args...) IOAT_PMD_LOG(DEBUG, fmt, ## args) -#define IOAT_PMD_INFO(fmt, args...) IOAT_PMD_LOG(INFO, fmt, ## args) -#define IOAT_PMD_ERR(fmt, args...) IOAT_PMD_LOG(ERR, fmt, ## args) -#define IOAT_PMD_WARN(fmt, args...) IOAT_PMD_LOG(WARNING, fmt, ## args) +#define IOAT_PMD_DEBUG(fmt, ...) IOAT_PMD_LOG(DEBUG, fmt, ## __VA_ARGS__) +#define IOAT_PMD_INFO(fmt, ...) IOAT_PMD_LOG(INFO, fmt, ## __VA_ARGS__) +#define IOAT_PMD_ERR(fmt, ...) IOAT_PMD_LOG(ERR, fmt, ## __VA_ARGS__) +#define IOAT_PMD_WARN(fmt, ...) IOAT_PMD_LOG(WARNING, fmt, ## __VA_ARGS__) #endif /* _IOAT_INTERNAL_H_ */ -- 2.47.0.vfs.0.3