From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 15 16:05:32 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F928106564A for ; Mon, 15 Mar 2010 16:05:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D22998FC14 for ; Mon, 15 Mar 2010 16:05:31 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 84DF546B8C; Mon, 15 Mar 2010 12:05:31 -0400 (EDT) Received: from zion.baldwin.cx (pool-98-109-181-99.nwrknj.fios.verizon.net [98.109.181.99]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 8CEB48A021; Mon, 15 Mar 2010 12:05:30 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 15 Mar 2010 11:32:18 -0400 User-Agent: KMail/1.12.4 (FreeBSD/7.3-PRERELEASE; KDE/4.3.4; i386; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201003151132.18617.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 15 Mar 2010 12:05:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=4.2 tests=AWL,BAYES_00, FH_HOST_EQ_VERIZON_P,RDNS_DYNAMIC autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Alexander Best Subject: Re: [patch] small fix to stop gcc warning for lib/libstand/assert.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Mar 2010 16:05:32 -0000 On Saturday 13 March 2010 08:52:19 am Alexander Best wrote: > hello, > > this patch fixes the following gcc warning: > > /usr/src/lib/libstand/assert.c:43: warning: implicit declaration of > function 'exit' > > by using abort() instead of exit() (which is illegal anyway). looking at > lib/libc/gen/assert.c abort() seems save to use instead of exit(). There is no abort() in libstand or any of the boot code. If you built a full world with this change you should have gotten a link error for /boot/loader. exit() is required by the boot code however (see sys/boot/common/panic.c). The use of exit() instead of abort() here is on purpose. This is the fix I would use. I would not add 'exit()' to as it is not an interface that libstand provides, but one that it requires from the environment it is linked with. Index: assert.c =================================================================== --- assert.c (revision 204953) +++ assert.c (working copy) @@ -31,6 +31,8 @@ #include "stand.h" +void exit(int); + void __assert(const char *func, const char *file, int line, const char *expression) { @@ -40,5 +42,5 @@ else printf("Assertion failed: (%s), function %s, file %s, line " "%d.\n", expression, func, file, line); - exit(); + exit(1); } -- John Baldwin