OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man3 / assert.3
index 25eec65..2b46e0e 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
-.\" License.
+.\" %%%LICENSE_END
+.\"
 .\" Modified Sat Jul 24 21:42:42 1993 by Rik Faith <faith@cs.unc.edu>
 .\" Modified Tue Oct 22 23:44:11 1996 by Eric S. Raymond <esr@thyrsus.com>
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
 .\"
 .\" Japanese Version Copyright (c) 1996 Kentaro OGAWA
 .\"         all rights reserved.
 .\" Updated Fri  6 Oct JST 2000 by Kentaro Shirakata <argrath@ub32.org>
 .\" Updated Thu 19 Sep JST 2002 by Kentaro Shirakata <argrath@ub32.org>
 .\"
-.TH ASSERT 3  2002-08-25 "GNU" "Linux Programmer's Manual"
-.SH Ì¾Á°
-assert \- ¿ÇÃǤ¬µ¶¤Î»þ¤Ë¥×¥í¥°¥é¥à¤òÃæ»ß¤¹¤ë
-.SH ½ñ¼°
+.TH ASSERT 3 2002\-08\-25 GNU "Linux Programmer's Manual"
+.SH 名前
+assert \- 診断が偽の時にプログラムを中止する
+.SH 書式
 .nf
-.B #include <assert.h>
+\fB#include <assert.h>\fP
 .sp
-.BI "void assert(scalar " expression );
+\fBvoid assert(scalar \fP\fIexpression\fP\fB);\fP
 .fi
-.SH ÀâÌÀ
-.\"O If the macro
-.\"O .B NDEBUG
-.\"O was defined at the moment
-.\"O .I <assert.h>
-.\"O was last included, the macro
-.\"O .BR assert ()
-.\"O generates no code, and hence does nothing at all.
-.I <assert.h>
-¤¬ºÇ¸å¤Ë¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤¿»þÅÀ¤Ç¡¢
-.B NDEBUG
-¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢
-.BR assert ()
-¥Þ¥¯¥í¤Ï²¿¤Î¥³¡¼¥É¤âÀ¸À®¤»¤º¡¢½¾¤Ã¤ÆÁ´¤¯²¿¤â¤·¤Ê¤¤¡£
-.\"O Otherwise, the macro
-.\"O .BR assert ()
-.\"O prints an error message to standard error and terminates the program
-.\"O by calling
-.\"O .BR abort (3)
-.\"O if
-.\"O .I expression
-.\"O is false (i.e., compares equal to zero).
-¤µ¤â¤Ê¤±¤ì¤Ð¡¢
-.BR assert (3)
-¥Þ¥¯¥í¤Ï
-.I expression
-¤¬µ¶¤Î»þ(¤¹¤Ê¤ï¤Á¡¢Èæ³Ó¤Î·ë²Ì¤¬0¤ÈÅù¤·¤¤»þ)¤Ë
-ɸ½à¥¨¥é¡¼½ÐÎϤ˥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¡¢¤µ¤é¤Ë
-.BR abort ()
-¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¡£
+.SH 説明
+\fI<assert.h>\fP が最後にインクルードされた時点で、 \fBNDEBUG\fP マクロが定義されていた場合、 \fBassert\fP()
+マクロは何のコードも生成せず、従って全く何もしない。 さもなければ、 \fBassert\fP(3)  マクロは \fIexpression\fP
+が偽の時(すなわち、比較の結果が0と等しい時)に 標準エラー出力にエラーメッセージを表示し、さらに \fBabort\fP()
+を呼び出すことによって、プログラムを終了させる。
 .LP
