From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3HFC-0008EU-QQ for qemu-devel@nongnu.org; Sun, 10 May 2009 18:11:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3HF8-0008Bd-8K for qemu-devel@nongnu.org; Sun, 10 May 2009 18:11:38 -0400 Received: from [199.232.76.173] (port=41405 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3HF8-0008Ba-4b for qemu-devel@nongnu.org; Sun, 10 May 2009 18:11:34 -0400 Received: from mx20.gnu.org ([199.232.41.8]:61846) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M3HF7-0002G7-U8 for qemu-devel@nongnu.org; Sun, 10 May 2009 18:11:33 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M3HF6-0007wT-Fk for qemu-devel@nongnu.org; Sun, 10 May 2009 18:11:32 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] suppress 'warn_unused_result' warning Date: Sun, 10 May 2009 23:11:22 +0100 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905102311.27268.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Chih-Min Chao On Sunday 10 May 2009, Chih-Min Chao wrote: > The patch add error handling to functions with 'warn_unused_result' return > value > such as write, read, ftruncate, and realpath. I'm pretty sure this is wrong. It feels a lot like blindly papering over compiler warnings without actually understanding what's going on. In some cases errors are actually an expected part of normal operation. In many other cases you only handle complete failure, and not partial completion. Paul