From owner-svn-src-all@FreeBSD.ORG Tue Oct 11 09:00:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A98D106564A; Tue, 11 Oct 2011 09:00:56 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 519178FC13; Tue, 11 Oct 2011 09:00:56 +0000 (UTC) Received: from jh (a91-153-115-208.elisa-laajakaista.fi [91.153.115.208]) by gw01.mail.saunalahti.fi (Postfix) with ESMTP id 6A00B1517FF; Tue, 11 Oct 2011 12:00:50 +0300 (EEST) Date: Tue, 11 Oct 2011 12:00:50 +0300 From: Jaakko Heinonen To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Message-ID: <20111011090049.GA69508@jh> References: <201110081221.p98CLpWq062285@svn.freebsd.org> <20111010145642.GA2057@a91-153-123-205.elisa-laajakaista.fi> <86hb3gj7ja.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86hb3gj7ja.fsf@ds4.des.no> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226151 - head/usr.bin/kdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2011 09:00:56 -0000 On 2011-10-11, Dag-Erling Smørgrav wrote: > Jaakko Heinonen writes: > > Dag-Erling Smorgrav writes: > > > +#define print_number(i,n,c) \ > > > + do { \ > > > + if (decimal) \ > > > + printf("%c%jd", c, (intmax_t)*i); \ > > > + else \ > > > + printf("%c%#jx", c, (intmax_t)*i); \ > > > + i++; \ > > > + n--; \ > > > + c = ','; \ > > > + } while (0) > > Are you sure that this change doesn't cause a regression on platforms > > where sizeof(long) != sizeof(intmax_t)? > > > > For example, previously, on i386 print_number() printed "0xffffffff" for > > -1 while after your change it will print "0xffffffffffffffff" (with %#jx). > > You are right, the cast for the hex case should be to uintmax_t. I > think I got all the other instances right... I am not sure if you understood what I meant here. Casting to uintmax_t is obviously more correct but print_number() will still print the negative range in "64-bit" format on i386. I went ahead to test this and here is an example diff how the output has been changed: --- out1.txt 2011-10-11 11:50:41.000000000 +0300 +++ out2.txt 2011-10-11 11:51:44.000000000 +0300 @@ -1,18 +1,18 @@ 1754 ktrace RET ktrace 0 - 1754 ktrace CALL execve(0xbfbfe6f8,0xbfbfec2c,0xbfbfec34) + 1754 ktrace CALL execve(0xffffffffbfbfe6f8,0xffffffffbfbfec2c,0xffffffffbfbfec34) 1754 ktrace NAMI "/sbin/id" 1754 ktrace RET execve -1 errno 2 No such file or directory - 1754 ktrace CALL execve(0xbfbfe6f8,0xbfbfec2c,0xbfbfec34) + 1754 ktrace CALL execve(0xffffffffbfbfe6f8,0xffffffffbfbfec2c,0xffffffffbfbfec34) 1754 ktrace NAMI "/bin/id" 1754 ktrace RET execve -1 errno 2 No such file or directory - 1754 ktrace CALL execve(0xbfbfe6f8,0xbfbfec2c,0xbfbfec34) + 1754 ktrace CALL execve(0xffffffffbfbfe6f8,0xffffffffbfbfec2c,0xffffffffbfbfec34) I consider the new output incorrect on a 32-bit platform. -- Jaakko