[dpdk-dev,v1,3/6] flow_classify: fix issue in exported header

Message ID 20171221122458.811-4-adrien.mazarguil@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Adrien Mazarguil Dec. 21, 2017, 12:59 p.m. UTC
  Reported by check-includes.sh:

 [...]/rte_flow_classify.h:85:47: error: ISO C does not permit named
     variadic macros [-Werror=variadic-macros]
  #define RTE_FLOW_CLASSIFY_LOG(level, fmt, args...) \
                                                ^

Fixes: be41ac2a330f ("flow_classify: introduce flow classify library")
Cc: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Bernard Iremonger <bernard.iremonger@intel.com>

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_flow_classify/rte_flow_classify.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
  

Comments

Iremonger, Bernard Jan. 2, 2018, 3:19 p.m. UTC | #1
> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
> Sent: Thursday, December 21, 2017 1:00 PM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>
> Subject: [PATCH v1 3/6] flow_classify: fix issue in exported header
> 
> Reported by check-includes.sh:
> 
>  [...]/rte_flow_classify.h:85:47: error: ISO C does not permit named
>      variadic macros [-Werror=variadic-macros]
>   #define RTE_FLOW_CLASSIFY_LOG(level, fmt, args...) \
>                                                 ^
> 
> Fixes: be41ac2a330f ("flow_classify: introduce flow classify library")
> Cc: Ferruh Yigit <ferruh.yigit@intel.com>
> Cc: Bernard Iremonger <bernard.iremonger@intel.com>
> 
> Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Acked-by: Bernard Iremonger <Bernard.iremonger@intel.com>
  

Patch

diff --git a/lib/librte_flow_classify/rte_flow_classify.h b/lib/librte_flow_classify/rte_flow_classify.h
index 1211873a1..e14bc787e 100644
--- a/lib/librte_flow_classify/rte_flow_classify.h
+++ b/lib/librte_flow_classify/rte_flow_classify.h
@@ -70,6 +70,7 @@ 
  *    with rte_flow_classifier_free()
  */
 
+#include <rte_common.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_flow.h>
@@ -82,9 +83,12 @@  extern "C" {
 
 extern int librte_flow_classify_logtype;
 
-#define RTE_FLOW_CLASSIFY_LOG(level, fmt, args...) \
-rte_log(RTE_LOG_ ## level, librte_flow_classify_logtype, "%s(): " fmt, \
-	__func__, ## args)
+#define RTE_FLOW_CLASSIFY_LOG(level, ...) \
+	rte_log(RTE_LOG_ ## level, \
+		librte_flow_classify_logtype, \
+		RTE_FMT("%s(): " RTE_FMT_HEAD(__VA_ARGS__,), \
+			__func__, \
+			RTE_FMT_TAIL(__VA_ARGS__,)))
 
 /** Opaque data type for flow classifier */
 struct rte_flow_classifier;