RE: [EXT] Re: [PATCH] rcu: fix build failure with debug dp log level
From: Anoob Joseph <hidden>
Date: 2022-09-29 03:25:54
Hi Stephen, Please see inline. Thanks, Anoob
-----Original Message----- From: Stephen Hemminger <stephen@networkplumber.org> Sent: Thursday, September 29, 2022 3:51 AM To: Anoob Joseph <redacted> Cc: Honnappa Nagarahalli <redacted>; Jerin Jacob Kollanukkaran [off-list ref]; dev@dpdk.org; sean.morrissey@intel.com Subject: [EXT] Re: [PATCH] rcu: fix build failure with debug dp log level External Email ---------------------------------------------------------------------- On Mon, 29 Aug 2022 22:21:51 +0530 Anoob Joseph [off-list ref] wrote:quoted
Build fails if RTE_LOG_DP_LEVEL is set to RTE_LOG_DEBUG. Fix the same by including the required header when RTE_LOG_DP_LEVEL is set to RTE_LOG_DEBUG. ../lib/rcu/rte_rcu_qsbr.h:678:40: error: expected ‘)’ before ‘PRIu64’ 678 | "%s: status: least acked token = %" PRIu64, | ^~~~~~ Fixes: 30a1de105a5f ("lib: remove unneeded header includes") Cc: sean.morrissey@intel.com Signed-off-by: Anoob Joseph <redacted> --- lib/rcu/rte_rcu_qsbr.h | 4 ++++ 1 file changed, 4 insertions(+)diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h indexd81bf5e8db..b0f1720ca1 100644--- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h@@ -37,6 +37,10 @@ extern "C" { #include <rte_atomic.h> #include <rte_ring.h> +#if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG #include <inttypes.h>#endifquoted
+ extern int rtThis is not the best way to fix this. Just always include the header file. Having it conditional can lead to more problems
[Anoob] The header include is only required when RTE_LOG_DP_LEVEL is lower than RTE_LOG_DEBUG. I'm not sure how the tool runs, but it may still flag this include as an unnecessary include. But I can make the change if the tool can ignore this case. @Sean, do you agree with the suggestion?