Copyright (c) 1993 by Thomas Koenig (firstname.lastname@example.org) %%%LICENSE_START(VERBATIM) Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this on...
NAMEassert - abort the program if assertion is false
#include <assert.h> void assert(scalar expression);
DESCRIPTIONIf the macro NDEBUG was defined at the moment <assert.h> was last included, the macro assert() generates no code, and hence does nothing at all. Otherwise, the macro assert() prints an error message to standard error and terminates the program by calling abort(3) if expression is false (i.e., compares equal to zero).
The purpose of this macro is to help programmers find bugs in their programs. The message "assertion failed in file foo.c, function do_bar(), line 1287" is of no help at all to a user.
RETURN VALUENo value is returned.
ATTRIBUTESFor an explanation of the terms used in this section, see attributes(7).