Skip to content
Snippets Groups Projects
Unverified Commit 8fd01363 authored by Kaspar Schleiser's avatar Kaspar Schleiser Committed by GitHub
Browse files

Merge pull request #9136 from jcarrano/fix-assert

core: make assert() an expression.
parents d6c63592 09d1b2ea
No related branches found
No related tags found
No related merge requests found
......@@ -101,10 +101,7 @@ NORETURN void _assert_failure(const char *file, unsigned line);
*
* @see http://pubs.opengroup.org/onlinepubs/9699919799/functions/assert.html
*/
#define assert(cond) \
if (!(cond)) { \
_assert_failure(RIOT_FILE_RELATIVE, __LINE__); \
}
#define assert(cond) ((cond) ? (void)0 : _assert_failure(RIOT_FILE_RELATIVE, __LINE__))
#else
#define assert(cond) ((cond) ? (void)0 : core_panic(PANIC_ASSERT_FAIL, assert_crash_message))
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment