70 lines
1.1 KiB
HTML
70 lines
1.1 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>assert(3)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>assert(3)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
assert - program verification
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>#include</STRONG> <STRONG><assert.h></STRONG>
|
|
|
|
<STRONG>void</STRONG> <STRONG>assert(int</STRONG> <EM>expression</EM><STRONG>)</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
<STRONG>Assert</STRONG> is a macro that indicates <EM>expression</EM> is expected to be true at
|
|
this point in the program. It causes an <STRONG><A HREF="../man3/abort.3.html">abort(3)</A></STRONG> with a diagnostic
|
|
comment on the standard output when <EM>expression</EM> is false (0). Compiling
|
|
with the <STRONG><A HREF="../man1/cc.1.html">cc(1)</A></STRONG> option <STRONG>-DNDEBUG</STRONG> effectively deletes <STRONG>assert</STRONG> from the
|
|
program.
|
|
|
|
|
|
</PRE>
|
|
<H2>DIAGNOSTICS</H2><PRE>
|
|
`Assertion "<EM>expression</EM>" failed: file <EM>f</EM> line <EM>n</EM>.' <EM>F</EM> is the source file and
|
|
<EM>n</EM> the source line number of the <STRONG>assert</STRONG> statement.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|