From owner-cvs-all Mon Jul 23 4:17:41 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id DCB3237B403; Mon, 23 Jul 2001 04:17:32 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id VAA18817; Mon, 23 Jul 2001 21:17:19 +1000 Date: Mon, 23 Jul 2001 21:14:06 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Warner Losh Cc: Wes Peters , Assar Westerlund , Brian Somers , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libutil ecalloc.c emalloc.3 emalloc.c erealloc.c estrdup.c Makefile libutil.h In-Reply-To: <200107230624.f6N6Ooo87330@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 23 Jul 2001, Warner Losh wrote: > In message <001c01c1133a$f2b9ac50$24b244cc@blabber> "Wes Peters" writes: > : I agree with Alfred, I really don't like the idea of a program exiting > : willy-nilly and feel this will encourage developers to do so. It is > : marginally better than not testing return values at all, and hoping > : for a core file, but only marginally so. The fact that it has been > : done alot in existing code doesn't make it a good practice, just a > : common one. > > And they should *NEVER* be used in a library. Libraries that exit > instead of returning an error are lame beyond words. I don't think we > want to introduce APIs that are safe in cat.c, but unsafe in libc. Yes, most exit() and err*() calls in libraries are bugs. Other problems with this idea: - the new functions don't belong in libutil for various reasons: + libutil should not be a home for miscellaneous functions. + shared linkage to another library is a pessimization (always in time and perhaps in space too). - these functions are often named xmalloc(), etc. (e.g., in gnu utilities). Are you going to changes all these too? (Certainly not in contrib). I noticed new copies of these functions growing faster than the initial version of this change was reviewed. There is another set in rcorder. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message