assert.3: Minor clean-ups

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-06-03 05:39:05 -05:00
parent f34fcbb86b
commit 4d644289dd
1 changed files with 9 additions and 5 deletions

View File

@ -35,9 +35,11 @@ assert \- abort the program if assertion is false
.BI "void assert(scalar " expression ); .BI "void assert(scalar " expression );
.fi .fi
.SH DESCRIPTION .SH DESCRIPTION
This macro can help programmers find bugs in their programs, or handle exceptional cases This macro can help programmers find bugs in their programs,
via a crash that will produce limited debugging output. The function will print an or handle exceptional cases
error message to standard error, e.g., "assertion failed in file foo.c, function do_bar(), line 1287" via a crash that will produce limited debugging output.
The function will print an error message to standard error
(e.g., "assertion failed in file foo.c, function do_bar(), line 1287")
and terminate the program by calling and terminate the program by calling
.BR abort (3) .BR abort (3)
if if
@ -50,11 +52,13 @@ is defined at the moment
.I <assert.h> .I <assert.h>
was last included, the macro was last included, the macro
.BR assert () .BR assert ()
generates no code, and hence does nothing at all. It is not recommended to define generates no code, and hence does nothing at all.
It is not recommended to define
.B NDEBUG .B NDEBUG
if using if using
.BR assert () .BR assert ()
to detect error conditions since the software may behave non-deterministically. to detect error conditions since the software
may behave non-deterministically.
.SH RETURN VALUE .SH RETURN VALUE
No value is returned. No value is returned.
.SH ATTRIBUTES .SH ATTRIBUTES