From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N7aZc-0001aE-5d for mharc-grub-devel@gnu.org; Mon, 09 Nov 2009 15:10:48 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7aZZ-0001ZH-HJ for grub-devel@gnu.org; Mon, 09 Nov 2009 15:10:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7aZT-0001Y6-S2 for grub-devel@gnu.org; Mon, 09 Nov 2009 15:10:44 -0500 Received: from [199.232.76.173] (port=47907 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7aZT-0001Y3-Jm for grub-devel@gnu.org; Mon, 09 Nov 2009 15:10:39 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:57576) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N7aZS-0003of-DT for grub-devel@gnu.org; Mon, 09 Nov 2009 15:10:38 -0500 Received: from [85.180.21.45] (e180021045.adsl.alicedsl.de [85.180.21.45]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0Mgpo8-1MlVLG04oa-00M9iu; Mon, 09 Nov 2009 21:10:34 +0100 From: Felix Zielcke To: The development of GNU GRUB In-Reply-To: <20091109200450.GB15993@thorin> References: <4AE95BEC.4040102@gmail.com> <4AE96168.8070605@gmail.com> <20091109161653.GA5006@thorin> <20091109200450.GB15993@thorin> Content-Type: text/plain; charset="UTF-8" Date: Mon, 09 Nov 2009 21:10:33 +0100 Message-ID: <1257797433.2967.13.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1+JVOrECySrg/m86UATLAgagm0SUzZ72ec7RrZ 3+eEGv1F1rnVVPegoqp/GRn9ZewNZRphEsyBqi2rj26G5iUOyg Inbjdh8aD1KvlY9LKeDfHmNHS4KjqpD X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:10:45 -0000 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? -- Felix Zielcke Proud Debian Maintainer and GNU GRUB developer