From owner-freebsd-bugs@FreeBSD.ORG Sun Mar 21 10:30:09 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84F551065670 for ; Sun, 21 Mar 2010 10:30:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 588FE8FC17 for ; Sun, 21 Mar 2010 10:30:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o2LAU86D002446 for ; Sun, 21 Mar 2010 10:30:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o2LAU8bY002445; Sun, 21 Mar 2010 10:30:08 GMT (envelope-from gnats) Date: Sun, 21 Mar 2010 10:30:08 GMT Message-Id: <201003211030.o2LAU8bY002445@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Alexander Best Cc: Subject: Re: kern/144749: [libstand] [patch] make assert.c use abort(3) instead of exit(3) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alexander Best List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 10:30:09 -0000 The following reply was made to PR kern/144749; it has been noted by GNATS. From: Alexander Best To: Cc: Subject: Re: kern/144749: [libstand] [patch] make assert.c use abort(3) instead of exit(3) Date: Sun, 21 Mar 2010 11:27:53 +0100 (CET) This is a MIME encoded multipart message. --+permail-20100321102753f0889e84000028d8-a_best01+ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit John Baldwin proposed the following change: -- Alexander Best --+permail-20100321102753f0889e84000028d8-a_best01+ Content-Type: message/rfc822; charset=us-ascii Content-Description: Re: [patch] small fix to stop gcc warning for lib/libstand/assert.c (fwd) Return-Path: X-Original-To: alexbestms@wwu.de Delivered-To: a_best01@UNI-MUENSTER.DE Received: from zivm-relay3.uni-muenster.de (ZIVM-RELAY3.UNI-MUENSTER.DE [128.176.192.19]) by ZIVMAILSTORE1.UNI-MUENSTER.DE (Postfix) with ESMTP id E6D1D30C938 for ; Mon, 15 Mar 2010 17:05:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AokEAAL4nUtBehEqgWdsb2JhbACacRUBARYkIrlIhHsE X-IronPort-AV: E=Sophos;i="4.49,644,1262559600"; d="scan'208";a="28469430" Received: from cyrus.watson.org ([65.122.17.42]) by zivm-wwu3.uni-muenster.de with ESMTP; 15 Mar 2010 17:05:33 +0100 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 Subject: Re: [patch] small fix to stop gcc warning for lib/libstand/assert.c Date: Mon, 15 Mar 2010 11:32:18 -0400 User-Agent: KMail/1.12.4 (FreeBSD/7.3-PRERELEASE; KDE/4.3.4; i386; ; ) Cc: Alexander Best 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 X-UID: 1391 Status: RO Content-Length: 1360 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 --+permail-20100321102753f0889e84000028d8-a_best01+--