Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ assert(3) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

abort

cpp

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 fol-
     lowing 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> state-
     ment, assertions will not be compiled into the program.

Related Information

     In this book:  "abort."

     The cpp  command in AIX Operating  System Commands Refer-
     ence.

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