assert()

NAME

assert() - expression verification macro

SYNOPSIS

#include <assert.h>

assert (expression)

DESCRIPTION

The assert(3) macro tests the given expression. If it is true, assert(3) does nothing. If it is false, the calling process is terminated, a diagnostic message is written to the stderr and the function _exit(2) is called, effectively terminating the program.

At compile time, you may remove the assert(3) macro by #defining the NDEBUG macro before the inclusion of <assert.h>, usually by giving the compiler the -DNDEBUG option (see your compiler documentation).

DIAGNOSTICS

The following diagnostic message is written to stderr if expression is false:

"assertion \"%s\" failed: file \"%s\", line %d0, \
			"expression", __FILE__, __LINE__);