ADV-utils v1.28.1
Collection of useful C utilities (MISRA-compliant)
Loading...
Searching...
No Matches
Assertions

Simple assert macro. More...

Macros

#define ADVUTILS_USE_ASSERT_ALWAYS
 Define to keep ADVUTILS_ASSERT active in release builds, routed to the same handler as in debug.
 
#define ADVUTILS_ASSERT(x)
 User-overridable assertion. Active when either DEBUG or ADVUTILS_USE_ASSERT_ALWAYS is defined, and compiled out otherwise. The built-in handler traps in an infinite loop; define ADVUTILS_ASSERT directly, or supply ADVUTILS_ASSERT_HEADER, to log, trap to a fault handler or invoke a user callback instead.
 

Detailed Description

Simple assert macro.

Macro Definition Documentation

◆ ADVUTILS_ASSERT

#define ADVUTILS_ASSERT (   x)
Value:
do { \
if ((x) == 0U) { \
for (;;) { \
; \
} \
} \
} while (0)

User-overridable assertion. Active when either DEBUG or ADVUTILS_USE_ASSERT_ALWAYS is defined, and compiled out otherwise. The built-in handler traps in an infinite loop; define ADVUTILS_ASSERT directly, or supply ADVUTILS_ASSERT_HEADER, to log, trap to a fault handler or invoke a user callback instead.