OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / release / man3 / assert.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified Sat Jul 24 21:42:42 1993 by Rik Faith <faith@cs.unc.edu>
26 .\" Modified Tue Oct 22 23:44:11 1996 by Eric S. Raymond <esr@thyrsus.com>
27 .\"*******************************************************************
28 .\"
29 .\" This file was generated with po4a. Translate the source file.
30 .\"
31 .\"*******************************************************************
32 .TH ASSERT 3 2002\-08\-25 GNU "Linux Programmer's Manual"
33 .SH 名前
34 assert \- 診断が偽の時にプログラムを中止する
35 .SH 書式
36 .nf
37 \fB#include <assert.h>\fP
38 .sp
39 \fBvoid assert(scalar \fP\fIexpression\fP\fB);\fP
40 .fi
41 .SH 説明
42 \fI<assert.h>\fP が最後にインクルードされた時点で、 \fBNDEBUG\fP マクロが定義されていた場合、 \fBassert\fP()
43 マクロは何のコードも生成せず、従って全く何もしない。 さもなければ、 \fBassert\fP(3)  マクロは \fIexpression\fP
44 が偽の時(すなわち、比較の結果が0と等しい時)に 標準エラー出力にエラーメッセージを表示し、さらに \fBabort\fP()
45 を呼び出すことによって、プログラムを終了させる。
46 .LP
47 このマクロの目的は、プログラマーがプログラムのバグを発見する手助けを することである。"assertion failed in file foo.c,
48 function do_bar(), line 1287" というメッセージはユーザーには何の助けにもならない。
49 .SH 返り値
50 値は返されない。
51 .SH 準拠
52 .\" See Defect Report 107 for more details.
53 POSIX.1\-2001, C89, C99.  C89 では \fBexpression\fP は \fIint\fP
54 型であることが必要とされ、そうでない場合の動作は未定義とされていた。 しかし C99 ではどのようなスカラ値でもよいことになった。
55 .SH バグ
56 \fBassert\fP()  は、マクロとして実装されている。すなわち、 試されている式が副作用を持っている場合には、 マクロ \fBNDEBUG\fP
57 が定義されているかどうかに依存して、プログラムの振舞いは異なるだろう。 これによって、バグ出しするときには消えてしまう
58 ハイゼンバグ(Heisenbugs)を生み出すだろう。
59 .SH 関連項目
60 \fBabort\fP(3), \fBassert_perror\fP(3), \fBexit\fP(3)
61 .SH この文書について
62 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
63 である。プロジェクトの説明とバグ報告に関する情報は
64 http://www.kernel.org/doc/man\-pages/ に書かれている。