Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

assert(3)

Name

assert − program verification

Syntax

#include <assert.h>

assert(expression)

Description

The assert macro indicates expression is expected to be true at this point in the program.  It causes an abort() with a diagnostic comment on the standard error when expression is false (0).  Compiling with the cc() option −DNDEBUG effectively deletes assert from the program.

Diagnostics

‘Assertion failed: a, file f n’.  The a is the assertion that failed; f is the source file and n the source line number of the assert statement.

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