Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

abort(3)

assert(3)  —  Subroutines

OSF

NAME

assert − Inserts program diagnostics

LIBRARY

Standard C Library (libc.a)

SYNOPSIS

#include <assert.h>

void assert(
    int expression) ;

PARAMETERS

expressionSpecifies an expression that is evaluated as TRUE or FALSE. This expression is evaluated in the same manner as a C language if control statement. 

DESCRIPTION

The 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.  Also, the abort() function produces a software abort fault. 

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. 

NOTES

AES Support Level:
Full use

RETURN VALUES

The assert() function returns no value. 

RELATED INFORMATION

Functions: abort(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026