From: Ilya V. Matveychikov Date: Sun, 19 Nov 2017 08:18:49 +0000 (+0400) Subject: eal: update assertion macro X-Git-Tag: spdx-start~799 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=65f88eb2842649e442e781d58a0228b3e8970e45;p=dpdk.git eal: update assertion macro Update RTE_VERIFY macro to make it possible to use complex expressions in RTE_ASSERT. Now it’s possible to have % char inside the expression, for example: RTE_ASSERT((sizeof(some_struct) % 64) == 0) Before the patch, “%" sign acts like a conversion specification beginning character. Fixes: 148f963fb532 ("xen: core library changes") Signed-off-by: Ilya V. Matveychikov Reviewed-by: Ferruh Yigit --- diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h index 79b67b3ec3..fbb3bb5e51 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) /*