From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard M Stallman Newsgroups: gmane.emacs.devel Subject: Re: emacs' turn: remove useless if-before-free tests Date: Mon, 02 Jun 2008 12:30:53 -0400 Message-ID: References: <87fxryjv2n.fsf@rho.meyering.net> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1212424410 16879 80.91.229.12 (2 Jun 2008 16:33:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Jun 2008 16:33:30 +0000 (UTC) Cc: emacs-devel@gnu.org, jim@meyering.net, monnier@IRO.UMontreal.CA, miles@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 02 18:34:02 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 1K3Cyd-0006xX-R1 for ged-emacs-devel@m.gmane.org; Mon, 02 Jun 2008 18:33:44 +0200 Original-Received: from localhost ([127.0.0.1]:49848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3Cxr-0001Dd-8y for ged-emacs-devel@m.gmane.org; Mon, 02 Jun 2008 12:32:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3Cxi-0001Aq-Q6 for emacs-devel@gnu.org; Mon, 02 Jun 2008 12:32:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3Cxg-00019o-Rq for emacs-devel@gnu.org; Mon, 02 Jun 2008 12:32:46 -0400 Original-Received: from [199.232.76.173] (port=45112 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3Cxg-00019g-Nq for emacs-devel@gnu.org; Mon, 02 Jun 2008 12:32:44 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:41675) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3Cxg-00075R-U5 for emacs-devel@gnu.org; Mon, 02 Jun 2008 12:32:45 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1K3Cvt-0006wq-A5; Mon, 02 Jun 2008 12:30:53 -0400 In-reply-to: (message from YAMAMOTO Mitsuharu on Mon, 02 Jun 2008 11:34:23 +0900) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:98244 Archived-At: IIUC, only when the SIZE argument is 0. I think many programmers have never cared about the NULL-check of the return value of xmalloc where they are sure that its argument is positive. Also we could make xmalloc to return a non-NULL value for the case SIZE==0. Maybe we should make xmalloc give an error when the size is 0.