aasssseerrtt() -- Macro Diagnostics (assert.h)

Check assertion at run time
#iinncclluuddee <aasssseerrtt.hh>
vvooiidd aasssseerrtt(_o_u_t_c_o_m_e)
iinntt _o_u_t_c_o_m_e;

aasssseerrtt() checks  the value of _o_u_t_c_o_m_e,  which usually is the  product of an
expression.  If _o_u_t_c_o_m_e is false  (zero), aasssseerrtt() sends a message into the
standard-error stream  and calls eexxiitt(). It is useful  for verifying that a
necessary condition is true.

The error message includes the text  of the assertion that failed, the name
of the  source file,  and the  line within the  source file that  holds the
expression in question.   These last two elements consist, respectively, of
the values of the preprocessor macros _ _FFIILLEE_ _ and _ _LLIINNEE_ _.

aasssseerrtt() calls eexxiitt(), which never returns.

To turn off aasssseerrtt(), define the macro NNDDEEBBUUGG prior to including the header
aasssseerrtt.hh. This forces aasssseerrtt() to be redefined as

    #define assert(ignore)

_S_e_e _A_l_s_o
eexxiitt(), aasssseerrtt.hh, CC pprreepprroocceessssoorr
ANSI Standard, section 7.2.1.1
POSIX Standard, section 8.1

_N_o_t_e_s
The ANSI Standard  requires that aasssseerrtt() be implemented as  a macro, not a
library function.  If a program suppresses the macro definition in favor of
a function call, its behavior is undefined.

Turning off  aasssseerrtt() with the macro  NNDDEEBBUUGG will affect the  behavior of a
program if the expression being evaluated normally generates side effects.

aasssseerrtt() is  useful for debugging, and for  testing boundary conditions for
which more graceful error recovery has not yet been implemented.
