DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] debug: update assertion macro
@ 2017-11-19  8:18 Ilya Matveychikov
  2017-11-19 14:41 ` Ilya Matveychikov
  0 siblings, 1 reply; 4+ messages in thread
From: Ilya Matveychikov @ 2017-11-19  8:18 UTC (permalink / raw)
  To: dev

Update RTE_VERIFY macro to make it possible to use complex expressions
in RTE_ASSERT.

Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>

Fixes: 148f963fb532 ("xen: core library changes")
Cc: bruce.richardson@intel.com

---
Now it's incorrect to use complex expressions for assertion
like RTE_ASSERT((1 + 2) == 3). This patch makes it possible.

 lib/librte_eal/common/include/rte_debug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h
index 79b67b3ec..fbb3bb5e5 100644
--- a/lib/librte_eal/common/include/rte_debug.h
+++ b/lib/librte_eal/common/include/rte_debug.h
@@ -86,7 +86,7 @@ void rte_dump_registers(void);
 #endif
 #define	RTE_VERIFY(exp)	do {                                                  \
 	if (unlikely(!(exp)))                                                           \
-		rte_panic("line %d\tassert \"" #exp "\" failed\n", __LINE__); \
+		rte_panic("line %d\tassert \"%s\" failed\n", __LINE__, #exp); \
 } while (0)

 /*
--
2.15.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-22  2:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-19  8:18 [dpdk-dev] [PATCH] debug: update assertion macro Ilya Matveychikov
2017-11-19 14:41 ` Ilya Matveychikov
2017-12-15 19:56   ` Ferruh Yigit
2017-12-22  2:12     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).