unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

ASSERT(3V)                                                          ASSERT(3V)



NAME
       assert - program verification

SYNOPSIS
       #include <&lt;assert.h>&gt;

       assert(expression)

DESCRIPTION
       assert() is a macro that indicates expression is expected to be true at
       this point in the program.  If expression is false (0), it  displays  a
       diagnostic  message  on  the  standard output and exits (see exit(2V)).
       Compiling with the cc(1V) option -DNDEBUG, or placing the  preprocessor
       control statement

              #define NDEBUG

       before   the  ``#include  <&lt;assert.h>&gt;''  statement  effectively  deletes
       assert() from the program.

SYSTEM V DESCRIPTION
       The System V version of assert() calls abort(3) rather than exit().

SEE ALSO
       cc(1V), exit(2V), abort(3)

DIAGNOSTICS
       Assertion failed: file f line n
              The expression passed to the assert() statement  at  line  n  of
              source file f was false.

SYSTEM V DIAGNOSTICS
       Assertion failed: expression, file f, line n
              The  expression  passed  to  the assert() statement at line n of
              source file f was false.



                                6 October 1989                      ASSERT(3V)