Macros | |
#define | MBED_ASSERT(expr) |
MBED_ASSERT Declare runtime assertions: results in runtime error if condition is false. More... | |
#define | MBED_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg) |
MBED_STATIC_ASSERT Declare compile-time assertions, results in compile-time error if condition is false. More... | |
#define | MBED_STRUCT_STATIC_ASSERT(expr, message) MBED_STATIC_ASSERT(expr, message) |
MBED_STRUCT_STATIC_ASSERT Declare compile-time assertions, results in compile-time error if condition is false. More... | |
Functions | |
MBED_NORETURN void | mbed_assert_internal (const char *expr, const char *file, int line) |
Internal mbed assert function which is invoked when MBED_ASSERT macro fails. More... | |
#define MBED_ASSERT | ( | expr | ) |
MBED_ASSERT Declare runtime assertions: results in runtime error if condition is false.
Definition at line 65 of file mbed_assert.h.
#define MBED_STATIC_ASSERT | ( | expr, | |
msg | |||
) | _Static_assert(expr, msg) |
MBED_STATIC_ASSERT Declare compile-time assertions, results in compile-time error if condition is false.
The assertion acts as a declaration that can be placed at file scope, in a code block (except after a label), or as a member of a C++ class/struct/union.
static_assert
instead. For C this is provided by <assert.h>
, and for C++ it is a built-in keyword. Definition at line 98 of file mbed_assert.h.
#define MBED_STRUCT_STATIC_ASSERT | ( | expr, | |
message | |||
) | MBED_STATIC_ASSERT(expr, message) |
MBED_STRUCT_STATIC_ASSERT Declare compile-time assertions, results in compile-time error if condition is false.
Previous supported compiler languages would not allow static_assert to be used within a struct or a class. This is no longer the case. This macro exists for backwards compatibility.
static_assert
instead. For C this is provided by <assert.h>
, and for C++ it is a built-in keyword. Definition at line 120 of file mbed_assert.h.
MBED_NORETURN void mbed_assert_internal | ( | const char * | expr, |
const char * | file, | ||
int | line | ||
) |
Internal mbed assert function which is invoked when MBED_ASSERT macro fails.
This function is active only if NDEBUG is not defined prior to including this assert header file. In case of MBED_ASSERT failing condition, error() is called with the assertation message.
expr | Expression to be checked. |
file | File where assertation failed. |
line | Failing assertation line number. |