Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Oct 2002 22:15:23 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        freebsd-arch@FreeBSD.org, Peter Wemm <peter@wemm.org>, Andrew Gallatin <gallatin@cs.duke.edu>
Subject:   Re: lp64 vs lp32 printf
Message-ID:  <20021010221405.G8817-100000@gamplex.bde.org>
In-Reply-To: <XFMail.20021009164506.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 9 Oct 2002, John Baldwin wrote:

> On 09-Oct-2002 Bruce Evans wrote:
> > On Wed, 9 Oct 2002, John Baldwin wrote:
> >> [ddb/db_examine.c's use of %z]
> >> Hmm, the second case doesn't even use a sign so it can be %x anyways.
> >
> > This seems to be just a bug.  The original db_printf() prints -1 as -1
> > for %z format.  From db_output.c rev.1.1:
>
> So should %z force sign on?
>
> --- subr_prf.c  28 Sep 2002 21:34:31 -0000      1.88
> +++ subr_prf.c  9 Oct 2002 20:41:53 -0000
> @@ -664,8 +664,8 @@
>                         goto handle_nosign;
>                 case 'z':
>                         base = 16;
> -                       if (sign)
> -                               goto handle_sign;
> +                       sign = 1;
> +                       goto handle_sign;
>  handle_nosign:
>                         sign = 0;
>                         if (jflag)
>

This seems to be correct.  I have not checked any of this at runtime.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021010221405.G8817-100000>