From owner-freebsd-hackers Sat Feb 27 2:18:37 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id BC7F915151 for ; Sat, 27 Feb 1999 02:18:06 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from localhost (dfr@localhost) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id KAA76661; Sat, 27 Feb 1999 10:16:45 GMT (envelope-from dfr@nlsystems.com) Date: Sat, 27 Feb 1999 10:16:45 +0000 (GMT) From: Doug Rabson To: Andy Doran Cc: "Alton, Matthew" , "'Hackers@FreeBSD.ORG'" , "Ladendorf, Matt" Subject: Re: printf wierdness In-Reply-To: <36D70AC8.A862B8C0@psn.ie> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 26 Feb 1999, Andy Doran wrote: > printf() is treating the %llu type as an unsigned long (%lu), > so it's taking the value for %s from the second 32-bits in > 'foo'. Check the printf(3) manpage. I would like to change this. I noticed the problem when building an alpha cross debugger (hosted on i386, targetted at alpha). Locally, I have changed printf to treat "%lld" the same as "%qd": Index: vfprintf.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdio/vfprintf.c,v retrieving revision 1.20 diff -u -r1.20 vfprintf.c --- vfprintf.c 1998/09/16 04:17:44 1.20 +++ vfprintf.c 1999/02/20 10:20:08 @@ -545,7 +545,10 @@ flags |= SHORTINT; goto rflag; case 'l': - flags |= LONGINT; + if (flags & LONGINT) + flags |= QUADINT; + else + flags |= LONGINT; goto rflag; case 'q': flags |= QUADINT; @@ -1016,7 +1019,10 @@ flags |= SHORTINT; goto rflag; case 'l': - flags |= LONGINT; + if (flags & LONGINT) + flags |= QUADINT; + else + flags |= LONGINT; goto rflag; case 'q': flags |= QUADINT; -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message