This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: sprintf %hi converion


> 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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]