GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ASSERT (3)

NAME

assert - expression verification macro

CONTENTS

Synopsis
Description
Examples
See Also
Standards
History

SYNOPSIS


.In assert.h assert expression

DESCRIPTION

The assert macro tests the given expression and if it is false, the calling process is terminated. A diagnostic message is written to stderr and the function abort(3) is called, effectively terminating the program.

If expression is true, the assert macro does nothing.

The assert macro may be removed at compile time by defining NDEBUG as a macro (e.g., by using the cc(1) option -D NDEBUG).

EXAMPLES

The assertion:

    assert(1 == 0);

generates a diagnostic message similar to the following:

    Assertion failed: (1 == 0), function main, file assertion.c, line 100.

SEE ALSO

abort(3)

STANDARDS

The assert macro conforms to -isoC-99.

HISTORY

An assert macro appeared in AT&T v6 .
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.