DPDK patches and discussions
 help / color / mirror / Atom feed
* Function to fail at build time?
@ 2025-06-25 23:55 Morten Brørup
  0 siblings, 0 replies; only message in thread
From: Morten Brørup @ 2025-06-25 23:55 UTC (permalink / raw)
  To: dev

I was wondering if this was somehow possible:

#define RTE_VERIFY(exp) do { \
+	if (__rte_constant(exp)) \
+		FAIL_AT_BUILD_TIME(); \
	if (unlikely(!(exp))) \
		rte_panic("line %d\tassert \"%s\" failed\n", __LINE__, #exp); \
} while (0)

I tried static_assert(), but it cannot be used in this way.

-Morten


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-06-26  5:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-25 23:55 Function to fail at build time? Morten Brørup

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).