From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N7bSt-0006Jz-Kb for mharc-grub-devel@gnu.org; Mon, 09 Nov 2009 16:07:55 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7bSs-0006Ik-1Q for grub-devel@gnu.org; Mon, 09 Nov 2009 16:07:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7bSn-0006EG-9D for grub-devel@gnu.org; Mon, 09 Nov 2009 16:07:53 -0500 Received: from [199.232.76.173] (port=46487 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7bSn-0006E5-2V for grub-devel@gnu.org; Mon, 09 Nov 2009 16:07:49 -0500 Received: from xvm-190-8.ghst.net ([217.70.190.8]:43417 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7bSm-000653-JS for grub-devel@gnu.org; Mon, 09 Nov 2009 16:07:48 -0500 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1N7bSl-0001ZS-Aw for grub-devel@gnu.org; Mon, 09 Nov 2009 22:07:47 +0100 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1N7bSk-0004bC-Ed for grub-devel@gnu.org; Mon, 09 Nov 2009 22:07:46 +0100 Date: Mon, 9 Nov 2009 22:07:46 +0100 From: Robert Millan To: The development of GNU GRUB Message-ID: <20091109210746.GB17646@thorin> References: <4AE96168.8070605@gmail.com> <20091109161653.GA5006@thorin> <20091109200450.GB15993@thorin> <1257797433.2967.13.camel@fz.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1257797433.2967.13.camel@fz.local> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) 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 21:07:54 -0000 On Mon, Nov 09, 2009 at 09:10:33PM +0100, Felix Zielcke wrote: > Am Montag, den 09.11.2009, 21:04 +0100 schrieb Robert Millan: > > 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? > > Why not just check the return code and print a warning (or maybe even > error) for tmp != 2048? Of course... shame on us. A proper fix was so easy and we were still looking for the workaround :-) Thanks Felix. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."