From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JAqab-00055n-4A for qemu-devel@nongnu.org; Fri, 04 Jan 2008 12:44:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JAqaZ-00051t-4w for qemu-devel@nongnu.org; Fri, 04 Jan 2008 12:44:12 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JAqaZ-00051f-0w for qemu-devel@nongnu.org; Fri, 04 Jan 2008 12:44:11 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JAqaY-0003Pu-Gt for qemu-devel@nongnu.org; Fri, 04 Jan 2008 12:44:10 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] fix possible NULL pointer use in hw/ptimer.c Date: Fri, 4 Jan 2008 17:44:05 +0000 References: <477C489C.1000208@earthlink.net> <200801031402.57809.paul@codesourcery.com> <99DF1970-75E9-4D9D-A6D3-C0F71B2CC6C5@jump-ing.de> In-Reply-To: <99DF1970-75E9-4D9D-A6D3-C0F71B2CC6C5@jump-ing.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801041744.05953.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Hitter , Robert Reif On Friday 04 January 2008, Markus Hitter wrote: > Am 03.01.2008 um 15:02 schrieb Paul Brook: > > Having to check every return value is extremely tedious and (as > > you've proved) easy to miss. > > Checking every return value is a measure for programming reliable code. Never failing is even more reliable. > > If the allocation fails we don't have any viable alternatives, so > > we may as well stop right there. > > Stop != segfault? Yes. > What about a meaningful exit message? "Out of memory" is a fairly comprehensive description of the problem. In fact I'd say it's much more informative than " failed to initialize". Paul