From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: emacs' turn: remove useless if-before-free tests Date: Mon, 02 Jun 2008 09:56:56 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <87fxryjv2n.fsf@rho.meyering.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1212368235 10278 80.91.229.12 (2 Jun 2008 00:57:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Jun 2008 00:57:15 +0000 (UTC) Cc: Jim Meyering , Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 02 02:57:56 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K2yN2-0007l4-4Y for ged-emacs-devel@m.gmane.org; Mon, 02 Jun 2008 02:57:56 +0200 Original-Received: from localhost ([127.0.0.1]:55523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2yMG-0006BQ-Ce for ged-emacs-devel@m.gmane.org; Sun, 01 Jun 2008 20:57:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2yMB-0006Ay-Nx for emacs-devel@gnu.org; Sun, 01 Jun 2008 20:57:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2yMA-0006AB-0c for emacs-devel@gnu.org; Sun, 01 Jun 2008 20:57:03 -0400 Original-Received: from [199.232.76.173] (port=49722 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2yM9-0006A8-TS for emacs-devel@gnu.org; Sun, 01 Jun 2008 20:57:01 -0400 Original-Received: from ntp.math.s.chiba-u.ac.jp ([133.82.132.2]:57593 helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K2yM9-00017J-M2 for emacs-devel@gnu.org; Sun, 01 Jun 2008 20:57:01 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 3A74C2C40; Mon, 2 Jun 2008 09:56:56 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/23.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-kernel: by monty-python.gnu.org: NetBSD 3.0 (DF) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:98201 Archived-At: >>>>> On Sun, 01 Jun 2008 17:41:02 -0400, Stefan Monnier said: > Sounds like a good cleanup. Feel free to install it unless there's > a strong objection. One possible concern is that it will lose programmer's explicit intention that "this variable may contain either NULL or a return value of xmalloc" in contrast to "this variable always contain a return value of xmalloc". I guess the acceptance of NULL for `free' in POSIX is the reflection of the fact that `malloc' may return NULL. If so, we could take a different policy for `xfree', i.e., abort if NULL, because `xmalloc' may not return NULL unlike malloc. This may help us detect the behavior that is different from programmer's intention. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp