1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Modified Sat Jul 24 21:42:42 1993 by Rik Faith <faith@cs.unc.edu>
24 .\" Modified Tue Oct 22 23:44:11 1996 by Eric S. Raymond <esr@thyrsus.com>
26 .\" Japanese Version Copyright (c) 1996 Kentaro OGAWA
27 .\" all rights reserved.
28 .\" Translated Sun, 14 Jul 1996 01:33:26 +0900
29 .\" by Kentaro OGAWA <k_ogawa@oyna.cc.muroran-it.ac.jp>
30 .\" Updated Fri 6 Oct JST 2000 by Kentaro Shirakata <argrath@ub32.org>
31 .\" Updated Thu 19 Sep JST 2002 by Kentaro Shirakata <argrath@ub32.org>
33 .TH ASSERT 3 2002-08-25 "GNU" "Linux Programmer's Manual"
35 assert \- ¿ÇÃǤ¬µ¶¤Î»þ¤Ë¥×¥í¥°¥é¥à¤òÃæ»ß¤¹¤ë
38 .B #include <assert.h>
40 .BI "void assert(scalar " expression );
44 ¤¬ºÇ¸å¤Ë¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤¿»þÅÀ¤Ç¡¢
46 ¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢
48 ¥Þ¥¯¥í¤Ï²¿¤Î¥³¡¼¥É¤âÀ¸À®¤»¤º¡¢½¾¤Ã¤ÆÁ´¤¯²¿¤â¤·¤Ê¤¤¡£
53 ¤¬µ¶¤Î»þ(¤¹¤Ê¤ï¤Á¡¢Èæ³Ó¤Î·ë²Ì¤¬0¤ÈÅù¤·¤¤»þ)¤Ë
54 ɸ½à¥¨¥é¡¼½ÐÎϤ˥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¡¢¤µ¤é¤Ë
56 ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥×¥í¥°¥é¥à¤ò½ªÎ»¤µ¤»¤ë¡£
58 ¤³¤Î¥Þ¥¯¥í¤ÎÌÜŪ¤Ï¡¢¥×¥í¥°¥é¥Þ¡¼¤¬¥×¥í¥°¥é¥à¤Î¥Ð¥°¤òȯ¸«¤¹¤ë¼ê½õ¤±¤ò
59 ¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£"assertion failed in file foo.c, function do_bar(), line 1287"
60 ¤È¤¤¤¦¥á¥Ã¥»¡¼¥¸¤Ï¥æ¡¼¥¶¡¼¤Ë¤Ï²¿¤Î½õ¤±¤Ë¤â¤Ê¤é¤Ê¤¤¡£
64 POSIX.1-2001, C89, C99.
69 ·¿¤Ç¤¢¤ë¤³¤È¤¬É¬ÍפȤµ¤ì¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤ÎÆ°ºî¤Ï̤ÄêµÁ¤È¤µ¤ì¤Æ¤¤¤¿¡£
70 ¤·¤«¤· C99 ¤Ç¤Ï¤É¤Î¤è¤¦¤Ê¥¹¥«¥éÃͤǤâ¤è¤¤¤³¤È¤Ë¤Ê¤Ã¤¿¡£
71 .\" ¾ÜºÙ¤ÏÉÔ¶ñ¹çÊó¹ð 107 ¤ò»²¾È¤Î¤³¤È¡£
74 ¤Ï¡¢¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£¤¹¤Ê¤ï¤Á¡¢
75 »î¤µ¤ì¤Æ¤¤¤ë¼°¤¬ÉûºîÍѤò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
78 ¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ë°Í¸¤·¤Æ¡¢¥×¥í¥°¥é¥à¤Î¿¶Éñ¤¤¤Ï°Û¤Ê¤ë¤À¤í¤¦¡£
79 ¤³¤ì¤Ë¤è¤Ã¤Æ¡¢¥Ð¥°½Ð¤·¤¹¤ë¤È¤¤Ë¤Ï¾Ã¤¨¤Æ¤·¤Þ¤¦
80 ¥Ï¥¤¥¼¥ó¥Ð¥°(Heisenbugs)¤òÀ¸¤ß½Ð¤¹¤À¤í¤¦¡£
83 .BR assert_perror (3),