ASSERT(3)

NAME
assert - program verification

SYNOPSIS
#include <assert.h>

assert(expression)

_BadAssertion(fn, lino, ass)
char *fn, *ass;
unsigned int lino;

DESCRIPTION

Assert is a macro that indicates expression is expected to be true at this point in the program. It causes a call to _BadAssertion when expression is false (0).

The routine accepts three parameters: a filename, a linenumber, and a string representing a failed assertion. It causes a sys_stop(S_ABORT) with a diagnostic comment on standard error.

The assertions are disabled by defining the preprocessor constant NDEBUG.

DIAGNOSTICS
fn, line lino: assertion ass failed.
fn is the source file, lino is the source line number, and ass is the assertion of the assert statement.

MODULES
system(3)

FILES
~em/modules/h/assert.h
~em/modules/lib/libassert.a