From owner-freebsd-bugs@FreeBSD.ORG Sun Mar 14 23:40:07 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 9054E106566C for ; Sun, 14 Mar 2010 23:40:07 +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 6DB6C8FC13 for ; Sun, 14 Mar 2010 23:40:07 +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 o2ENe68q000423 for ; Sun, 14 Mar 2010 23:40:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o2ENe6ug000422; Sun, 14 Mar 2010 23:40:06 GMT (envelope-from gnats) Resent-Date: Sun, 14 Mar 2010 23:40:06 GMT Resent-Message-Id: <201003142340.o2ENe6ug000422@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alexander Best Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EAEC1065672 for ; Sun, 14 Mar 2010 23:30:45 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 4DA708FC14 for ; Sun, 14 Mar 2010 23:30:45 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o2ENUi2B065608 for ; Sun, 14 Mar 2010 23:30:44 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o2ENUimQ065607; Sun, 14 Mar 2010 23:30:44 GMT (envelope-from nobody) Message-Id: <201003142330.o2ENUimQ065607@www.freebsd.org> Date: Sun, 14 Mar 2010 23:30:44 GMT From: Alexander Best To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/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 List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2010 23:40:07 -0000 >Number: 144749 >Category: misc >Synopsis: [libstand] [patch] make assert.c use abort(3) instead of exit(3) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Mar 14 23:40:06 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Alexander Best >Release: 9.0-CURRENT >Organization: >Environment: FreeBSD otaku 9.0-CURRENT FreeBSD 9.0-CURRENT #8 r205019M: Thu Mar 11 21:03:33 CET 2010 root@otaku:/usr/obj/usr/src/sys/ARUNDEL amd64 >Description: gcc complaints about the use of exit() in assert.c: /usr/src/lib/libstand/assert.c:43: warning: implicit declaration of function 'exit' the attached patch replaces exit() (which is used illegally anyway, because no integer argument is being supplied) with abort(). assert.c uses stand.h which conflicts with stdlib.h. so this patch also defines abort() in stand.h being an external function. cheers. alex >How-To-Repeat: cd /usr/src/lib/libstand && make >Fix: Patch attached with submission follows: Index: lib/libstand/assert.c =================================================================== --- lib/libstand/assert.c (revision 205121) +++ lib/libstand/assert.c (working copy) @@ -40,5 +40,5 @@ else printf("Assertion failed: (%s), function %s, file %s, line " "%d.\n", expression, func, file, line); - exit(); + abort(); } Index: lib/libstand/stand.h =================================================================== --- lib/libstand/stand.h (revision 205121) +++ lib/libstand/stand.h (working copy) @@ -265,6 +265,7 @@ extern char *optarg; /* getopt(3) external variables */ extern int optind, opterr, optopt, optreset; extern int getopt(int, char * const [], const char *); +extern void abort(void); /* pager.c */ extern void pager_open(void); >Release-Note: >Audit-Trail: >Unformatted: