This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: sprintf %hi converion
- To: jsm28 at cam dot ac dot uk
- Subject: Re: sprintf %hi converion
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: Fri, 29 Jun 2001 16:51:42 -0700
- CC: matt at god dot vtic dot net, libc-alpha at sourceware dot cygnus dot com
- References: <Pine.SOL.4.33.0106292228300.21704-100000@green.csi.cam.ac.uk>
- Reply-to: Geoff Keating <geoffk at redhat dot com>
> Date: Fri, 29 Jun 2001 22:32:20 +0100 (BST)
> From: "Joseph S. Myers" <jsm28@cam.ac.uk>
> On Fri, 29 Jun 2001, Matt Wimer wrote:
>
> > Conversion of an int using %hi doesn't cast the va_arg (ap, int) to
> > 'short int' like freebsd, solaris, and netbsd. I'm guessing
> > that this is a bug because it doesn't conform to the man pages
> > which seem to be pretty definative. This may not be in the
> > posix spec but it seems everyone else deals with this bad input
> > the same way.
>
> See the appended comp.std.c messages. The experts seem to differ in this
> area; you could always bring it up again on comp.std.c, or elsewhere.
I believe that, after some discussion, the consensus was that the
specification for printf() does not require it be implemented by
using stdarg, it can be done some magic way, and so when the
specification for printf() says that hh takes an 'unsigned char'
argument, then the argument must really be an unsigned char.
--
- Geoffrey Keating <geoffk@geoffk.org>