ASSERT(3V)

NAME
assert - program verification

SYNOPSIS
#include <assert.h>

assert(expression)

DESCRIPTION

assert() is a macro that indicates expression is expected to be true at this point in the program. If expression is false (0), it displays a diagnostic message on the standard output and exits (see exit(2V)). Compiling with the cc(1V) option -DNDEBUG, or placing the preprocessor control statement

    #define NDEBUG

before the ``#include <assert.h>'' statement effectively deletes assert() from the program.

SYSTEM V DESCRIPTION

The System V version of assert() calls abort(3) rather than exit().

SEE ALSO
cc(1V), exit(2V), abort(3)

DIAGNOSTICS

Assertion failed: file f line n
    The expression passed to the assert() statement at line n of source file f was false.

SYSTEM V DIAGNOSTICS

Assertion failed: expression, file f, line n
    The expression passed to the assert() statement at line n of source file f was false.