-.\"O The purpose of this macro is to help the programmer find bugs in
-.\"O his program.
-.\"O The message "assertion failed in file foo.c, function
-.\"O do_bar(), line 1287" is of no help at all to a user.
-¤³¤Î¥Þ¥¯¥í¤ÎÌÜŪ¤Ï¡¢¥×¥í¥°¥é¥Þ¡¼¤¬¥×¥í¥°¥é¥à¤Î¥Ð¥°¤òȯ¸«¤¹¤ë¼ê½õ¤±¤ò
-¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£"assertion failed in file foo.c, function do_bar(), line 1287"
-¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤Ï¥æ¡¼¥¶¡¼¤Ë¤Ï²¿¤Î½õ¤±¤Ë¤â¤Ê¤é¤Ê¤¤¡£
-.SH ÊÖ¤êÃÍ
-ÃͤÏÊÖ¤µ¤ì¤Ê¤¤¡£
-.SH ½àµò
-.\"O POSIX.1-2001, C89, C99.
-.\"O In C89,
-.\"O .B expression
-.\"O is required to be of type
-.\"O .I int
-.\"O and undefined behavior results if it is not, but in C99
-.\"O it may have any scalar type.
-POSIX.1-2001, C89, C99.
-C89 ¤Ç¤Ï
-.B expression
-¤Ï
-.I int
-·¿¤Ç¤¢¤ë¤³¤È¤¬É¬ÍפȤµ¤ì¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤ÎÆ°ºî¤Ï̤ÄêµÁ¤È¤µ¤ì¤Æ¤¤¤¿¡£
-¤·¤«¤· C99 ¤Ç¤Ï¤É¤Î¤è¤¦¤Ê¥¹¥«¥éÃͤǤâ¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤¿¡£
-.\"O .\" See Defect Report 107 for more details.
-.\" ¾ÜºÙ¤ÏÉÔ¶ñ¹çÊó¹ð 107 ¤ò»²¾È¤Î¤³¤È¡£
-.SH ¥Ð¥°
-.\"O .BR assert ()
-.\"O is implemented as a macro; if the expression tested has side-effects,
-.\"O program behavior will be different depending on whether
-.\"O .B NDEBUG
-.\"O is defined.
-.\"O This may create Heisenbugs which go away when debugging
-.\"O is turned on.
-.BR assert ()
-¤Ï¡¢¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£¤¹¤Ê¤ï¤Á¡¢
-»î¤µ¤ì¤Æ¤¤¤ë¼°¤¬ÉûºîÍѤò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
-¥Þ¥¯¥í
-.B NDEBUG
-¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë°Í¸¤·¤Æ¡¢¥×¥í¥°¥é¥à¤Î¿¶Éñ¤¤¤Ï°Û¤Ê¤ë¤À¤í¤¦¡£
-¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¥Ð¥°½Ð¤·¤¹¤ë¤È¤­¤Ë¤Ï¾Ã¤¨¤Æ¤·¤Þ¤¦
-¥Ï¥¤¥¼¥ó¥Ð¥°(Heisenbugs)¤òÀ¸¤ß½Ð¤¹¤À¤í¤¦¡£
-.SH ´ØÏ¢¹àÌÜ
-.BR abort (3),
-.BR assert_perror (3),
-.BR exit (3)
+このマクロの目的は、プログラマーがプログラムのバグを発見する手助けを することである。"assertion failed in file foo.c,
+function do_bar(), line 1287" というメッセージはユーザーには何の助けにもならない。
+.SH 返り値
+値は返されない。
+.SH 準拠
+.\" See Defect Report 107 for more details.
+POSIX.1\-2001, C89, C99.  C89 では \fBexpression\fP は \fIint\fP
+型であることが必要とされ、そうでない場合の動作は未定義とされていた。 しかし C99 ではどのようなスカラ値でもよいことになった。
+.SH バグ
+\fBassert\fP()  は、マクロとして実装されている。すなわち、 試されている式が副作用を持っている場合には、 マクロ \fBNDEBUG\fP
+が定義されているかどうかに依存して、プログラムの振舞いは異なるだろう。 これによって、バグ出しするときには消えてしまう
+ハイゼンバグ(Heisenbugs)を生み出すだろう。
+.SH 関連項目
+\fBabort\fP(3), \fBassert_perror\fP(3), \fBexit\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。