Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ assert(3) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

abort

cpp



ASSERT(3,L)                 AIX Technical Reference                 ASSERT(3,L)



-------------------------------------------------------------------------------
assert



PURPOSE

Verifies a program assertion.

LIBRARY

Standard C Library (libc.a)

SYNTAX

#include <assert.h>

void assert (expression)
int  expression;

DESCRIPTION

The assert macro puts diagnostics into a program.  If expression is false
(zero), then assert writes the following message on the standard error output
and aborts the program:

    "Assertion failed: "expression", file "filename", line "linenum

In the error message, filename is the name of the source file and linenum is
the source line number of the assert statement.

If you compile a program with the preprocessor option -DNDEBUG, or with the
preprocessor control statement #define NDEBUG ahead of the #include <assert.h>
statement, assertions will not be compiled into the program.

RELATED INFORMATION

In this book:  "abort."

The cpp command in AIX Operating System Commands Reference.















Processed November 7, 1990        ASSERT(3,L)                                 1



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