From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N7ajX-0006Ko-4x for mharc-grub-devel@gnu.org; Mon, 09 Nov 2009 15:21:03 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7ajV-0006Kb-AM for grub-devel@gnu.org; Mon, 09 Nov 2009 15:21:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7ajQ-0006K1-Si for grub-devel@gnu.org; Mon, 09 Nov 2009 15:21:01 -0500 Received: from [199.232.76.173] (port=45055 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7ajQ-0006Jy-N8 for grub-devel@gnu.org; Mon, 09 Nov 2009 15:20:56 -0500 Received: from smarthost02.mail.zen.net.uk ([212.23.3.141]:39795) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N7ajQ-0005Qw-CV for grub-devel@gnu.org; Mon, 09 Nov 2009 15:20:56 -0500 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1N7ajP-0006Du-6X for grub-devel@gnu.org; Mon, 09 Nov 2009 20:20:55 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1N7ajO-0001w4-00; Mon, 09 Nov 2009 20:20:54 +0000 Date: Mon, 9 Nov 2009 20:20:54 +0000 From: Colin Watson To: The development of GNU GRUB Message-ID: <20091109202054.GJ28534@riva.ucam.org> References: <4AE95BEC.4040102@gmail.com> <4AE96168.8070605@gmail.com> <20091109161653.GA5006@thorin> <20091109200450.GB15993@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091109200450.GB15993@thorin> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost02-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: warn_unused_result attribute (Re: mingw32 compile fixes (Re: [GITGRUB] New menu interface (implementation))) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 20:21:01 -0000 On Mon, Nov 09, 2009 at 09:04:50PM +0100, Robert Millan wrote: > On Tue, Nov 10, 2009 at 12:46:06AM +0800, Bean wrote: > > Some system such as ubuntu karmic define write using > > warn_unused_result attribute, which cause a warning when return value > > of write is not used. As grub compile with -Werror, this turn into > > error, to work around it, use something like this: > > > > ssize_t tmp = write(bcat, buf, 2048); > > (void) tmp; > > Isn't "(void) write (bcat, buf, 2048)" enough? You'd think so, but sadly that doesn't affect gcc warn_unused_result. Usually I do something like 'if (write (...) < 0) /* ignore error */;'. -- Colin Watson [cjwatson@ubuntu.com]