Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Oct 2011 09:45:29 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Jaakko Heinonen <jh@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r226151 - head/usr.bin/kdump
Message-ID:  <86hb3gj7ja.fsf@ds4.des.no>
In-Reply-To: <20111010145642.GA2057@a91-153-123-205.elisa-laajakaista.fi> (Jaakko Heinonen's message of "Mon, 10 Oct 2011 17:56:43 %2B0300")
References:  <201110081221.p98CLpWq062285@svn.freebsd.org> <20111010145642.GA2057@a91-153-123-205.elisa-laajakaista.fi>

next in thread | previous in thread | raw e-mail | index | archive | help
Jaakko Heinonen <jh@FreeBSD.org> writes:
> Dag-Erling Smorgrav <des@FreeBSD.org> 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 =3D ',';					\
> > +	} while (0)
> Are you sure that this change doesn't cause a regression on platforms
> where sizeof(long) !=3D 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...

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86hb3gj7ja.fsf>