Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MH9kA-00073n-Qn for mharc-grub-devel@gnu.org; Thu, 18 Jun 2009 01:00:59 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MH9k7-0006yL-6P for grub-devel@gnu.org; Thu, 18 Jun 2009 01:00:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MH9k0-0006mV-WA for grub-devel@gnu.org; Thu, 18 Jun 2009 01:00:53 -0400 Received: from [199.232.76.173] (port=49081 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MH9k0-0006lo-Mn for grub-devel@gnu.org; Thu, 18 Jun 2009 01:00:48 -0400 Received: from arnold.marlboro.edu ([206.192.68.78]:46282) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MH9k0-0005qH-8i for grub-devel@gnu.org; Thu, 18 Jun 2009 01:00:48 -0400 Received: from [192.168.0.103] (71-10-231-36.dhcp.oxfr.ma.charter.com [71.10.231.36]) by arnold.marlboro.edu (Postfix) with ESMTP id 47AE934651C; Thu, 18 Jun 2009 01:00:13 -0400 (EDT) Message-ID: <4A39C9DC.3050207@isaac.cedarswampstudios.org> Date: Thu, 18 Jun 2009 01:00:12 -0400 From: Isaac Dupree User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: The development of GRUB 2 References: <1245275268.32616.62.camel@mj> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Marlboro-Information: Please contact techsupport@marlboro.edu for more information X-Marlboro-MailScanner-ID: 47AE934651C.A7D43 X-Marlboro-MailScanner: clean X-Marlboro-SpamCheck: not spam, SpamAssassin (not cached, score=2.081, required 6, autolearn=disabled, BANG_GUAR 0.94, BAYES_20 -0.74, RCVD_IN_PBL 0.91, RCVD_IN_SORBS_DUL 0.88, RDNS_DYNAMIC 0.10) X-Marlboro-SpamScore: ss X-Marlboro-MailScanner-From: ml@isaac.cedarswampstudios.org X-Marlboro-MailScanner-Watermark: 1245906014.29894@FP4/JWDh0OmTqMBBAM/maQ X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: Re: Warning free build achieved, coreboot documentation updated X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2009 05:00:55 -0000 Vladimir 'phcoder' Serbinenko wrote: > The remaining is > util/hostdisk.c:1061: comparison between signed and unsigned > The problem comes from the following declaration > # define GRUB_LONG_MIN -2147483648UL > As you see we declare a negative number with UL. This works correctly on > i386 but what about other architectures? Can this warning be just silenced > with a cast or do we have a real problem here? it is portable since C standard defines unsigned numbers to have modular arithmetic. However it therefore can't be silenced with a cast to a signed number (which doesn't have that guarantee!) Note that casts between signed/unsigned of the same size are guaranteed to work as expected. this should work without warnings I guess?: # define GRUB_LONG_MIN (0UL - 2147483648UL) do you want it to be of a signed type, though? then cast that to (long) afterwards. (-1L - 2147483647L) would work too. it's annoying isn't it that C doesn't actually have negative numeric literals :-) -Isaac