Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ASSERT(D3DK) — Motorola System V 88k Release 4 Version 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

ASSERT(D3DK)  —  

NAME

ASSERT − verify assertion .IX \f4ASSERT\fP(D3DK)

SYNOPSIS

#include <sys/debug.h>
void ASSERT(int expression);

ARGUMENTS

expressionExpression to be evaluated. 

DESCRIPTION

ASSERT is a debugging interface for verifying program invariants within code that is compiled with the DEBUG compilation option defined.  expression is a boolean expression that the caller expects to evaluate to non-zero (that is, the caller is asserting that the expression has a non-zero value).  If expression evaluates to non-zero, the ASSERT call has no effect.  If expression evaluates to zero, ASSERT causes the system to panic with the following message:

PANIC: assertion failed: expression, file: filename, line: lineno

where filename is the name of the source file in which the failed assertion appears and lineno is the line number of the ASSERT call within the file. 

When the DEBUG compilation option is not defined, ASSERT calls are not compiled into the code, and therefore have no effect. 

RETURN VALUE

If expression evaluates to non-zero, ASSERT returns no value.  If expression evaluates to zero, ASSERT panics the system. 

LEVEL

Base or Interrupt. 

NOTES

Does not sleep. 

Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function. 

SEE ALSO

cmn_err(D3DK)

DDI/DKI (DEBUG)

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