SimGrid  3.13
Versatile Simulation of Distributed Systems
Assert macro familly

Those are the SimGrid version of the good ol' assert macro. More...

Macros

#define xbt_assert(...)
 The condition which failed will be displayed. More...
 
#define _xbt_assert_ARG1(cond)   _xbt_assert_ARGN(cond, "Assertion %s failed", #cond)
 
#define _xbt_assert_ARGN(cond, ...)   do { if (!(cond)) THROWF(0, 0, __VA_ARGS__); } while (0)
 
#define xbt_die(...)
 Kill the program with an error message. More...
 

Functions

void XBT_ATTRIB_NORETURN xbt_abort (void)
 Kill the program in silence. More...
 

Detailed Description

Those are the SimGrid version of the good ol' assert macro.

You can pass them a format message and arguments, just as if it where a printf. It is converted to a XBT_CRITICAL logging request. Be careful: the boolean expression that you want to test should not have side effects, because assertions are disabled at compile time if NDEBUG is set.

Macro Definition Documentation

#define xbt_assert (   ...)

The condition which failed will be displayed.

#define _xbt_assert_ARG1 (   cond)    _xbt_assert_ARGN(cond, "Assertion %s failed", #cond)
#define _xbt_assert_ARGN (   cond,
  ... 
)    do { if (!(cond)) THROWF(0, 0, __VA_ARGS__); } while (0)
#define xbt_die (   ...)
Value:
do { \
XBT_CCRITICAL(xbt, __VA_ARGS__); \
} while (0)
#define XBT_CCRITICAL(categ,...)
Log an event at the CRITICAL priority on the specified category with these args (CCRITICALn exists fo...
Definition: log.h:513
void XBT_ATTRIB_NORETURN xbt_abort(void)
Kill the program in silence.
Definition: xbt_main.c:167

Kill the program with an error message.

Parameters
...a format string and its arguments

Things are so messed up that the only thing to do now, is to stop the program.

The message is handled by a CRITICAL logging request, and may consist of a format string with arguments.

Function Documentation

void XBT_ATTRIB_NORETURN xbt_abort ( void  )

Kill the program in silence.