assert

OS/161 Reference Manual

Name

assert - check assumptions at run time

Library

Standard C Library (libc, -lc)

Synopsis

#include <assert.h>

assert(expression);

Description

assert checks that its argument evaluates to true. If this is not the case, an error message is printed and abort is called.

assert is a macro. If the macro NDEBUG is defined at compile time, assertion tests are removed.

Caution

Avoid writing assert expressions with side effects, as compiling with NDEBUG may or may not cause the side effects to disappear.