Query: assert
OS: osf1
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
assert(3) Library Functions Manual assert(3)NAMEassert - Inserts program diagnosticsLIBRARYStandard C Library (libc.a, libc.so)SYNOPSIS#include <assert.h> void assert( int expression) ;STANDARDSInterfaces documented on this reference page conform to industry standards as follows: assert(): XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags.PARAMETERSSpecifies an expression that is evaluated as TRUE or FALSE. This expression is evaluated in the same manner as a C language if control statement.DESCRIPTIONThe assert() macro inserts diagnostics into programs. On execution, when the expression parameter is false (returns FALSE), this macro writes information about the particular call that failed, including the text of the argument, the name of the source file, and the source- file line number (the latter two are respectively the values of preprocessing macros __FILE__ and __LINE__) on stderr. The error message is taken from the standard C library message catalog. The assert() macro then calls the abort() function to (normally) terminate the process. When you compile a program with the -DNDEBUG preprocessor option, or with the #define NDEBUG preprocessor control statement before the #include <assert.h> statement, calls to the assert() macro have no effect.RETURN VALUESThe assert() function returns no value.RELATED INFORMATIONRoutines: abort(3) Standards: standards(5) delim off assert(3)