[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

assert Macro

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 error messages into a program. If the specified expression is false, the assert macro writes the following message to standard error and stops the program:

Assertion failed: Expression, file FileName, line LineNumber

In the error message, the FileName value is the name of the source file and the LineNumber value is the source line number of the assert statement.

Parameters

Expression Specifies an expression that can be evaluated as true or false. This expression is evaluated in the same manner as the C language IF statement.

Related Information

The abort (abort Subroutine) subroutine.

The cpp command.

Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]