Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LsuhP-0004Sg-KS for mharc-grub-devel@gnu.org; Sun, 12 Apr 2009 04:05:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LsuhN-0004S6-F6 for grub-devel@gnu.org; Sun, 12 Apr 2009 04:05:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LsuhN-0004Ru-3U for grub-devel@gnu.org; Sun, 12 Apr 2009 04:05:53 -0400 Received: from [199.232.76.173] (port=59232 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsuhM-0004Rr-RO for grub-devel@gnu.org; Sun, 12 Apr 2009 04:05:52 -0400 Received: from [74.93.104.97] (port=51236 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LsuhJ-0005wy-F3; Sun, 12 Apr 2009 04:05:49 -0400 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id 64BA7C8C0DD; Sun, 12 Apr 2009 01:05:40 -0700 (PDT) Date: Sun, 12 Apr 2009 01:05:40 -0700 (PDT) Message-Id: <20090412.010540.38254375.davem@davemloft.net> To: grub-devel@gnu.org, proski@gnu.org From: David Miller In-Reply-To: <1239518362.3887.29.camel@mj> References: <20090411.010829.45951849.davem@davemloft.net> <1239518362.3887.29.camel@mj> X-Mailer: Mew version 6.2.51 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Subject: Re: [PATCH]: grub: Fix handling of long printf arguments on 64-bit. 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: Sun, 12 Apr 2009 08:05:53 -0000 From: Pavel Roskin Date: Sun, 12 Apr 2009 02:39:22 -0400 > On Sat, 2009-04-11 at 01:08 -0700, David Miller wrote: >> The grub printf code tries to treat 'long' and 'int' the same, >> that doesn't work on (most) 64-bit platforms. > >> + n = (unsigned) (-((long) n)); > > "unsigned" means "unsigned int". You need "unsigned long" here. Thanks, I'll fix this as follows. * kern/misc.c (grub_ltoa): Fix cast when handling negative values. Noticed by Pavel Roskin. --- kern/misc.c (revision 2086) +++ kern/misc.c (working copy) @@ -598,7 +598,7 @@ if ((long) n < 0 && c == 'd') { - n = (unsigned) (-((long) n)); + n = (unsigned long) (-((long) n)); *str++ = '-'; }