Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

abort(3)

ASSERT(3V)  —  UNKNOWN SECTION OF THE MANUAL

NAME

assert − verify program assertion

SYNOPSIS

#include <assert.h>

assert (expression)
int expression; System V"

DESCRIPTION

assert is a macro that indicates expression is expected to be true at this point in the program.  When it is executed, if expression is false (zero), assert prints

“Assertion failed: expression, file xyz, line nnn”

on the standard error output and aborts.  In the error message, xyz is the name of the source file and nnn the source line number of the assert statement. 

Compiling with the cc(1) option −DNDEBUG, or with the preprocessor control statement “#define NDEBUG” ahead of the “#include <assert.h>” statement, will stop assertions from being compiled into the program. 

SEE ALSO

cc(1), abort(3)

Sun Release 3.2  —  Last change: 30 April 1986

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